pogona.SensorManager

class pogona.SensorManager[source]

Bases: pogona.component.Component

Attributes

component_name

Since this component is not created by the config, choose a name

default_use_sensor_subscriptions

Notify subscribed sensors based on object mesh cells.

use_range_queries

When determining possible sensor subscriptions, execute range queries on the Object's k-d tree instead of iterating the entire mesh.

__init__()[source]

Methods

__init__()

finalize(simulation_kernel)

initialize(simulation_kernel, init_stage)

Use InitStages to initialize this Component instance.

process_molecule_moving_after(...)

Called after the position of a particle has been updated.

process_molecule_moving_before(...)

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.

__init__()[source]
finalize(simulation_kernel: pogona.simulation_kernel.SimulationKernel)
initialize(simulation_kernel: pogona.simulation_kernel.SimulationKernel, init_stage: pogona.component.InitStages)[source]

Use InitStages to initialize this Component instance.

process_molecule_moving_after(simulation_kernel: pogona.simulation_kernel.SimulationKernel, molecule: pogona.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: pogona.simulation_kernel.SimulationKernel, molecule: pogona.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: pogona.simulation_kernel.SimulationKernel, notification_stage: pogona.component.NotificationStages)
register_sensor(sensor: pogona.sensor.Sensor)[source]
Parameters

sensor

Returns

nothing

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.