pydcop.distribution.oneagent¶
The oneagent
distribution algorithm assigns exactly one computation to each
agent in the system.
It is the most simple distribution and, when used with many DCOP algorithms, it replicates the traditional hypothesis used in the DCOP literature where each agent is responsible for exactly one variable.
Note that this applies to algorithms using a computation-hyper graph model, like DSA, MGM, etc.
The oneagent
distribution does not define any notion of distribution cost.
Functions¶
-
distribute
(computation_graph: pydcop.computations_graph.objects.ComputationGraph, agentsdef: Iterable[pydcop.dcop.objects.AgentDef], hints: pydcop.distribution.objects.DistributionHints = None, computation_memory=None, communication_load=None, timeout=None) → pydcop.distribution.objects.Distribution¶ Simplistic distribution method: each computation is hosted on agent agent and each agent host a single computation. Agent capacity is not considered.
Raises an ImpossibleDistributionException
- Parameters
computation_graph (a ComputationGraph) – the computation graph containing the computation that must be distributed
agentsdef (iterable of AgentDef objects) – The definition of the agents the computation will be assigned to. There must be at least as many agents as computations.
hints – Not used by the
oneagent
distribution method.computation_memory – Not used by the
oneagent
distribution method.computation_memory – Not used by the
oneagent
distribution method.
- Returns
distribution – A Distribution object containing the mapping form agents to computations.
- Return type
-
distribution_cost
(distribution: pydcop.distribution.objects.Distribution, computation_graph: pydcop.computations_graph.objects.ComputationGraph, agentsdef: Iterable[pydcop.dcop.objects.AgentDef], computation_memory: Callable[pydcop.computations_graph.objects.ComputationNode, float], communication_load: Callable[[pydcop.computations_graph.objects.ComputationNode, str], float]) → float¶ As the
oneagent
distribution does not define any notion of distribution cost, this function always returns 0.- Parameters
distribution –
computation_graph –
agentsdef –
computation_memory –
communication_load –
- Returns
0
- Return type
distribution cost