coopihc.inference.ContinuousKalmanUpdate.ContinuousKalmanUpdate

class ContinuousKalmanUpdate(*args, **kwargs)[source]

Bases: coopihc.inference.BaseInferenceEngine.BaseInferenceEngine

An inference engine which estimates the new state according to a continuous kalman filter, where state transition dynamics and kalman gains are provided externally.

Methods

add_observation

add observation

bind

Bind function to the engine with a given name.

default_value

Apply this decorator to use self.agent_observation as default value to infer from if agent_observation = None

infer

render

reset

reset _summary_

set_K

Set the Kalman gain

set_forward_model_dynamics

set forward model dynamics

Attributes

action

The agent's last action

host

observation

The last observation.

role

state

The current agent state

unwrapped

property action

The agent’s last action

Returns

agent action

Return type

State

add_observation(observation)

add observation

Add an observation to a buffer. If the buffer does not exist, create a naive buffer. The buffer has a size given by buffer length

Parameters

observation (State) – observation produced by an engine

bind(func, as_name=None)

Bind function to the engine with a given name. If as_name is None, then the func name is used.

Parameters
  • func (function) – function to bind

  • as_name (string, optional) – name of resulting method, defaults to None

Returns

bound method

Return type

method

default_value()

Apply this decorator to use self.agent_observation as default value to infer from if agent_observation = None

property observation

The last observation.

Returns

last observation

Return type

State

reset(random=True)

reset _summary_

Empty the buffer

Parameters

random (bool, optional) – whether to randomize parameters internal to the inference engine. This is provided in case of subclass the BaseInferenceEngine, defaults to True.

set_K(K)[source]

Set the Kalman gain

Parameters

K (numpy.ndarray) – Kalman Gain

set_forward_model_dynamics(A, B, C)[source]

set forward model dynamics

Call this externally to supply the linear dynamic matrices that describe the deterministic part of the state transitions:

\[\begin{split}\begin{align*} d\hat{x} = A\hat{x}dt + Budt \\ dy = C \hat{x} dt \end{align*}\end{split}\]
Parameters
  • A (numpy.ndarray) – see equation above

  • B (numpy.ndarray) – see equation above

  • C (numpy.ndarray) – see equation above

property state

The current agent state

Returns

agent state

Return type

State