pogona.SensorManager
- class pogona.SensorManager[source]
Bases:
Component
Attributes
Since this component is not created by the config, choose a name
Notify subscribed sensors based on object mesh cells.
When determining possible sensor subscriptions, execute range queries on the Object's k-d tree instead of iterating the entire mesh.
Methods
__init__
()finalize
(simulation_kernel)initialize
(simulation_kernel, init_stage)Use
InitStages
to initialize this Component instance.Called after the position of a particle has been updated.
Called before updating the position of a particle within a time step.
process_new_time_step
(simulation_kernel, ...)register_sensor
(sensor)- param sensor
set_arguments
(**kwargs)Read arguments as key value pairs and set this component's member variables accordingly.
- finalize(simulation_kernel: SimulationKernel)
- initialize(simulation_kernel: SimulationKernel, init_stage: InitStages)[source]
Use
InitStages
to initialize this Component instance.
- process_molecule_moving_after(simulation_kernel: SimulationKernel, molecule: Molecule)[source]
Called after the position of a particle has been updated. Useful for updating regular sensors.
- Parameters
simulation_kernel –
molecule –
- Returns
- process_molecule_moving_before(simulation_kernel: SimulationKernel, molecule: Molecule)[source]
Called before updating the position of a particle within a time step. Useful for SensorTeleporting, for example, which should consider the position of particles right after they have been spawned.
- Parameters
simulation_kernel –
molecule –
- Returns
- process_new_time_step(simulation_kernel: SimulationKernel, notification_stage: NotificationStages)
- set_arguments(**kwargs)
Read arguments as key value pairs and set this component’s member variables accordingly. Validity of the argument values will be checked in
initialize()
.
- component_name = 'sensor_manager'
Since this component is not created by the config, choose a name
- default_use_sensor_subscriptions = True
Notify subscribed sensors based on object mesh cells. This speeds up simulation. Only disable this if you are constrained by memory. Individual objects can override this setting.
- id
Unique integer component ID
- use_range_queries = True
When determining possible sensor subscriptions, execute range queries on the Object’s k-d tree instead of iterating the entire mesh. Use this if all sensors occupy a relatively small volume compared to each mesh. Performance may degrade for large sensors.