cosapp.multimode.discreteStepper

Event handling and discrete stepping

Classes

DiscreteStepper(driver)

TimedEvent(event, time)

Named tuple associating an event and its 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_event() TimedEvent[source]

Returns a TimedEvent named tuple containing the first primitive event triggered, together with its occurrence date ((None, 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() TimedEvent[source]

Performs the first discrete step and returns a TimedEvent 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.

set_events() None[source]

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

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.

class cosapp.multimode.discreteStepper.TimedEvent(event: Event, time: float)[source]

Bases: NamedTuple

Named tuple associating an event and its occurrence time

classmethod empty()[source]
event: Event

Alias for field number 0

time: float

Alias for field number 1