CADETProcess.dynamicEvents.EventHandler

Contents

CADETProcess.dynamicEvents.EventHandler#

class CADETProcess.dynamicEvents.EventHandler(cycle_time, _lock)[source]#

A handler for dynamic events that affect parameters in a process.

The EventHandler class provides a framework to schedule and manage events that cause changes to parameters during a simulation or process. This includes single point events as well as durations, and it allows for events to be dependent on others, forming complex relationships. Events can be associated with transformations or factors that determine their effect.

Primary functionalities: - Schedule events with specific timings and effects. - Establish dependencies between events. - Manage durations or continuous periods with specific characteristics. - Access sorted lists of independent and dependent events.

See also

Event

Represents a single point change in the system’s parameters.

Duration

Represents a continuous time period with specific attributes or effects.

Notes

The class relies heavily on the concept of “events”, which are instances of dynamic changes that can influence parameters in the system. These events can be independent or based on other events, creating intricate relationships to capture complex scenarios.

Attributes:
eventslist

A sorted list of scheduled events, ordered by their execution time.

durationslist

List of time durations with specific characteristics.

event_dictdict

A dictionary containing detailed information about all scheduled events.

durations_dictdict

A dictionary containing detailed information about all defined durations.

independent_eventslist

A list of events that are not influenced by other events.

dependent_eventslist

A list of events that rely on other events.

event_performersdict (not shown in provided code, description based on context)

A mapping of objects that can perform or be affected by events.

event_parameterslist

A list of unique parameters that the events will affect.

event_timeslist

A list of unique times when events are scheduled to occur, sorted chronologically.

section_timeslist

A list of times demarcating sections based on event timings.

n_sectionsint

int: Number of sections.

section_statesdict

A dictionary providing the state of event parameters at the beginning of every section.

parameter_eventsdict

A dictionary mapping each parameter to the list of events that affect it.

Methods

add_duration(name[, time])

Register a new duration or time point of interest.

add_event(name, parameter_path, state[, ...])

Add a new event that changes a parameter during the process.

add_event_dependency(dependent_event, ...[, ...])

Create a dependency relationship between events.

check_config()

Validate the event configuration.

check_duplicate_events()

Ensure no simulateneous events are scheduled for a specific parameter and index.

check_required_parameters()

Verify if all required parameters are set.

check_uninitialized_indices()

Ensure all indices are specified when a parameter isn't initialized.

plot_events([use_minutes])

Plot parameter state as a function of time.

remove_duration(duration_name)

Remove a specified duration or time point from tracking.

remove_event(evt_name)

Remove a specified event from the event handler.

remove_event_dependency(dependent_event, ...)

Remove a previously defined dependency between events.