8.2.4.4.25. add_data

BlueDispatcher.add_data(data_id=None, default_value=empty, initial_dist=0.0, wait_inputs=False, wildcard=None, function=None, callback=None, description=None, filters=None, await_result=None, **kwargs)[source]

Add a single data node to the dispatcher.

Parameters:
  • data_id (str, optional) – Data node id. If None will be assigned automatically (‘unknown<%d>’) not in dmap.

  • default_value (T, optional) – Data node default value. This will be used as input if it is not specified as inputs in the ArciDispatch algorithm.

  • initial_dist (float, int, optional) – Initial distance in the ArciDispatch algorithm when the data node default value is used.

  • wait_inputs (bool, optional) – If True ArciDispatch algorithm stops on the node until it gets all input estimations.

  • wildcard (bool, int, optional) – If True, when the data node is used as input and target in the ArciDispatch algorithm, the input value will be used as input for the connected functions, but not as output. If it is equal to 2, the the data node that cannot be calculated are excluded by the wildcard condition.

  • function (callable, optional) – Data node estimation function. This can be any function that takes only one dictionary (key=function node id, value=estimation of data node) as input and return one value that is the estimation of the data node.

  • callback (callable, optional) – Callback function to be called after node estimation. This can be any function that takes only one argument that is the data node estimation output. It does not return anything.

  • description (str, optional) – Data node’s description.

  • filters (list[function], optional) – A list of functions that are invoked after the invocation of the main function.

  • await_result (bool|int|float, optional) – If True the Dispatcher waits data results before assigning them to the solution. If a number is defined this is used as timeout for Future.result method [default: False]. Note this is used when asynchronous or parallel execution is enable.

  • kwargs (keyword arguments, optional) – Set additional node attributes using key=value.

Returns:

Self.

Return type:

BlueDispatcher