:py:mod:`ethos_penalps.process_state`
=====================================

.. py:module:: ethos_penalps.process_state


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   ethos_penalps.process_state.ProcessState
   ethos_penalps.process_state.OutputStreamProvidingState
   ethos_penalps.process_state.InputStreamProvidingState
   ethos_penalps.process_state.FullBatchInputStreamProvidingState
   ethos_penalps.process_state.InputAndOutputStreamProvidingState
   ethos_penalps.process_state.IntermediateState
   ethos_penalps.process_state.IntermediateStateBasedOnEnergy
   ethos_penalps.process_state.ProcessStateParallelContinuousInputWithStorage
   ethos_penalps.process_state.ContinuousOutputStreamProvidingState
   ethos_penalps.process_state.OutputStreamFromStorageState
   ethos_penalps.process_state.BatchOutputStreamProvidingState
   ethos_penalps.process_state.ContinuousInputStreamRequestingStateWithStorage
   ethos_penalps.process_state.BatchInputStreamRequestingStateWithStorage
   ethos_penalps.process_state.BatchInputStreamRequestingStateWithStorageEnergyBasedOnStream
   ethos_penalps.process_state.ProcessStateIdle
   ethos_penalps.process_state.ProcessStateSwitchHandler




Attributes
~~~~~~~~~~

.. autoapisummary::

   ethos_penalps.process_state.logger


.. py:data:: logger

   

