Actions

class stonesoup.sensor.action.dwell_action.ChangeDwellAction(end_time: datetime, target_value: Any, rotation_end_time: datetime, generator: Any = None, increasing_angle: bool = None)[source]

Bases: Action

The action of changing the dwell centre of sensors where dwell_centre is an ActionableProperty

Parameters:
  • end_time (datetime.datetime) – Time at which modification of the attribute ends.

  • target_value (Any) – Target value.

  • rotation_end_time (datetime.datetime) – End time of rotation.

  • generator (Any, optional) – Action generator that created the action.

  • increasing_angle (bool, optional) – Indicated the direction of change in the dwell centre angle.

rotation_end_time: datetime

End time of rotation.

increasing_angle: bool

Indicated the direction of change in the dwell centre angle.

act(current_time, timestamp, init_value, **kwargs)[source]

Assumes that duration keeps within the action end time

Parameters:
  • current_time (datetime.datetime) – Current time

  • timestamp (datetime.datetime) – Modification of attribute ends at this time stamp

  • init_value (Any) – Current value of the dwell centre

Returns:

The new value of the dwell centre

Return type:

Any

class stonesoup.sensor.action.dwell_action.DwellActionsGenerator(owner: object, attribute: str, start_time: datetime, end_time: datetime, resolution: Angle = np.float64(0.017453292519943295), rpm: float = 60)[source]

Bases: RealNumberActionGenerator

Generates possible actions for changing the dwell centre of a sensor in a given time period.

Parameters:
  • owner (object) – Object with timestamp, rpm (revolutions per minute) and resolution.

  • attribute (str) – The name of the attribute to be modified.

  • start_time (datetime.datetime) – Start time of action.

  • end_time (datetime.datetime) – End time of action.

  • resolution (Angle, optional) – Resolution of the action space.

  • rpm (float, optional) – The number of rotations per minute (RPM).

owner: object

Object with timestamp, rpm (revolutions per minute) and resolution.

resolution: Angle

Resolution of the action space.

rpm: float

The number of rotations per minute (RPM).

property default_action

The default action to modify the property if there is no given action.

action_from_value(value)[source]

Given a value for dwell centre, what action would achieve that dwell centre value.

Parameters:

value (Any) – Dwell centre value for which the action is required.

Returns:

Action which will achieve this dwell centre.

Return type:

ChangeDwellAction