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

E[DPOP]'s UTIL propagation phase. More...

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

Classes

enum  Method
 The method to use to choose the optimal value for a variable. More...

Public Member Functions

 ExpectedUTIL (DCOPProblemInterface< Val, U > problem, Element parameters)
 Constructor.
 ExpectedUTIL (Element parameters, DCOPProblemInterface< Val, U > problem)
 The constructor called in "statistics gatherer" mode.
void reset ()
Collection< MessageTypegetMsgTypes ()
void getStatsFromQueue (Queue queue)
getWorstUtil ()
getExpectedUtil ()
getProbOfOptimality ()
void notifyIn (Message msg)
HashMap< String, Val > getSolution ()
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.
 UTILpropagation (Element parameters, DCOPProblemInterface< Val, U > problem)
 The constructor called in "statistics gatherer" mode.
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 MessageType RAND_VARS_PROJ_MSG_TYPE = SamplingPhase.RAND_VARS_PROJ_MSG_TYPE
 The type of the messages containing information about the where random variables should be projected out.
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 parseMethod (Element parameters)
 Parses the method to use.
ProjOutput< Val, U > project (UtilitySolutionSpace< Val, U > space, String[] vars)
void sendToParent (String var, String parentVar, String parentAgent, UtilitySolutionSpace< Val, U > space)
 Before sending the UTIL message, projects out the relevant random variables.
void sendOutput (UtilitySolutionSpace< Val, U > space, String root)
void sendSeparator (String sender, String senderAgent, String dest, String[] separator)
Protected Member Functions inherited from frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >
void init ()
 Parses the problem.
ClusterInfo newClusterInfo ()
void record (String senderVar, UtilitySolutionSpace< Val, U > space, ClusterInfo info)
 Records the input space until spaces from all children have been received.
void projectAndSend (ClusterInfo info)
 Projects out a variable and sends the result to its parent (if any) or to itself (to initiate VALUE propagation).

Protected Attributes

HashMap< String, HashSet< String > > randVarsProj = new HashMap< String, HashSet<String> > ()
 For each variable, the random variables that should be projected out of its UTIL message.
Method method = Method.EXPECTATION
 The method to use.
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.

Private Member Functions

void sliceSpaces (ClusterInfo varInfo)
 Slices the spaces stored for the input variable according to the sampled domains.

Private Attributes

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.
zero
 The utility 0.
one
 The utility 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.

Detailed Description

E[DPOP]'s UTIL propagation phase.

The difference with the normal UTILpropagation phase is that it "projects out" the random variables by computing the expectation over these variables.

Author
Thomas Leaute
Parameters
<Val>the type used for variable values
<U>the type used for utility values
Warning
This implementation currently assumes all variables owned by any given agent belong to the same component of the overall constraint graph, and might not work properly if this assumption is violated.

Constructor & Destructor Documentation

◆ ExpectedUTIL() [1/2]

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

Constructor.

Parameters
problemthe agent's subproblem
parametersthe parameters for the module

References parseMethod(), frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.problem, and frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.withAnonymVars.

Here is the call graph for this function:

◆ ExpectedUTIL() [2/2]

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

The constructor called in "statistics gatherer" mode.

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

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

Member Function Documentation

◆ getExpectedUtil()

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

◆ getMsgTypes()

◆ getProbOfOptimality()

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

◆ getSolution()

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

◆ getStatsFromQueue()

◆ getWorstUtil()

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

References worstUtil.

◆ notifyIn()

void frodo2.algorithms.dpop.stochastic.ExpectedUTIL< 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(), frodo2.communication.MessageType.equals(), frodo2.algorithms.dpop.UTILmsg< Val extends Addable< Val >, U extends Addable< U > >.getDestination(), frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, 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.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.RandVarsProjMsg.getVariable(), frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.infos, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.init(), 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, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.multiply(), frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.ClusterInfo.nbrChildren, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.ClusterInfo.nbrUTIL, 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.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.problem, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.projectAndSend(), RAND_VARS_PROJ_MSG_TYPE, 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(), sliceSpaces(), solution, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.sparseIter(), frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.started, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.UTIL_MSG_TYPE, and frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.ClusterInfo.vars.

Here is the call graph for this function:

◆ parseMethod()

◆ project()

ProjOutput< Val, U > frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.project ( UtilitySolutionSpace< Val, U > space,
String[] vars )
protected
See also
UTILpropagation.project(UtilitySolutionSpace, java.lang.String[])
Todo
Add support for clusters
Todo
Add support for Method.ROBUST
Todo
call argProjExpectMonotone() instead
Todo
call argProject() instead

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

Reimplemented in frodo2.algorithms.dpop.stochastic.robust.WorstCaseUTIL< Val extends Addable< Val >, U extends Addable< U > >.

References frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.ProjOutput< V extends Addable< V >, U extends Addable< U > >.assignments, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.compose(), frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.Method.CONSENSUS, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.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 > >.consensusAllSols(), 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(), and frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.projExpectMonotone().

Here is the call graph for this function:

◆ reset()

◆ sendOutput()

◆ sendSeparator()

void frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.sendSeparator ( String sender,
String senderAgent,
String dest,
String[] separator )
protected

◆ sendToParent()

void frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.sendToParent ( String var,
String parentVar,
String parentAgent,
UtilitySolutionSpace< Val, U > space )
protected

◆ sliceSpaces()

void frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.sliceSpaces ( ClusterInfo varInfo)
private

Member Data Documentation

◆ expectedUtil

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

The expected utility.

◆ measureProbOfOpt

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

Whether to measure the probability of optimality.

◆ method

Method frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.method = Method.EXPECTATION
protected

The method to use.

◆ one

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

The utility 1.

◆ probOfOptimality

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

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

◆ RAND_VARS_PROJ_MSG_TYPE

MessageType frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.RAND_VARS_PROJ_MSG_TYPE = SamplingPhase.RAND_VARS_PROJ_MSG_TYPE
static

The type of the messages containing information about the where random variables should be projected out.

Referenced by getMsgTypes(), and notifyIn().

◆ randVarsProj

HashMap< String, HashSet<String> > frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.randVarsProj = new HashMap< String, HashSet<String> > ()
protected

◆ remainingVars

int frodo2.algorithms.dpop.stochastic.ExpectedUTIL< 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.

◆ solution

HashMap<String, Val> frodo2.algorithms.dpop.stochastic.ExpectedUTIL< 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.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.worstUtil
private

The worst-case utility.

Referenced by getWorstUtil().

◆ zero

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

The utility 0.


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