:py:mod:`ethos_penalps.process_node_communicator`
=================================================

.. py:module:: ethos_penalps.process_node_communicator


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

Classes
~~~~~~~

.. autoapisummary::

   ethos_penalps.process_node_communicator.ProcessNodeCommunicator
   ethos_penalps.process_node_communicator.EmptyProductionBranch




Attributes
~~~~~~~~~~

.. autoapisummary::

   ethos_penalps.process_node_communicator.logger


.. py:data:: logger

   

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


   A OutputBranch is based on an output_stream_state. The purpose of a production branch is
   to keep track at what time which kind of inputs are required to provide the output stream which is requested by this Production Branch.
   It should also check for coherence with possible previous production Branches.

   The core functionality of the branch is to call the generation of the respective input stream state.
   When the node operation comes from a downstream node the method

   .. py:method:: check_if_temporal_branches_are_fulfilled()


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


   .. py:method:: check_if_production_branch_is_fulfilled()


   .. py:method:: complete_stream_branch()


   .. py:method:: complete_temporal_branch()


   .. py:method:: complete_output_branch()


   .. py:method:: process_downstream_adaption_order(downstream_adaption_operation: ethos_penalps.node_operations.DownstreamAdaptionOrder, next_node_name: str, starting_node_name: str) -> ethos_penalps.node_operations.UpstreamAdaptionOrder

      This method is called when the upstream node requires an adaption of this node.
      The current temporal branch is reset and the process states are set to harmonize the
      input and output stream state. After successful harmonization an UpstreamAdaptionOrder is created.

      :param downstream_adaption_operation: The DownstreamAdaptionOrder contains information about
          a possible input stream state. This order is created when the input stream state requested in a
          UpstreamNewProductionOrder can not provided by the upstream order.
      :type downstream_adaption_operation: DownstreamAdaptionOrder
      :param next_node_name: Name of the upstream node. It is required to create the next UpstreamAdaptionOrder
      :type next_node_name: str
      :param starting_node_name: Name of the current node.
      :type starting_node_name: str
      :return: _description_
      :rtype: UpstreamAdaptionOrder


   .. py:method:: process_downstream_validation_operation(downstream_validation_operation: ethos_penalps.node_operations.DownstreamValidationOrder, upstream_node_name: str, downstream_node_name: str) -> ethos_penalps.node_operations.DownstreamValidationOrder | ethos_penalps.node_operations.UpstreamNewProductionOrder

      Validates that the required input for the current temporal branch can be provided

      :param downstream_validation_operation: _description_
      :type downstream_validation_operation: DownstreamValidationOrder


   .. py:method:: validate_stream_branch()


   .. py:method:: process_upstream_new_production_operation(starting_node_name: str, upstream_node_name: str, downstream_node_name: str, upstream_production_order: ethos_penalps.node_operations.UpstreamNewProductionOrder) -> ethos_penalps.node_operations.UpstreamNewProductionOrder | ethos_penalps.node_operations.DownstreamAdaptionOrder

      Determines if the current node can provide the requested output stream.
      If the required state can be provided the required input is requested by a new
      UpstreamNewProductionOrder. If the requested state can not be provided an adaption
      of the output stream is requested by the creation of a UpstreamNewProductionOrder.
      Initializes the production branch.

      :param starting_node_name: The name of the current node to which this branch belongs.
      :type starting_node_name: str
      :param upstream_node_name: _description_
      :type upstream_node_name: str
      :param downstream_node_name: _description_
      :type downstream_node_name: str
      :param upstream_production_order: _description_
      :type upstream_production_order: UpstreamNewProductionOrder
      :raises Exception: _description_
      :return: _description_
      :rtype: UpstreamNewProductionOrder | DownstreamAdaptionOrder


   .. py:method:: process_upstream_adaption_operation(starting_node_name: str, upstream_node_name: str, upstream_adaption_operation: ethos_penalps.node_operations.UpstreamAdaptionOrder) -> ethos_penalps.node_operations.UpstreamNewProductionOrder | ethos_penalps.node_operations.DownstreamValidationOrder

      Determines the required input stream to an output stream which has been adapted before.

      :param starting_node_name: _description_
      :type starting_node_name: str
      :param upstream_node_name: _description_
      :type upstream_node_name: str
      :param upstream_adaption_operation: _description_
      :type upstream_adaption_operation: UpstreamAdaptionOrder
      :return: _description_
      :rtype: UpstreamNewProductionOrder


   .. py:method:: create_downstream_adaption_order(starting_node_name: str, down_stream_node_name: str, upstream_production_order: ethos_penalps.node_operations.UpstreamNewProductionOrder) -> ethos_penalps.node_operations.DownstreamAdaptionOrder

      Creates a DownStreamAdaptionOrder based on the new output_stream_state


      :param starting_node_name: _description_
      :type starting_node_name: str
      :param down_stream_node_name: _description_
      :type down_stream_node_name: str
      :param current_temporal_branch: _description_
      :type current_temporal_branch: TemporalBranch
      :param upstream_production_order: _description_
      :type upstream_production_order: UpstreamNewProductionOrder
      :return: _description_
      :rtype: DownstreamAdaptionOrder


   .. py:method:: create_next_upstream_production_order(next_node_name: str, starting_node_name: str, input_upstream_production_order: ethos_penalps.node_operations.UpstreamNewProductionOrder) -> ethos_penalps.node_operations.UpstreamNewProductionOrder


   .. py:method:: store_branch_to_production_plan()


   .. py:method:: fulfill_stream_branch(next_node_name: str, starting_node_name: str, downstream_validation_operation: ethos_penalps.node_operations.DownstreamValidationOrder) -> ethos_penalps.node_operations.UpstreamNewProductionOrder


   .. py:method:: create_downstream_validation_order(downstream_node_name: str, starting_node_name: str, input_production_order: ethos_penalps.node_operations.UpstreamNewProductionOrder | ethos_penalps.node_operations.DownstreamValidationOrder) -> ethos_penalps.node_operations.DownstreamValidationOrder



.. py:class:: EmptyProductionBranch



