:py:mod:`ethos_penalps.process_state_network_navigator`
=======================================================

.. py:module:: ethos_penalps.process_state_network_navigator


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

Classes
~~~~~~~

.. autoapisummary::

   ethos_penalps.process_state_network_navigator.OutputStreamAdaptionDecider
   ethos_penalps.process_state_network_navigator.ProcessStateNetworkNavigator




Attributes
~~~~~~~~~~

.. autoapisummary::

   ethos_penalps.process_state_network_navigator.logger


.. py:data:: logger

   

.. py:class:: OutputStreamAdaptionDecider(original_stream_state: ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState)


   .. py:method:: add_adapted_state(adapted_state: ethos_penalps.stream.ContinuousStreamState | ethos_penalps.stream.BatchStreamState)



.. py:class:: ProcessStateNetworkNavigator(production_plan: ethos_penalps.production_plan.ProductionPlan, process_state_handler: ethos_penalps.process_state_handler.ProcessStateHandler)


   An input branch is created to determine the required input stream
   to provide an output stream that is requested. It also
   - determines if multiple input streams are required to provide the requested output stream state
   - handles conflicts if the input stream can not be provided from the upstream process step as requested

   .. py:method:: determine_if_output_stream_requires_adaption() -> OutputStreamAdaptionDecider

      Determines if the output stream can be provided as requested.
      Currently tests if this process step is busy and shifts the production to the first time available.
      Also tests for a maximum mass provided in a single stream. Cuts the stream to maximum mass if
      more mass is requested.

      :return: _description_
      :rtype: OutputStreamAdaptionDecider


   .. py:method:: store_current_simulation_data()


   .. py:method:: shift_output_stream_to_first_manageable_date_if_necessary() -> OutputStreamAdaptionDecider

      Checks if the output stream must be shifted because the process step is not available yet.
      If a shift is necessary the state is shifted to the earliest available date

      :raises Exception: _description_
      :return: _description_
      :rtype: _type_


   .. py:method:: determine_start_time_for_shift_to_production_state(stream_end_time: datetime.datetime) -> datetime.datetime

      Determines the time when process state shift must be initiated to shift into the process state providing state
      in time. This is necessary to shift over pre output stream providing states

      :param stream_end_time: Output stream end time
      :type stream_end_time: datetime.datetime
      :raises Exception: Stream end time must be before idle time.
      :return: Initiation date for process state shift from idle to output stream providing state
      :rtype: datetime.datetime


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


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

      Reacts to an adaption of the input stream that was requested by this branch

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


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


   .. py:method:: store_input_stream_state_to_temporary_production_plan()

      Stores the input stream state to the production plan.
      Should be called before the branch is validated


   .. py:method:: reset_temporal_branch()


   .. py:method:: provide_output_stream_from_storage()


   .. py:method:: validate_temporal_branch_without_input_stream()


   .. py:method:: validate_temporal_branch()


   .. py:method:: create_process_state_entries()



