Actions
- class stonesoup.sensor.action.Action(end_time: datetime, target_value: Any, generator: Any = None)[source]
Bases:
Base
The base class for an action that can be taken by a sensor or platform with an
ActionableProperty
.- Parameters
end_time (
datetime.datetime
) – Time at which modification of the attribute ends.target_value (
Any
) – Target value.generator (
Any
, optional) – Action generator that created the action.
- act(current_time, timestamp, init_value)[source]
Return the attribute modified.
- 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 modifiable attribute
- Returns
The new value of the attribute
- Return type
Any
- class stonesoup.sensor.action.ActionGenerator(owner: object, attribute: str, start_time: datetime, end_time: datetime, resolution: float = None)[source]
Bases:
Base
The base class for an action generator.
- Parameters
owner (
object
) – Actionable object that has the attribute to be modified.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 (
float
, optional) – Resolution of action space
- property current_value
Return the current value of the owner’s attribute.
- property default_action
The default action to modify the property if there is no given action.
- class stonesoup.sensor.action.RealNumberActionGenerator(owner: object, attribute: str, start_time: datetime, end_time: datetime, resolution: float = None)[source]
Bases:
ActionGenerator
Action generator where action is a choice of a real number.
- Parameters
owner (
object
) – Actionable object that has the attribute to be modified.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 (
float
, optional) – Resolution of action space
- 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.
- act(current_time, timestamp, init_value)[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 = 0.017453292519943295)[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 dwell-centre attributesattribute (
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 action space
- property default_action
The default action to modify the property if there is no given action.