.. py:class:: ProcessState(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`abc.ABC`

   This class represents a state in  process step. The states primary

   .. py:method:: _create_process_step_production_plan_entry(process_state_state: ethos_penalps.data_classes.ProcessStateData) -> ethos_penalps.data_classes.ProcessStepProductionPlanEntry


   .. py:method:: create_process_state_energy_data_based_on_stream_mass(specific_energy_demand: float, load_type: ethos_penalps.load_profile_calculator.LoadType, stream: ethos_penalps.stream.BatchStream | ethos_penalps.stream.ContinuousStream)


   .. py:method:: add_process_state_energy_data(process_state_energy_data: ethos_penalps.load_profile_calculator.ProcessStateEnergyLoadData)



.. py:class:: OutputStreamProvidingState(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData, maximum_stream_mass: float | None = None)


   Bases: :py:obj:`ProcessState`, :py:obj:`abc.ABC`

   This class represents a state in  process step. The states primary

   .. py:method:: determine_if_stream_mass_can_be_provided(output_stream_state: ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState) -> ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState

      Check if the required output_mass can be provided under the constraint of
      the maximum stream mass of this process state. Returns an adapted state
      if it exceeds the maximum mass.

      :param output_stream_state: _description_
      :type output_stream_state: ContinuousStreamState | BatchStreamState
      :raises Exception: _description_
      :raises Exception: _description_
      :return: _description_
      :rtype: ContinuousStreamState | BatchStreamState


   .. py:method:: determine_if_storage_level_is_within_limits()


   .. py:method:: check_if_storage_can_supply_output_directly() -> bool
      :abstractmethod:



.. py:class:: InputStreamProvidingState(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`ProcessState`, :py:obj:`abc.ABC`

   This class represents a state in  process step. The states primary

   .. py:method:: __str__() -> str

      Return str(self).


   .. py:method:: fulfill_order() -> ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState


   .. py:method:: create_storage_entries()
      :abstractmethod:


   .. py:method:: determine_required_input_stream_state() -> ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState
      :abstractmethod:

      Creates the initial conversion of an output to an input stream

      The following steps must be conducted the function

      1. Determine end time of the input stream
          1.1. Add the stream end time to time_data class with time_data.set_next_stream_end_time()
      2. Create stream state based on the output stream state and determined end time
      3. Add stream to process step data
      4. Return determined input stream state


   .. py:method:: determine_if_stream_branch_if_fulfilled() -> bool


   .. py:method:: determine_if_production_branch_is_fulfilled() -> bool



.. py:class:: FullBatchInputStreamProvidingState(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`InputStreamProvidingState`

   This class represents a state in  process step. The states primary

   .. py:method:: create_storage_entries()


   .. py:method:: fulfill_order() -> ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState


   .. py:method:: determine_required_input_stream_state() -> ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState

      Creates the initial conversion of an output to an input stream

      The following steps must be conducted the function

      1. Determine end time of the input stream
          1.1. Add the stream end time to time_data class with time_data.set_next_stream_end_time()
      2. Create stream state based on the output stream state and determined end time
      3. Add stream to process step data
      4. Return determined input stream state


   .. py:method:: determine_if_storage_level_is_within_limits()


   .. py:method:: determine_if_stream_branch_if_fulfilled() -> bool



.. py:class:: InputAndOutputStreamProvidingState(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`InputStreamProvidingState`, :py:obj:`OutputStreamProvidingState`, :py:obj:`abc.ABC`

   This class represents a state in  process step. The states primary

   .. py:method:: create_storage_entries()
      :abstractmethod:


   .. py:method:: check_if_storage_can_supply_output_directly() -> bool
      :abstractmethod:



.. py:class:: IntermediateState(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`ProcessState`, :py:obj:`abc.ABC`

   This class represents a state in  process step. The states primary

   .. py:method:: __str__() -> str

      Return str(self).



.. py:class:: IntermediateStateBasedOnEnergy(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`IntermediateState`

   This class represents a state in  process step. The states primary

   .. py:method:: _create_process_step_production_plan_entry(process_state_state: ethos_penalps.data_classes.ProcessStateData, input_stream_state: ethos_penalps.stream.BatchStreamProductionPlanEntry | ethos_penalps.stream.ContinuousStreamProductionPlanEntry) -> ethos_penalps.data_classes.ProcessStepProductionPlanEntry



.. py:class:: ProcessStateParallelContinuousInputWithStorage(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData, maximum_stream_mass: float | None = None)


   Bases: :py:obj:`InputAndOutputStreamProvidingState`

   This class represents a state in  process step. The states primary

   .. py:method:: __str__() -> str

      Return str(self).


   .. py:method:: determine_required_input_stream_state() -> ethos_penalps.stream.BatchStreamState | ethos_penalps.stream.ContinuousStreamState

      Creates the initial conversion of an output to an input stream

      The following steps must be conducted the function

      1. Determine end time of the input stream
          1.1. Add the stream end time to time_data class with time_data.set_next_stream_end_time()
      2. Create stream state based on the output stream state and determined end time
      3. Add stream to process step data
      4. Return determined input stream state


   .. py:method:: fulfill_order() -> ethos_penalps.stream.BatchStreamState


   .. py:method:: create_storage_entries()


   .. py:method:: check_if_storage_can_supply_output_directly() -> bool



.. py:class:: ContinuousOutputStreamProvidingState(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData, maximum_stream_mass: float | None = None)


   Bases: :py:obj:`OutputStreamProvidingState`

   This class represents a state in  process step. The states primary

   .. py:method:: check_if_storage_can_supply_output_directly() -> bool



.. py:class:: OutputStreamFromStorageState(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData, maximum_stream_mass: float | None = None)


   Bases: :py:obj:`OutputStreamProvidingState`

   This class represents a state in  process step. The states primary

   .. py:method:: check_if_storage_can_supply_output_directly() -> bool



.. py:class:: BatchOutputStreamProvidingState(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData, maximum_stream_mass: float | None = None)


   Bases: :py:obj:`OutputStreamProvidingState`

   This class represents a state in  process step. The states primary

   .. py:method:: check_if_storage_can_supply_output_directly() -> bool



.. py:class:: ContinuousInputStreamRequestingStateWithStorage(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`InputStreamProvidingState`

   This class represents a state in  process step. The states primary

   .. py:method:: determine_required_input_stream_state() -> ethos_penalps.stream.ContinuousStreamState

      Creates the initial conversion of an output to an input stream

      The following steps must be conducted the function

      1. Determine end time of the input stream
          1.1. Add the stream end time to time_data class with time_data.set_next_stream_end_time()
      2. Create stream state based on the output stream state and determined end time
      3. Add stream to process step data
      4. Return determined input stream state


   .. py:method:: create_storage_entries()



.. py:class:: BatchInputStreamRequestingStateWithStorage(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`InputStreamProvidingState`

   This class represents a state in  process step. The states primary

   .. py:method:: determine_required_input_stream_state() -> ethos_penalps.stream.BatchStreamState

      Creates the initial conversion of an output to an input stream

      The following steps must be conducted the function

      1. Determine end time of the input stream
          1.1. Add the stream end time to time_data class with time_data.set_next_stream_end_time()
      2. Create stream state based on the output stream state and determined end time
      3. Add stream to process step data
      4. Return determined input stream state


   .. py:method:: create_storage_entries()



.. py:class:: BatchInputStreamRequestingStateWithStorageEnergyBasedOnStream(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`BatchInputStreamRequestingStateWithStorage`

   This class represents a state in  process step. The states primary

   .. py:method:: _create_process_step_production_plan_entry(process_state_state: ethos_penalps.data_classes.ProcessStateData, input_stream_state: ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState) -> ethos_penalps.data_classes.ProcessStepProductionPlanEntry



.. py:class:: ProcessStateIdle(process_state_name: str, process_step_name: str, process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   Bases: :py:obj:`ProcessState`

   This class represents a state in  process step. The states primary

   .. py:method:: __str__() -> str

      Return str(self).



.. py:class:: ProcessStateSwitchHandler(process_step_data: ethos_penalps.process_step_data.ProcessStepData)


   .. py:method:: add_process_state_switch(process_state_switch: ethos_penalps.process_state_switch.ProcessStateSwitch)


   .. py:method:: create_process_state_switch_at_next_discrete_event(start_process_state: ProcessState, end_process_state: ProcessState) -> ethos_penalps.process_state_switch.ProcessStateSwitchAtNextDiscreteEvent


   .. py:method:: create_process_state_switch_at_input_stream(start_process_state: ProcessState, end_process_state: ProcessState) -> ethos_penalps.process_state_switch.ProcessStateSwitchAtInputStreamProvided


   .. py:method:: create_process_state_switch_at_output_stream(start_process_state: ProcessState, end_process_state: ProcessState) -> ethos_penalps.process_state_switch.ProcessStateSwitchAtOutputStreamProvided


   .. py:method:: create_process_state_switch_delay(start_process_state: ProcessState, end_process_state: ProcessState, delay: datetime.timedelta) -> ethos_penalps.process_state_switch.ProcessStateSwitchDelay


   .. py:method:: create_process_state_switch_after_output_and_input_stream(start_process_state: ProcessState, end_process_state: ProcessState) -> ethos_penalps.process_state_switch.ProcessStateSwitchAfterInputAndOutputStream



