:py:mod:`ethos_penalps.process_chain`
=====================================

.. py:module:: ethos_penalps.process_chain


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

Classes
~~~~~~~

.. autoapisummary::

   ethos_penalps.process_chain.ProcessChain
   ethos_penalps.process_chain.ProcessChainFactor




Attributes
~~~~~~~~~~

.. autoapisummary::

   ethos_penalps.process_chain.logger


.. py:data:: logger

   

.. py:class:: ProcessChain(process_chain_identifier: ethos_penalps.data_classes.ProcessChainIdentifier, production_plan: ethos_penalps.production_plan.ProductionPlan, load_profile_handler: ethos_penalps.load_profile_calculator.LoadProfileHandler, time_data: ethos_penalps.time_data.TimeData = TimeData(), location: str = '')


   The Process Chain is a collector class for sequentially depending process steps.
   When an enterprise is fully defined the simulation can be started with create_production_plan.
   Also contains methods for report generation of the enterprise definition and report generation

   .. py:method:: get_process_node_dict_without_sink_and_source() -> dict[str, ethos_penalps.process_nodes.process_node.ProcessNode]


   .. py:method:: create_failed_report()


   .. py:method:: pickle_dump_production_plan(file_name: str = 'production_plan', subdirectory_name: str = 'production_plan', add_time_stamp_to_filename: bool = True)


   .. py:method:: pickle_load_production_plan(path_to_pickle_file: str)


   .. py:method:: initialize_production_plan()

      Collects steps that are necessary to conduct before each simulation.
      Creates empty entries for each process node and stream in the production plan.
      Collects the energy data from streams


   .. py:method:: collect_stream_energy_data()

      Collects the energy data from streams into the load profile handler.
      This allows calculation of the energy data from a central object


   .. py:method:: collect_process_state_energy_data()


   .. py:method:: add_process_node(process_node_to_add: ethos_penalps.process_nodes.process_step.ProcessStep | ethos_penalps.process_nodes.source.Source | ethos_penalps.process_nodes.sink.Sink | ethos_penalps.process_nodes.process_chain_storage.ProcessChainStorage)

      Adds a process node object to the process_node_dict of EnterpriseStructure to
      consider the node during the simulation

      :param process_node_to_add: A ProcessStep, Source or Sink object which inherited from process node
      :type process_node_to_add: ProcessStep | Source | Sink
      :raises Exception: _description_


   .. py:method:: get_process_node(process_node_name: str) -> ethos_penalps.process_nodes.process_node.ProcessNode

      Returns a process node object based on its name

      :param process_node_name: Name of the process node.
      :type process_node_name: str
      :return: _description_
      :rtype: ProcessNode


   .. py:method:: create_process_step(name: str) -> ethos_penalps.process_nodes.process_step.ProcessStep

      Creates a process step.

      :param name: _description_
      :type name: str
      :return: _description_
      :rtype: ProcessStep


   .. py:method:: get_sink() -> ethos_penalps.process_nodes.sink.Sink | ethos_penalps.process_nodes.process_chain_storage.ProcessChainStorage

      Returns a Sink

      :raises Exception: _description_
      :return: _description_
      :rtype: Sink


   .. py:method:: create_process_chain_production_plan(max_number_of_iterations: float | None = None)

      Creates a production plan to produce all orders in the Sink object. Each process step between the Source
      and Sink object is considered. Process step can create a node operation for the upstream or downstream node.
      These operations are used creates a network of so called production and temporal branches. These are used
      to ensure that all process steps work in temporal and logically coherent way to fulfill an  order in the Sink.
      When a valid production plan entry is created the related energy consumption for the time period is created
      and stored in the LoadProfileHandler.


   .. py:method:: get_node_from_node_operation(node_operation: ethos_penalps.node_operations.NodeOperation) -> ethos_penalps.process_nodes.process_node.ProcessNode | None

      Returns a target ProcessNode object of a NodeOperation Object.

      :param node_operation: _description_
      :type node_operation: NodeOperation
      :raises Exception: _description_
      :return: _description_
      :rtype: ProcessNode | None


   .. py:method:: add_sink(sink: ethos_penalps.process_nodes.sink.Sink | ethos_penalps.process_nodes.process_chain_storage.ProcessChainStorage)


   .. py:method:: add_source(source: ethos_penalps.process_nodes.source.Source | ethos_penalps.process_nodes.process_chain_storage.ProcessChainStorage)


   .. py:method:: get_main_sink() -> ethos_penalps.process_nodes.sink.Sink


   .. py:method:: get_list_of_process_step_names(include_sink: bool = False, include_source: bool = False) -> list[str]

      Returns a list of the names of the main object node chain.

      :return: _description_
      :rtype: list[str]



.. py:class:: ProcessChainFactor(process_chain_identifier: ethos_penalps.data_classes.ProcessChainIdentifier, production_plan: ethos_penalps.production_plan.ProductionPlan, load_profile_handler: ethos_penalps.load_profile_calculator.LoadProfileHandler, time_data: ethos_penalps.time_data.TimeData = TimeData(), location: str = '')


   Bases: :py:obj:`ProcessChain`

   The Process Chain is a collector class for sequentially depending process steps.
   When an enterprise is fully defined the simulation can be started with create_production_plan.
   Also contains methods for report generation of the enterprise definition and report generation

   .. py:method:: create_replicas()



