cosapp.multimode.discreteStepper

Event handling and discrete stepping

Classes

DiscreteStepper(driver)

EventRecord(time, events)

Named tuple associating a list of joint events and their occurrence time.

class cosapp.multimode.discreteStepper.DiscreteStepper(driver: Driver)[source]

Bases: object

discrete_step() List[Event][source]

Performs a discrete step other than the first one

event_detected() bool[source]

Tests all primitive events and returns a Boolean value indicating whether at least one of these events is to be triggered.

events() Iterator[Event][source]

Iterator on handled events

find_primal_events() EventRecord[source]

Returns a EventRecord named tuple containing the first primitive events triggered, together with their occurrence time ((inf, []) if no primitive event is triggered). The internal state is only updated if an event is triggered. This method should only be called at the first microstep of the first discrete time step.

first_discrete_step() EventRecord[source]

Performs the first discrete step and returns an EventRecord indicating which primitive event was triggered and at which date.

initialize() None[source]

Update event list, and initialize all events

property interval: Tuple[float, float]

time interval

Type:

Tuple[float, float]

present_events() Iterator[Event][source]

Returns an iterator on all present events

reevaluate_primitive_events() None[source]
reset() None[source]

Update event list, and reset all events

set_data(interval, interpol) None[source]

Sets interpolation data used for detecting the first event that occurred in a given time step.

shift() None[source]

Performs a time shift of all primitive events.

property sysview: SystemInterpolator

system interpolator used for event time finding

Type:

SystemInterpolator

tick()[source]

Ends a discrete loop by ticking all events.

trigger_time(event: Event) float[source]

Returns the date at which a primitive event was triggered. This method may only be called once the list of all triggered events is known and the interpolation data has been set.

update_events() None[source]

Update event list from system of interest, and from stop criterion of owner time driver.

class cosapp.multimode.discreteStepper.EventRecord(time: float, events: List[Event])[source]

Bases: NamedTuple

Named tuple associating a list of joint events and their occurrence time.

classmethod empty()[source]
events: List[Event]

Alias for field number 1

time: float

Alias for field number 0

cosapp.multimode.discreteStepper.object__getstate__(self, /)

Helper for pickle.