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

O-DPOP's VALUE propagation module. More...

Inheritance diagram for frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >:

Classes

class  AssignmentMessage
 A message holding an assignment to a variable. More...

Public Member Functions

 VALUEpropagation (Element parameters, DCOPProblemInterface< Val, U > problem)
 Constructor used for stats reporter.
 VALUEpropagation (DCOPProblemInterface< Val, U > problem, Element parameters)
 Constructor used in the AgentFactory.
void getStatsFromQueue (Queue queue)
long getFinalTime ()
 Returns the time at which this module has finished, determined by looking at the timestamp of the stat messages.
double getAverageFillTreePercentage ()
double getAverageDummyFillTreePercentage ()
double getAverageNumberOfDummies ()
double getPercentageOfGoodsSent ()
getMaximalCutSum ()
void setSilent (boolean silent)
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
void reset ()
void setQueue (Queue queue)
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 final MessageType VALUE_MSG_TYPE = new MessageType ("O-DPOP", "VALUEpropagation", "VALUE")
 The type of the value message.
static final MessageType GOODS_TREE_REQUEST_MESSAGE = new MessageType ("O-DPOP", "VALUEpropagation", "Goodstree request")
 The type of the message used to request the GoodsTree from the UTIL propagation module.
static final MessageType OUTPUT_MSG_TYPE = new MessageType ("O-DPOP", "VALUEpropagation", "OutputVALUEpropagation")
 The type of the output messages containing the optimal assignment to a variable.

Protected Member Functions

void sendMessageToVariable (String receiver, Message msg)
 Sends a message to a variable.
void log (String variableID, String message)
 Log function used to print the variables state during debugging.

Protected Attributes

Val[][] domains
 For each variable owned by this agent, its domain.
HashMap< String, BufferedWriter > loggers
 A list of buffered writers used to log information during debugging.

Static Protected Attributes

static final boolean LOG = false
 To log or not to log.

Private Member Functions

void init ()
 Initializes the agent's variables.
void findOptimalAssignmentAndSend (String varID, int varIndex, GoodsTree< Val, U, LeafNode< U > > tree)
 Given the GoodsTree and the context, this method determines the value a variable should take.

Private Attributes

boolean reportStats = true
 Whether to report stats.
DCOPProblemInterface< Val, U > problem
 The agent's problem.
HashMap< String, Integer > variablePointer
 For each variable its index in the arrays.
Map< String, String > owners
 For each variable the agent that owns it.
ArrayList< List< String > > children
 Per variable a list of its children.
boolean[] root
 For each variable whether it is a root.
ArrayList< HashMap< String, Val > > contextMap
 For each variable its context.
boolean started
 true when this agent has been initialized
Queue queue
 This agent's queue.
int variablesReadyCounter
 Counts the number of variables that have not yet terminated, 0 if all variables have terminated.
boolean agentFinished
 true when the agent has finished, and false otherwise
double cumulativeFillPercentage
 The percentage of the problem that has been stored.
double cumulativeDummyFillPercentage
 The cumulative dummy fill percentage.
long cumulativeNumberOfDummies
 The total number of dummie present in the problem.
int fillPercentageCounter
 Represents to what extent the trees owned by this agent are filled.
long finalTime
 The time all modules of the type VALUE propagation have finished.
long numberOfGoodsSent
 The number of goods that has been sent.
long spaceSize
 The total size of the space.
maximalCutSum
 The sum of maximal cuts.
HashMap< String, List< VALUEmsgWithVars< Val > > > postponed = new HashMap< String, List< VALUEmsgWithVars<Val> > > ()
 For each variable, a list of VALUE messages that are waiting to be processed until the DFS output has been received.

Detailed Description

O-DPOP's VALUE propagation module.

Author
brammert
Parameters
<Val>The type used for domain values
<U>The type used for utility values

Constructor & Destructor Documentation

◆ VALUEpropagation() [1/2]

frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.VALUEpropagation ( Element parameters,
DCOPProblemInterface< Val, U > problem )

Constructor used for stats reporter.

Parameters
problemthe overall problem
parametersthe description of what statistics should be reported (currently unused)

References problem.

Referenced by findOptimalAssignmentAndSend().

◆ VALUEpropagation() [2/2]

frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.VALUEpropagation ( DCOPProblemInterface< Val, U > problem,
Element parameters )

Constructor used in the AgentFactory.

Parameters
problemThe problem definition
parametersParameters to the listener

References problem.

Member Function Documentation

◆ findOptimalAssignmentAndSend()

void frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.findOptimalAssignmentAndSend ( String varID,
int varIndex,
GoodsTree< Val, U, LeafNode< U > > tree )
private

Given the GoodsTree and the context, this method determines the value a variable should take.

Parameters
varIDThe variable ID
varIndexThe index of the variable
treeThe GoodsTree containing all relevant information to determine the value of the variable

