FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > > Class Template Reference

Implements an adaptation of the QDisCSP approach by Yokoo (DCR'09). More...

Inheritance diagram for frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >:

Classes

class  RandVarsProjMsg
 Message telling what random variables should be projected out at given decision variable. More...

Public Member Functions

 CompleteUTIL (Element parameters, DCOPProblemInterface< Val, U > problem)
 The constructor called in "statistics gatherer" mode.
 CompleteUTIL (DCOPProblemInterface< Val, U > problem, Element parameters) throws ClassNotFoundException
 Constructor from XML descriptions.
void getStatsFromQueue (Queue queue)
getWorstUtil ()
getExpectedUtil ()
getProbOfOptimality ()
double getCentralization ()
HashMap< String, Val > getSolution ()
void notifyIn (Message msg)
Public Member Functions inherited from frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >
MessageType getStartMsgType ()
MessageType getDFSMsgType ()
 UTILpropagation ()
 Default constructor.
 UTILpropagation (DCOPProblemInterface< Val, U > problem)
 Constructor.
 UTILpropagation (DCOPProblemInterface< Val, U > problem, Element parameters)
 Constructor from XML descriptions.
void reset ()
 UTILpropagation (Element parameters, DCOPProblemInterface< Val, U > problem)
 The constructor called in "statistics gatherer" mode.
Collection< MessageTypegetMsgTypes ()
void setQueue (Queue queue)
void setSilent (boolean silent)
Integer getMaxMsgDim ()
getOptUtil ()
long getFinalTime ()
 Returns the time at which this module has finished, determined by looking at the timestamp of the stat messages.
Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T >
default void notifyIn (Message msg, Object toAgent)
 Notifies the listener of an incoming message.

Static Public Attributes

static final MessageType RAND_VARS_PROJ_MSG_TYPE = new MessageType ("E[DPOP]", "CompleteUTIL", "Where to project random variables")
 The type of the messages telling what random variables should be projected out at given decision variable.
Static Public Attributes inherited from frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >
static MessageType START_MSG_TYPE = AgentInterface.START_AGENT
 The type of the message telling the module to start.
static MessageType FINISH_MSG_TYPE = AgentInterface.AGENT_FINISHED
 The type of the message telling the agent finished.
static MessageType DFS_MSG_TYPE = DFSgeneration.OUTPUT_MSG_TYPE
 The type of the messages containing information about the DFS.
static final MessageType UTIL_MSG_TYPE = new MessageType ("DPOP", "UTILpropagation", "UTIL")
 The type of the messages containing utilities.
static final MessageType OUTPUT_MSG_TYPE = new MessageType ("DPOP", "UTILpropagation", "UTILoutput")
 The type of the messages containing conditional optimal assignments.
static final MessageType SEPARATOR_MSG_TYPE = new MessageType ("DPOP", "UTILpropagation", "Separator")
 The type of the messages containing separators.
static final MessageType OPT_UTIL_MSG_TYPE = new MessageType ("DPOP", "UTILpropagation", "OptUtil")
 The type of the messages containing optimal utility values sent by roots.
static final MessageType UTIL_STATS_MSG_TYPE = new MessageType ("DPOP", "UTILpropagation", "UTILstats")
 The type of messages sent to the statistics monitor.

Protected Member Functions

void init ()
void record (String senderVar, UtilitySolutionSpace< Val, U > space, ClusterInfo info)
void projectAndSend (ClusterInfo info)
Protected Member Functions inherited from frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >
ClusterInfo newClusterInfo ()
void sendSeparator (String senderVar, String senderAgent, String dest, String[] separator)
 Sends a message to the VALUEpropagation module containing the separator of a variable.
ProjOutput< Val, U > project (UtilitySolutionSpace< Val, U > space, String[] vars)
 Projects the input variable from the input space.
void sendToParent (String var, String parentVar, String parentAgent, UtilitySolutionSpace< Val, U > space)
 Sends a UTIL message.
void sendOutput (UtilitySolutionSpace< Val, U > space, String root)
 Sends the output optimal utility to itself (i.e.

Private Member Functions

void centralization ()
 Computes the level of centralization.
ProjOutput< Val, U > project (UtilitySolutionSpace< Val, U > space, ArrayList< String > randVars, String myVar)
 Projects out the input variables.
String dfsToString ()

Private Attributes

HashMap< String, ArrayList< String > > randVarsToProject = new HashMap< String, ArrayList<String> > ()
 What random variables each decision variable is responsible for projecting.
HashMap< String, ArrayList< String > > randVarsToIgnore = new HashMap< String, ArrayList<String> > ()
 What random variables each decision variable is linked to but not responsible for projecting.
HashMap< String, Val > solution = new HashMap<String, Val> ()
 For each variable, its optimal value.
int remainingVars
 The number of variables owned by this agents that still have not sent VALUE messages to all their children.
worstUtil
 The worst-case utility.
expectedUtil
 The expected utility.
final U zero
 A utility of 0.
final U one
 A utility of 1.
boolean measureProbOfOpt = false
 Whether to measure the probability of optimality.
probOfOptimality
 The total probability of the scenarios for which the chosen solution is optimal.
double centralization = -1.0
 The percentage of centralization imposed by the consistent DFS.
HashMap< String, DFSview< Val, U > > relationships
 For every variable this agent owns, its view of the DFS.
int nbrStatsMsgs
 The total number messages to expect in "statistics gatherer" mode.
String dotRendererClass = null
 Renderer to display DOT code.
final Method method
 The method to use.
final int nbrSamples
 The number of samples for the random variables.

Additional Inherited Members

Protected Attributes inherited from frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >
boolean withAnonymVars = false
 Whether the parser should consider variables with no specified owner.
DCOPProblemInterface< Val, U > problem
 The problem.
boolean started = false
 Whether the execution of the algorithm has been started.
boolean maximize = true
 true if we want to maximize utility, false if we want to minimize cost
Queue queue
 The queue on which it should call sendMessage().
Map< String, ClusterInfoinfos
 For each variable this agent owns, its relevant information.
String myID
 This agent's name.
optUtil
 The optimal utility found to the problem.
boolean reportStats = true
 Whether to report stats.

Detailed Description

Implements an adaptation of the QDisCSP approach by Yokoo (DCR'09).

Assigns each random variable to its lowest neighbor in the DFS, which is responsible for minimizing over it.

Author
Thomas Leaute
Parameters
<Val>type used for variable values
<U>type used for utility values

Constructor & Destructor Documentation

◆ CompleteUTIL() [1/2]

frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.CompleteUTIL ( Element parameters,
DCOPProblemInterface< Val, U > problem )

The constructor called in "statistics gatherer" mode.

Parameters
parametersthe description of what statistics should be reported
problemthe overall problem

References dotRendererClass, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.problem, relationships, and zero.

◆ CompleteUTIL() [2/2]

Member Function Documentation

◆ centralization()

◆ dfsToString()

String frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.dfsToString ( )
private
Returns
a DOT-formated representation of the DFS, including random variables

References frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.problem, randVarsToProject, and relationships.

Referenced by notifyIn().

◆ getCentralization()

double frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.getCentralization ( )
Returns
the level of centralization

References centralization.

◆ getExpectedUtil()

U frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.getExpectedUtil ( )
Returns
the expected utility

References expectedUtil.

◆ getProbOfOptimality()

U frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.getProbOfOptimality ( )
Returns
the total probability of the scenarios for which the chosen solution is optimal

References probOfOptimality.

◆ getSolution()

HashMap< String, Val > frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.getSolution ( )

◆ getStatsFromQueue()

◆ getWorstUtil()

U frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.getWorstUtil ( )
Returns
the worst-case utility

References worstUtil.

◆ init()

◆ notifyIn()

void frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.notifyIn ( Message msg)
See also
UTILpropagation.notifyIn(Message)

Reimplemented from frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.

References frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.ASSIGNMENTS_MSG_TYPE, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.blindProjectAll(), centralization, dfsToString(), dotRendererClass, frodo2.communication.MessageType.equals(), expectedUtil, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getAllPseudoChildren(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getChildren(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.MessageDFSoutput< V extends Addable< V >, U extends Addable< U > >.getNeighbors(), frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.RandVarsProjMsg.getRandVars(), frodo2.communication.Message.getType(), frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.OptUtilMessage< U extends Addable< U > >.getUtility(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.MessageDFSoutput< V extends Addable< V >, U extends Addable< U > >.getVar(), frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.RandVarsProjMsg.getVariable(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.iterator(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.maximize, measureProbOfOpt, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.multiply(), one, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.OPT_UTIL_MSG_TYPE, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.optUtil, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.problem, probOfOptimality, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.queue, RAND_VARS_PROJ_MSG_TYPE, randVarsToIgnore, randVarsToProject, relationships, remainingVars, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.reportStats, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.slice(), solution, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.sparseIter(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.STATS_MSG_TYPE, worstUtil, and zero.

Here is the call graph for this function:

◆ project()

ProjOutput< Val, U > frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.project ( UtilitySolutionSpace< Val, U > space,
ArrayList< String > randVars,
String myVar )
private

Projects out the input variables.

Parameters
spacethe space
randVarsthe random variables
myVarthe decision variable
Returns
the output of the projection

References frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.blindProject(), frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.Method.CONSENSUS, frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.Method.CONSENSUS_ALL_SOLS, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.consensusAllSolsExpect(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.consensusExpect(), frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.Method.EXPECTATION, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.expectation(), frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.Method.EXPECTATION_MONOTONE, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.maximize, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.problem, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.project(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.projExpectMonotone(), and frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.Method.ROBUST.

Referenced by projectAndSend().

Here is the call graph for this function:

◆ projectAndSend()

void frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.projectAndSend ( ClusterInfo info)
protected

◆ record()

Member Data Documentation

◆ centralization

double frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.centralization = -1.0
private

The percentage of centralization imposed by the consistent DFS.

Referenced by getCentralization(), and notifyIn().

◆ dotRendererClass

String frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.dotRendererClass = null
private

Renderer to display DOT code.

Referenced by CompleteUTIL(), and notifyIn().

◆ expectedUtil

U frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.expectedUtil
private

The expected utility.

Referenced by getExpectedUtil(), and notifyIn().

◆ measureProbOfOpt

boolean frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.measureProbOfOpt = false
private

Whether to measure the probability of optimality.

Referenced by notifyIn().

◆ method

final Method frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.method
private

The method to use.

◆ nbrSamples

final int frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.nbrSamples
private

The number of samples for the random variables.

Referenced by init().

◆ nbrStatsMsgs

int frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.nbrStatsMsgs
private

The total number messages to expect in "statistics gatherer" mode.

◆ one

final U frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.one
private

A utility of 1.

Referenced by notifyIn().

◆ probOfOptimality

U frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.probOfOptimality
private

The total probability of the scenarios for which the chosen solution is optimal.

Referenced by getProbOfOptimality(), and notifyIn().

◆ RAND_VARS_PROJ_MSG_TYPE

final MessageType frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.RAND_VARS_PROJ_MSG_TYPE = new MessageType ("E[DPOP]", "CompleteUTIL", "Where to project random variables")
static

The type of the messages telling what random variables should be projected out at given decision variable.

Referenced by getStatsFromQueue(), notifyIn(), and frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.RandVarsProjMsg.RandVarsProjMsg().

◆ randVarsToIgnore

HashMap< String, ArrayList<String> > frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.randVarsToIgnore = new HashMap< String, ArrayList<String> > ()
private

What random variables each decision variable is linked to but not responsible for projecting.

Referenced by notifyIn(), and record().

◆ randVarsToProject

HashMap< String, ArrayList<String> > frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.randVarsToProject = new HashMap< String, ArrayList<String> > ()
private

What random variables each decision variable is responsible for projecting.

Referenced by dfsToString(), notifyIn(), and projectAndSend().

◆ relationships

HashMap< String, DFSview<Val, U> > frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.relationships
private

For every variable this agent owns, its view of the DFS.

Used only in stats gatherer mode.

Referenced by CompleteUTIL(), dfsToString(), and notifyIn().

◆ remainingVars

int frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.remainingVars
private

The number of variables owned by this agents that still have not sent VALUE messages to all their children.

Referenced by notifyIn().

◆ solution

HashMap<String, Val> frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.solution = new HashMap<String, Val> ()
private

For each variable, its optimal value.

Referenced by getSolution(), and notifyIn().

◆ worstUtil

U frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.worstUtil
private

The worst-case utility.

Referenced by getWorstUtil(), and notifyIn().

◆ zero

final U frodo2.algorithms.dpop.stochastic.CompleteUTIL< Val extends Addable< Val >, U extends Addable< U > >.zero
private

A utility of 0.

Referenced by CompleteUTIL(), CompleteUTIL(), and notifyIn().


The documentation for this class was generated from the following file: