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

VALUE propagation protocol. More...

Inheritance diagram for frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >:

Classes

class  SolutionSizeMessage

Public Member Functions

 CountSolutionsVALUE (DCOPProblemInterface< Val, U > problem)
 Manual constructor that does not use XML elements.
 CountSolutionsVALUE (DCOPProblemInterface< Val, U > problem, Element parameters)
 Constructor from XML elements.
void reset ()
 CountSolutionsVALUE (Element parameters, DCOPProblemInterface< Val, U > problem)
 The constructor called in "statistics gatherer" mode.
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
 The algorithm.
void setQueue (Queue queue)
void getStatsFromQueue (Queue queue)
void setSilent (boolean silent)
HashMap< String, String[]> getReportedVariables ()
HashMap< String, ArrayList< Val[]> > getReportedValues ()
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 START_MSG_TYPE = AgentInterface.START_AGENT
 The type of the message telling the module to start.
static MessageType DFS_MSG_TYPE = DFSgeneration.OUTPUT_MSG_TYPE
 The type of the messages containing information about the DFS.
static MessageType UTIL_MSG_TYPE = CountSolutionsUTIL.OUTPUT_MSG_TYPE
 The type of the messages containing optimal conditional assignments.
static MessageType SEPARATOR_MSG_TYPE = CountSolutionsUTIL.SEPARATOR_MSG_TYPE
 The type of the messages containing information about separators.
static final MessageType VALUE_MSG_TYPE = new MessageType ("Count-DPOP", "VALUE", "VALUE")
 The type of the VALUE messages.
static final MessageType OUTPUT_MSG_TYPE = new MessageType ("Count-DPOP", "VALUE", "Output")
 The type of the output messages containing the optimal assignment to a variable.
static final MessageType SOL_SIZE_MSG_TYPE = new MessageType ("Count-DPOP", "VALUE", "Solution size")
 The type of the message containing the number of possible solutions seen from a leaf's perspective.

Protected Member Functions

void init ()
 Parses the problem.

Protected Attributes

Queue queue
 The queue on which it should call sendMessage().
boolean started = false
 Whether the execution of the algorithm has started.
HashMap< String, String[]> separators = new HashMap<String, String[]> ()
 For each variable, its separator.
HashMap< String, List< String > > allChildren = new HashMap< String, List<String> > ()
 For each variable, the list of its children.
HashMap< String, Boolean > isLeaf = new HashMap<String, Boolean> ()
 Stores, for each variable, whether it is a leaf or not s.
HashMap< String, BasicUtilitySolutionSpace< Val, U > > condAssignments
 For each variable, its optimal assignment conditioned on the assignments to its separator.
Map< String, String > owners = new HashMap<String, String> ()
 For each known variable, the name of the agent that owns it.
int remainingVars
 The number of variables owned by this agents that still have not sent VALUE messages to all their children.
int numberOfSolutions = 1
 The total number of solutions to the problem.

Private Member Functions

void sendVALUEmessage (String child, String[] variablesOut, ArrayList< Val[]> valuesOut)
 Instantiates a VALUE message and sends it.
void computeOptValAndSendVALUEmsgs (String var, BasicUtilitySolutionSpace< Val, U > optSpace, VALUEmsg< Val > valueMsg)
 Compute the optimal assignment to a variable, and sends VALUE messages to its children accordingly.

Private Attributes

DCOPProblemInterface< Val, U > problem
 The problem.
HashMap< String, VALUEmsg< Val > > valueMessages = new HashMap< String, VALUEmsg<Val> > ()
 For each variable, the VALUE message received containing its separator's optimal assignments.
HashMap< String, ArrayList< Val[]> > solution = new HashMap<String, ArrayList<Val[]>> ()
 For each variable, its optimal value.
HashMap< String, String[]> reportedVariables = new HashMap<String, String[]>()
 The variables reported to each variable.
HashMap< String, ArrayList< Val[]> > reportedValues = new HashMap<String, ArrayList<Val[]>>()
 The values reported to each variable.
HashMap< String, String[]> outVariables = new HashMap<String, String[]> ()
 The out variables calculated for each variable.
boolean reportStats = true
 Whether to report stats.

Detailed Description

VALUE propagation protocol.

Author
Thomas Leaute, Brammert Ottens
Parameters
<Val>type used for variable values
<U>type used for utility values
Todo

Improve the implementation by reasoning on groups of variables to be projected together.

This should be inheriting VALUEpropagation.

Constructor & Destructor Documentation

◆ CountSolutionsVALUE() [1/3]

Manual constructor that does not use XML elements.

Parameters
problemthe problem

References problem.

◆ CountSolutionsVALUE() [2/3]

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

Constructor from XML elements.

Parameters
problemdescription of the problem
parametersnot used because VALUEpropagation cannot be parameterized

References problem.

◆ CountSolutionsVALUE() [3/3]

frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.CountSolutionsVALUE ( 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 (currently unused)

References problem.

Member Function Documentation

◆ computeOptValAndSendVALUEmsgs()

◆ getMsgTypes()

◆ getReportedValues()

HashMap< String, ArrayList< Val[]> > frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.getReportedValues ( )

◆ getReportedVariables()

HashMap< String, String[]> frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.getReportedVariables ( )

◆ getStatsFromQueue()

void frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.getStatsFromQueue ( Queue queue)

◆ init()

void frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.init ( )
protected

Parses the problem.

References problem.

Referenced by notifyIn().

◆ notifyIn()

◆ reset()

void frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.reset ( )

◆ sendVALUEmessage()

void frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.sendVALUEmessage ( String child,
String[] variablesOut,
ArrayList< Val[]> valuesOut )
private

Instantiates a VALUE message and sends it.

Parameters
childdestination variable of the message
variablesOutthe variables
valuesOutassignments to the variables

References queue, and sendVALUEmessage().

Referenced by computeOptValAndSendVALUEmsgs(), and sendVALUEmessage().

Here is the call graph for this function:

◆ setQueue()

◆ setSilent()

Member Data Documentation

◆ allChildren

HashMap< String, List<String> > frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.allChildren = new HashMap< String, List<String> > ()
protected

For each variable, the list of its children.

Referenced by computeOptValAndSendVALUEmsgs().

◆ condAssignments

HashMap< String, BasicUtilitySolutionSpace< Val, U > > frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.condAssignments
protected
Initial value:
=
new HashMap< String, BasicUtilitySolutionSpace< Val, U > > ()

For each variable, its optimal assignment conditioned on the assignments to its separator.

Referenced by notifyIn().

◆ DFS_MSG_TYPE

The type of the messages containing information about the DFS.

Referenced by getMsgTypes().

◆ isLeaf

HashMap<String, Boolean> frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.isLeaf = new HashMap<String, Boolean> ()
protected

Stores, for each variable, whether it is a leaf or not s.

Referenced by computeOptValAndSendVALUEmsgs().

◆ numberOfSolutions

int frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.numberOfSolutions = 1
protected

The total number of solutions to the problem.

◆ OUTPUT_MSG_TYPE

final MessageType frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.OUTPUT_MSG_TYPE = new MessageType ("Count-DPOP", "VALUE", "Output")
static

The type of the output messages containing the optimal assignment to a variable.

Referenced by getStatsFromQueue().

◆ outVariables

HashMap<String, String[]> frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.outVariables = new HashMap<String, String[]> ()
private

The out variables calculated for each variable.

Referenced by computeOptValAndSendVALUEmsgs().

◆ owners

Map<String, String> frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.owners = new HashMap<String, String> ()
protected

For each known variable, the name of the agent that owns it.

◆ problem

DCOPProblemInterface<Val, U> frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.problem
private

◆ queue

Queue frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.queue
protected

The queue on which it should call sendMessage().

Referenced by getStatsFromQueue(), sendVALUEmessage(), and setQueue().

◆ remainingVars

int frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.remainingVars
protected

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

◆ reportedValues

HashMap<String, ArrayList<Val[]> > frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.reportedValues = new HashMap<String, ArrayList<Val[]>>()
private

The values reported to each variable.

Referenced by getReportedValues(), and reset().

◆ reportedVariables

HashMap<String, String[]> frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.reportedVariables = new HashMap<String, String[]>()
private

The variables reported to each variable.

Referenced by getReportedVariables(), and reset().

◆ reportStats

boolean frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.reportStats = true
private

Whether to report stats.

◆ SEPARATOR_MSG_TYPE

MessageType frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.SEPARATOR_MSG_TYPE = CountSolutionsUTIL.SEPARATOR_MSG_TYPE
static

The type of the messages containing information about separators.

Referenced by getMsgTypes().

◆ separators

HashMap<String, String[]> frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.separators = new HashMap<String, String[]> ()
protected

For each variable, its separator.

◆ SOL_SIZE_MSG_TYPE

final MessageType frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.SOL_SIZE_MSG_TYPE = new MessageType ("Count-DPOP", "VALUE", "Solution size")
static

◆ solution

HashMap<String, ArrayList<Val[]> > frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.solution = new HashMap<String, ArrayList<Val[]>> ()
private

For each variable, its optimal value.

Referenced by computeOptValAndSendVALUEmsgs().

◆ START_MSG_TYPE

MessageType frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.START_MSG_TYPE = AgentInterface.START_AGENT
static

The type of the message telling the module to start.

Referenced by getMsgTypes().

◆ started

boolean frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.started = false
protected

Whether the execution of the algorithm has started.

◆ UTIL_MSG_TYPE

The type of the messages containing optimal conditional assignments.

Referenced by getMsgTypes(), and notifyIn().

◆ VALUE_MSG_TYPE

final MessageType frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.VALUE_MSG_TYPE = new MessageType ("Count-DPOP", "VALUE", "VALUE")
static

◆ valueMessages

HashMap< String, VALUEmsg<Val> > frodo2.algorithms.dpop.count.CountSolutionsVALUE< Val extends Addable< Val >, U extends Addable< U > >.valueMessages = new HashMap< String, VALUEmsg<Val> > ()
private

For each variable, the VALUE message received containing its separator's optimal assignments.

Referenced by notifyIn().


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