References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, children, contextMap, domains, LOG, log(), problem, queue, reportStats, sendMessageToVariable(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, VALUEpropagation(), and variablesReadyCounter.

Here is the call graph for this function:

◆ getAverageDummyFillTreePercentage()

double frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.getAverageDummyFillTreePercentage ( )
Author
Brammert Ottens, 25 feb 2010
Returns
the average dummy fill percentage

◆ getAverageFillTreePercentage()

double frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.getAverageFillTreePercentage ( )
Author
Brammert Ottens, 7 jan 2010
Returns
the average of all reported treeFillPercentages

◆ getAverageNumberOfDummies()

double frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.getAverageNumberOfDummies ( )
Author
Brammert Ottens, 25 feb 2010
Returns
the average number of dummies

◆ getFinalTime()

long frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.getFinalTime ( )

Returns the time at which this module has finished, determined by looking at the timestamp of the stat messages.

Author
Brammert Ottens, 22 feb 2010
Returns
the time at which this module has finished

References finalTime.

◆ getMaximalCutSum()

U frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.getMaximalCutSum ( )
Author
Brammert Ottens, 7 feb. 2011
Returns
the maximal value with which a utility value has been cut

◆ getMsgTypes()

◆ getPercentageOfGoodsSent()

double frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.getPercentageOfGoodsSent ( )
Author
Brammert Ottens, 7 feb. 2011
Returns
the percentage of possible goods that have been sent

◆ getStatsFromQueue()

◆ init()

void frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.init ( )
private

Initializes the agent's variables.

References children, contextMap, domains, init(), loggers, owners, problem, root, variablePointer, and variablesReadyCounter.

Referenced by init(), and notifyIn().

Here is the call graph for this function:

◆ log()

void frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.log ( String variableID,
String message )
protected

Log function used to print the variables state during debugging.

Parameters
variableIDThe ID of the variable that is logging
messageThe message that must be logged

References LOG, and loggers.

Referenced by findOptimalAssignmentAndSend().

◆ notifyIn()

◆ reset()

void frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.reset ( )

◆ sendMessageToVariable()

void frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.sendMessageToVariable ( String receiver,
Message msg )
protected

Sends a message to a variable.

Parameters
receiverThe recipient of the message
msgThe message to be sent

References owners, and queue.

Referenced by findOptimalAssignmentAndSend().

◆ setQueue()

◆ setSilent()

void frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.setSilent ( boolean silent)

Member Data Documentation

◆ agentFinished

boolean frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.agentFinished
private

true when the agent has finished, and false otherwise

◆ children

ArrayList<List<String> > frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.children
private

Per variable a list of its children.

Referenced by findOptimalAssignmentAndSend(), and init().

◆ contextMap

ArrayList<HashMap<String, Val> > frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.contextMap
private

For each variable its context.

Referenced by findOptimalAssignmentAndSend(), and init().

◆ cumulativeDummyFillPercentage

double frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.cumulativeDummyFillPercentage
private

The cumulative dummy fill percentage.

◆ cumulativeFillPercentage

double frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.cumulativeFillPercentage
private

The percentage of the problem that has been stored.

◆ cumulativeNumberOfDummies

long frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.cumulativeNumberOfDummies
private

The total number of dummie present in the problem.

◆ domains

Val [][] frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.domains
protected

For each variable owned by this agent, its domain.

Referenced by findOptimalAssignmentAndSend(), and init().

◆ fillPercentageCounter

int frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.fillPercentageCounter
private

Represents to what extent the trees owned by this agent are filled.

◆ finalTime

long frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.finalTime
private

The time all modules of the type VALUE propagation have finished.

Referenced by getFinalTime().

◆ GOODS_TREE_REQUEST_MESSAGE

final MessageType frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.GOODS_TREE_REQUEST_MESSAGE = new MessageType ("O-DPOP", "VALUEpropagation", "Goodstree request")
static

◆ LOG

final boolean frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.LOG = false
staticprotected

To log or not to log.

Referenced by findOptimalAssignmentAndSend(), and log().

◆ loggers

HashMap<String, BufferedWriter> frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.loggers
protected

A list of buffered writers used to log information during debugging.

Referenced by init(), and log().

◆ maximalCutSum

U frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.maximalCutSum
private

The sum of maximal cuts.

◆ numberOfGoodsSent

long frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.numberOfGoodsSent
private

The number of goods that has been sent.

◆ OUTPUT_MSG_TYPE

◆ owners

Map<String, String> frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.owners
private

For each variable the agent that owns it.

Referenced by init(), and sendMessageToVariable().

◆ postponed

HashMap< String, List< VALUEmsgWithVars<Val> > > frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.postponed = new HashMap< String, List< VALUEmsgWithVars<Val> > > ()
private

For each variable, a list of VALUE messages that are waiting to be processed until the DFS output has been received.

◆ problem

DCOPProblemInterface<Val, U> frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.problem
private

The agent's problem.

Referenced by findOptimalAssignmentAndSend(), init(), VALUEpropagation(), and VALUEpropagation().

◆ queue

Queue frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.queue
private

◆ reportStats

boolean frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.reportStats = true
private

Whether to report stats.

Referenced by findOptimalAssignmentAndSend().

◆ root

boolean [] frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.root
private

For each variable whether it is a root.

Referenced by init().

◆ spaceSize

long frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.spaceSize
private

The total size of the space.

◆ START_MSG_TYPE

MessageType frodo2.algorithms.odpop.VALUEpropagation< 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.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.started
private

true when this agent has been initialized

Referenced by notifyIn().

◆ VALUE_MSG_TYPE

◆ variablePointer

HashMap<String, Integer> frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.variablePointer
private

For each variable its index in the arrays.

Referenced by init().

◆ variablesReadyCounter

int frodo2.algorithms.odpop.VALUEpropagation< Val extends Addable< Val >, U extends Addable< U > >.variablesReadyCounter
private

Counts the number of variables that have not yet terminated, 0 if all variables have terminated.

Referenced by findOptimalAssignmentAndSend(), and init().


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