pydcop.distribution.ilp_fgdp
- distribute(computation_graph: ComputationGraph, agentsdef: Iterable[AgentDef], hints: DistributionHints | None = None, computation_memory=None, communication_load=None, timeout=None)
Generate a distribution for the dcop.
- Parameters:
computation_graph – a ComputationGraph
agentsdef – the agents definitions
hints – a DistributionHints
computation_memory – a function that takes a computation node as an argument and return the memory footprint for this
link_communication – a function that takes a Link as an argument and return the communication cost of this edge
timeout – ignored
- distribution_cost(distribution: Distribution, computation_graph: ComputationGraph, agentsdef: Iterable[AgentDef], computation_memory: Callable[[ComputationNode], float], communication_load: Callable[[ComputationNode, str], float]) float
Compute the cost for a distribution.
In this model, the cost only includes the communication costs based on message size.
- Parameters:
distribution –
computation_graph –
agentsdef –
computation_memory –
communication_load –
- factor_graph_lp_model(cg: ComputationsFactorGraph, agents: List[AgentDef], must_host: Dict[str, List], computation_memory=None, communication_load=None)
To distribute we need: * com : the communication cost of an edge between a var and a fact * mem_var : the memory footprint of a variable computation * mem_fac : the memory footprint of a factor computation
These function depends on the algorithm.
Here * mem_var and mem_fac are given by the computation_memory method. * com is given by computation_memory
- Returns: