ethos_penalps.process_state_handler#
Module Contents#
Classes#
The ProcessStateHandler contains all objects necessary to switch the process states of a process step. |
Attributes#
- ethos_penalps.process_state_handler.logger#
- class ethos_penalps.process_state_handler.ProcessStateHandler(process_step_data: ethos_penalps.process_step_data.ProcessStepData)#
The ProcessStateHandler contains all objects necessary to switch the process states of a process step. Its core functionality is to switch between Idle, InputRequestingProcessStates, OutputProvidingProcessStates. In order to switch from the current process state the process_state_switch_selector_handler is required. It determines which process_state_switch is conducted. This allows multi path routes in a network of process states. The process state switch determines the next process state and the switch time of the process state. The process_state_dictionary must contain an idle, input requesting and output providing process state.
- switch_to_output_stream_providing_state(activation_date: datetime.datetime) ethos_penalps.process_state.OutputStreamProvidingState#
- switch_to_input_stream_requesting_state(force_first_switch: bool = False) ethos_penalps.process_state.InputStreamProvidingState#
- switch_to_idle_state() ethos_penalps.process_state.ProcessStateIdle#
- check_if_multiple_target_states_are_possible()#
- get_earliest_output_stream_production_time() datetime.datetime#
- switch_to_previous_state() ethos_penalps.process_state.ProcessState#
1.Determines which process state switch should be applied from the current state. 2. Determines the next switch time. 3. Sets end time off current state and stores state to process_entry_dict 4. Sets start time for next process state
- Raises:
Exception – _description_
- Returns:
_description_
- Return type:
- activate_state(state_name_to_activate: str, time_to_activate: datetime.datetime) ethos_penalps.process_state.ProcessState#
- deactivate_state(state_name_to_deactivate: str, time_to_deactivate: datetime.datetime)#
Deactivates the current state at time_to_deactivate provided. It is assumed that the state to be deactivated has already an end_time. Time to deactivate is then set and the state is stored to process state list.
- Parameters:
state_name_to_deactivate (str) – _description_
time_to_deactivate (datetime.datetime) – _description_
- Raises:
Exception – _description_
- restore_process_step_data(time_data_at_start: ethos_penalps.time_data.TimeData, simulation_state_data_at_start: ethos_penalps.simulation_data.container_simulation_data.CurrentProductionStateData, branch_data_at_start: ethos_penalps.simulation_data.container_branch_data.OutputBranchData)#
Restores the state of the process step data from another process step data.
- Parameters:
time_data_at_start (TimeData) – _description_
simulation_state_data_at_start (CurrentProductionStateData) – _description_
- prepare_for_new_production_branch(new_output_stream_state: ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState, incomplete_output_branch_data: ethos_penalps.simulation_data.container_branch_data.IncompleteOutputBranchData)#
Resets some values for a new Production Branch
- Parameters:
new_output_stream_state (ContinuousStreamState | BatchStreamState) – _description_
- Raises:
Exception – _description_
- check_if_input_and_output_stream_occur_in_same_state() bool#
- get_output_stream_providing_state_name() str#
- get_process_state(process_state_name: str) ethos_penalps.process_state.ProcessState#
- add_process_state(process_state: ethos_penalps.process_state.ProcessState, add_as_current_state: bool = False)#
- store_current_state_to_process_state_list() ethos_penalps.data_classes.ProcessStepProductionPlanEntry#
- create_state_for_parallel_input_and_output_stream_with_storage(process_state_name: str, add_as_current_state: bool = False) ethos_penalps.process_state.ProcessStateParallelContinuousInputWithStorage#
- create_continuous_output_stream_providing_state(process_state_name: str) ethos_penalps.process_state.ContinuousOutputStreamProvidingState#
- create_batch_output_stream_providing_state(process_state_name: str) ethos_penalps.process_state.BatchOutputStreamProvidingState#
- create_continuous_input_stream_requesting_state(process_state_name: str) ethos_penalps.process_state.ContinuousInputStreamRequestingStateWithStorage#
- create_output_stream_providing_state_from_storage(process_state_name: str, maximum_stream_mass: float | None = None) ethos_penalps.process_state.OutputStreamFromStorageState#
- create_batch_input_stream_requesting_state(process_state_name: str) ethos_penalps.process_state.BatchInputStreamRequestingStateWithStorage#
- create_full_batch_input_stream_requesting_state(process_state_name: str) ethos_penalps.process_state.FullBatchInputStreamProvidingState#
- create_batch_input_stream_requesting_state_energy_based_on_stream_mass(process_state_name: str) ethos_penalps.process_state.BatchInputStreamRequestingStateWithStorageEnergyBasedOnStream#
- create_idle_process_state(process_state_name: str, add_as_current_state: bool = True) ethos_penalps.process_state.ProcessStateIdle#
- create_intermediate_process_state(process_state_name: str) ethos_penalps.process_state.IntermediateState#
- create_intermediate_process_state_energy_based_on_stream_mass(process_state_name: str)#
- get_output_stream_providing_state() ethos_penalps.process_state.OutputStreamProvidingState#
- get_input_stream_providing_state() ethos_penalps.process_state.InputStreamProvidingState#
- get_idle_state() ethos_penalps.process_state.ProcessStateIdle#