pogona.SensorDestructing
- class pogona.SensorDestructing[source]
Bases:
Sensor
Attributes
Unique name of this component, unless it is "Generic component".
Shape of this sensor.
Methods
__init__
()finalize
(simulation_kernel)initialize
(simulation_kernel, init_stage)Use
InitStages
to initialize this Component instance.is_inside_sensor_zone
(position_global)Override this method for your sensing algorithm.
Called before updating the position of a particle within a time step.
process_new_time_step
(simulation_kernel, ...)set_arguments
(**kwargs)Read arguments as key value pairs and set this component's member variables accordingly.
turn_off
()turn_on
()- finalize(simulation_kernel: SimulationKernel)
- initialize(simulation_kernel: SimulationKernel, init_stage: InitStages)[source]
Use
InitStages
to initialize this Component instance.
- is_inside_sensor_zone(position_global: ndarray)
- process_molecule_moving_after(simulation_kernel: SimulationKernel, molecule: Molecule)[source]
Override this method for your sensing algorithm. The sensor manager will use this method to notify you of all molecule movement inside of the sensor zone. However, it may also notify you of molecule movement outside of your sensor zone! So make sure you additionally check the molecule position yourself. See SensorCounting for a simple reference implementation.
- Parameters
simulation_kernel – The single simulation kernel
molecule – Which molecule has moved, with the new position
- process_molecule_moving_before(simulation_kernel: SimulationKernel, molecule: Molecule)
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 = 'Generic component'
Unique name of this component, unless it is “Generic component”.
- id
Unique integer component ID
- rotation = [0, 0, 0]
- scale = [1, 1, 1]
- sensor_id: int
Unique integer sensor ID. Set by the sensor manager.
- shape = 'NONE'
Shape of this sensor. Valid shapes are defined in the
pogona.Shapes
enum.
- property transformation: Transformation
- translation = [0, 0, 0]
- turned_on = True