def _add_initial_value(self, data_id, value, initial_dist=0.0,
                           fringe=None, check_cutoff=None, no_call=None):
        """
        Add initial values updating workflow, seen, and fringe.

        :param fringe:
            Heapq of closest available nodes.
        :type fringe: list[(float | int, bool, (str, Dispatcher)]

        :param check_cutoff:
            Check the cutoff limit.
        :type check_cutoff: (int | float) -> bool

        :param no_call:
            If True data node estimation function is not used.
        :type no_call: bool

        :param data_id:
            Data node id.
        :type data_id: str

        :param value:
            Data node value e.g., {'value': val}.
        :type value: dict[str, T]

        :param initial_dist:
            Data node initial distance in the ArciDispatch algorithm.
        :type initial_dist: float, int, optional

        :return:
            True if the data has been visited, otherwise false.
        :rtype: bool
        """

        # Namespace shortcuts for speed.
        nodes, seen, edge_weight = self.nodes, self.seen, self._edge_length
        wf_remove_edge, check_wait_in = self._wf_remove_edge, self.check_wait_in
        wf_add_edge, dsp_in = self._wf_add_edge, self._set_sub_dsp_node_input
        update_view = self._update_meeting

        if fringe is None:
            fringe = self.fringe

        if no_call is None:
            no_call = self.no_call

        check_cutoff = check_cutoff or self.check_cutoff

        if data_id not in nodes:  # Data node is not in the dmap.
            return False

        wait_in = nodes[data_id]['wait_inputs']  # Store wait inputs flag.

        index = nodes[data_id]['index']  # Store node index.

        wf_add_edge(START, data_id, **value)  # Add edge.

        if data_id in self._wildcards:  # Check if the data node has wildcard.

            self._visited.add(data_id)  # Update visited nodes.

            self.workflow.add_node(data_id)  # Add node to workflow.

            for w, edge_data in self.dmap[data_id].items():  # See func node.
                wf_add_edge(data_id, w, **value)  # Set workflow.

                node = nodes[w]  # Node attributes.

                # Evaluate distance.
                vw_dist = initial_dist + edge_weight(edge_data, node)

                update_view(w, vw_dist)  # Update view distance.

                # Check the cutoff limit and if all inputs are satisfied.
                if check_cutoff(vw_dist):
                    wf_remove_edge(data_id, w)  # Remove workflow edge.
                    continue  # Pass the node.
                elif node['type'] == 'dispatcher':
                    dsp_in(data_id, w, fringe, check_cutoff, no_call, vw_dist)
                elif check_wait_in(True, w):
                    continue  # Pass the node.

                seen[w] = vw_dist  # Update distance.

                vd = (True, w, self.index + node['index'])  # Virtual distance.

                heapq.heappush(fringe, (vw_dist, vd, (w, self)))  # Add 2 heapq.

            return True

        update_view(data_id, initial_dist)  # Update view distance.

        if check_cutoff(initial_dist):  # Check the cutoff limit.
            wf_remove_edge(START, data_id)  # Remove workflow edge.
        elif not check_wait_in(wait_in, data_id):  # Check inputs.
            seen[data_id] = initial_dist  # Update distance.

            vd = (wait_in, data_id, self.index + index)  # Virtual distance.

            # Add node to heapq.
            heapq.heappush(fringe, (initial_dist, vd, (data_id, self)))

            return True
        return False
def _add_initial_value ( self , data_id , value , initial_dist = 0.0 , fringe = None , check_cutoff = None , no_call = None ) : nodes , seen , edge_weight = self . nodes , self . seen , self . _edge_length wf_remove_edge , check_wait_in = self . _wf_remove_edge , self . check_wait_in wf_add_edge , dsp_in = self . _wf_add_edge , self . _set_sub_dsp_node_input update_view = self . _update_meeting if fringe is None : fringe = self . fringe if no_call is None : no_call = self . no_call check_cutoff = check_cutoff or self . check_cutoff if data_id not in nodes : return False wait_in = nodes [ data_id ] [ 'wait_inputs' ] index = nodes [ data_id ] [ 'index' ] wf_add_edge ( START , data_id , ** value ) if data_id in self . _wildcards : self . _visited . add ( data_id ) self . workflow . add_node ( data_id ) for w , edge_data in self . dmap [ data_id ] . items ( ) : wf_add_edge ( data_id , w , ** value ) node = nodes [ w ] vw_dist = initial_dist + edge_weight ( edge_data , node ) update_view ( w , vw_dist ) if check_cutoff ( vw_dist ) : wf_remove_edge ( data_id , w ) continue elif node [ 'type' ] == 'dispatcher' : dsp_in ( data_id , w , fringe , check_cutoff , no_call , vw_dist ) elif check_wait_in ( True , w ) : continue seen [ w ] = vw_dist vd = ( True , w , self . index + node [ 'index' ] ) heapq . heappush ( fringe , ( vw_dist , vd , ( w , self ) ) ) return True update_view ( data_id , initial_dist ) if check_cutoff ( initial_dist ) : wf_remove_edge ( START , data_id ) elif not check_wait_in ( wait_in , data_id ) : seen [ data_id ] = initial_dist vd = ( wait_in , data_id , self . index + index ) heapq . heappush ( fringe , ( initial_dist , vd , ( data_id , self ) ) ) return True return False
Add initial values updating workflow, seen, and fringe.

        :param fringe:
            Heapq of closest available nodes.
        :type fringe: list[(float | int, bool, (str, Dispatcher)]

        :param check_cutoff:
            Check the cutoff limit.
        :type check_cutoff: (int | float) -> bool

        :param no_call:
            If True data node estimation function is not used.
        :type no_call: bool

        :param data_id:
            Data node id.
        :type data_id: str

        :param value:
            Data node value e.g., {'value': val}.
        :type value: dict[str, T]

        :param initial_dist:
            Data node initial distance in the ArciDispatch algorithm.
        :type initial_dist: float, int, optional

        :return:
            True if the data has been visited, otherwise false.
        :rtype: bool