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

This class implements both the UTIL propagation phase and the VALUE propagation of the ASODPOP algorithm. More...

Inheritance diagram for frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >:

Classes

class  VariableInfo
 A convenience class that contains the following information for a variable. More...
interface  determineAssignment
 In the future we might want to experiment with different ways of determining a variables assignment. More...
class  DetermineAssignmentMax
 This class should be used when only a single hierarchy is used. More...

Public Member Functions

 ASODPOPBinaryDomains (Element parameters, DCOPProblemInterface< Val, U > problem)
 Constructor for the stats gatherer mode.
 ASODPOPBinaryDomains (DCOPProblemInterface< Val, U > problem, Element parameters) throws Exception
 A constructor that takes in the description of the problem and a set of parameters.
 ASODPOPBinaryDomains (DCOPProblemInterface< Val, U > problem) throws Exception
 A constructor that takes in the description of the problem.
 ASODPOPBinaryDomains (DCOPProblemInterface< Val, U > problem, String combinationMethodClass) throws Exception
 A constructor that takes in the description of the problem.
void reset ()
void getStatsFromQueue (Queue queue)
void setSilent (boolean silent)
Integer getMaxMsgDim ()
long getFinalTime ()
 Returns the time at which this module has finished, determined by looking at the timestamp of the stat messages.
HashMap< String, ArrayList< CurrentAssignment< Val > > > getAssignmentHistories ()
double getAverageFillTreePercentage ()
double getAverageDummyFillTreePercentage ()
double getAverageNumberOfDummies ()
int getCumulativeNumberOfSpeculativeUTILmsgs ()
int getNumberOfUTILmessages ()
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
void setQueue (Queue queue)
Map< String, Val > getCurrentSolution ()
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 UTIL_MSG = UTILpropagation.UTIL_MSG
 The type of the UTIL message.
static final MessageType UTIL_MSG_DOM = UTILpropagation.UTIL_MSG_DOM
 The type of the UTIL message with domain information.
static final MessageType UTIL_MSG_VARS = UTILpropagation.UTIL_MSG_VARS
 The type of the UTIL message with variable IDs.
static final MessageType UTIL_MSG_DOM_VARS = UTILpropagation.UTIL_MSG_DOM_VARS
 The type of the UTIL message with variable IDs and domain information.
static final MessageType ASK_MSG = UTILpropagation.ASK_MSG
 The type of the ASK message.
static final MessageType DONE_MSG = UTILpropagation.DONE_MSG
 The type of the DONE message.
static final MessageType UTIL_STATS_MSG_TYPE = new MessageType ("ASO-DPOP", "UTILstatsMessage")
 The type of messages sent to the statistics monitor.
static final MessageType CONV_STATS_MSG_TYPE = ASODPOP.CONV_STATS_MSG_TYPE
 The type of the message containing the assignment history.
static final MessageType VALUE_MSG_TYPE_CHILD = new MessageType ("ASO-DPOP", "VALUEtoChild")
 The type of a value message to a child.
static final MessageType VALUE_MSG_TYPE_PSEUDO = new MessageType ("ASO-DPOP", "VALUEtoPseudo")
 The type of a value message to a pseudo child.
static final MessageType OUTPUT_MSG_TYPE = ASODPOP.OUTPUT_MSG_TYPE
 The type of the output messages containing the optimal assignment to a variable.
static final MessageType ACK_MSG_TYPE = new MessageType ("ASO-DPOP", "Ack")
 The type of an acknowledge message.

Protected Member Functions

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

Protected Attributes

final boolean convergence
 Whether the listener should record the assignment history or not.
ArrayList< CurrentAssignment< Val > >[] assignmentHistory
 For each variable the assignment history.
HashMap< String, ArrayList< CurrentAssignment< Val > > > assignmentHistoriesMap
 For each variable its assignment history.
DCOPProblemInterface< Val, U > problem
 The agent's problem.
HashMap< String, Integer > variablePointer
 Give the variables index into the arrays.
int[] variableDomainSize
 For each variable its domain size is stored.
Val[][] domains
 For each variable owned by this agent, its domain.
boolean[] ready
 Tells one when a variable is ready to start the algorithm.
Val[] currentValues
 For each variable this agent owns, its current value is stored.
boolean started = false
 Whether the algorithm has been started.
Queue queue
 The message queue.
String agentID
 The ID of this agent.
HashMap< String, BufferedWriter > loggers
 A list of buffered writers used to log information during debugging.
determineAssignment< Val, U > combinationMethod
 The method used to combine VALUE and UTIL information into a speculative variable assignment.
Map< String, String > owners
 For each variable the agent that owns it.

Static Protected Attributes

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

Private Member Functions

void init ()
 Initialize all the variables.
void setCombinationMethod (String method) throws ClassNotFoundException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
 Set the method that defines how the available information is combined into a single variable assignment.
void startProcess (String varID)
 This method starts the optimization process, by first handling the messages that have already been received, and after that by sending ASK messages to start things up.
void processUTILMessage (VariableInfo variable, Good< Val, U > g, String sender, String[] variables, HashMap< String, Val[]> domains, boolean withVars)
 Process a good that has been received.
void processASKMessage (VariableInfo variable)
 Process an ASK message.
void processVALUEmessageParent (VariableInfo variable, HashMap< String, Val > values, boolean isConfirmed)
 Process a VALUE message.
void processVALUEmessagePseudoParent (VariableInfo variable, String sender, Val value)
 Process a VALUE message.
void processDONE (VariableInfo variable, String sender)
 Process a DONE message.
void sendGood (Good< Val, U > g, VariableInfo variable)
 Sent a good.
void sendVALUEChild (VariableInfo varInfo, Val value, HashMap< String, Val > currentContext, boolean isConfirmed, String child)
 Send a VALUE message to a child.
void sendVALUEPseudo (String variableID, Val value, String child)
 Send a VALUE message to a pseudo child.
void sendASK (String child, VariableInfo var)
 Sent an ASK message to a child.
void sendDONE (String parent, String varID)
 Send a DONE message to ones parent.

Private Attributes

boolean reportStats = true
 Whether to report stats.
VariableInfo[] infos
 A map from variableIDs to the corresponding VariableInfo container.
int variablesReadyCounter
 Counter for the number of variables that has terminated.
LinkedList< Message >[] goodsToProcess
 For each variable, a list of goods received before it was initialized.
boolean[] askToProcess
 For each variable, it records whether an ASK message has been received before initialization.
VALUEmsgChild< Val >[] lastValueMessage
 For each variable, it records the last VALUE message received before initialization.
infeasibleUtil
 The minus infinty object.
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 cumulative number of dummies.
int cumulativeNumberOfSpeculativeUTILmessages
 The cumulative number of speculative UTIL messages that have been sent during the run of this algorithm.
int cumulativeNumberOfUTILMessages
 total number of UTIl messages that have been sent
int fillPercentageCounter
 Represents to what extent the trees owned by this agent are filled.
long finalTime
 The time at which all ASODPOP modules have finished.
boolean maximize
 when true we are maximizing, when false we are minimizing
int numberOfVariables
 Number of variables owned by this agent.
int dfsReceived
 The number of DFS messages received.
int[] usedSpaceSize
 The number of spaces per variable.
boolean collectStats
 true when statistics should be collected in the tree, and false otherwise

Detailed Description

This class implements both the UTIL propagation phase and the VALUE propagation of the ASODPOP algorithm.

It assumes that information on the separator variable domains is discovered online. To mitigate the termination problems that can result from the that, every domain that is not yet full contains a dummy element

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

Constructor & Destructor Documentation

◆ ASODPOPBinaryDomains() [1/4]

◆ ASODPOPBinaryDomains() [2/4]

frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.ASODPOPBinaryDomains ( DCOPProblemInterface< Val, U > problem,
Element parameters ) throws Exception

A constructor that takes in the description of the problem and a set of parameters.

Parameters
problemThe agents problem
parametersparameters: method to use when setting the value of a variable
Exceptions
ExceptionExceptions thrown when setting the combination method

References problem, and setCombinationMethod().

Here is the call graph for this function:

◆ ASODPOPBinaryDomains() [3/4]

frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.ASODPOPBinaryDomains ( DCOPProblemInterface< Val, U > problem) throws Exception

A constructor that takes in the description of the problem.

Parameters
problemThe agents problem
Exceptions
Exceptionif an error occurs

References ASODPOPBinaryDomains(), problem, and setCombinationMethod().

Here is the call graph for this function:

◆ ASODPOPBinaryDomains() [4/4]

frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.ASODPOPBinaryDomains ( DCOPProblemInterface< Val, U > problem,
String combinationMethodClass ) throws Exception

A constructor that takes in the description of the problem.

Parameters
problemThe agents problem
combinationMethodClassThe combination method
Exceptions
Exceptionif an error occurs

References problem, and setCombinationMethod().

Here is the call graph for this function:

Member Function Documentation

◆ getAssignmentHistories()

◆ getAverageDummyFillTreePercentage()

double frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.getAverageDummyFillTreePercentage ( )
Returns
the average dummy fill percentage

References cumulativeDummyFillPercentage, and fillPercentageCounter.

◆ getAverageFillTreePercentage()

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

References cumulativeFillPercentage, and fillPercentageCounter.

◆ getAverageNumberOfDummies()

double frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.getAverageNumberOfDummies ( )
Returns
the average number of dummies

References cumulativeNumberOfDummies, and fillPercentageCounter.

◆ getCumulativeNumberOfSpeculativeUTILmsgs()

int frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.getCumulativeNumberOfSpeculativeUTILmsgs ( )
Returns
the total number of speculative UTIL messages that have been sent

References cumulativeNumberOfSpeculativeUTILmessages.

◆ getCurrentSolution()

◆ getFinalTime()

long frodo2.algorithms.asodpop.ASODPOPBinaryDomains< 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.

◆ getMaxMsgDim()

Integer frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.getMaxMsgDim ( )
Returns
the maximum number of variables in a UTIL message (in stats gatherer mode only)

◆ getMsgTypes()

◆ getNumberOfUTILmessages()

int frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.getNumberOfUTILmessages ( )
Returns
the total number of UTIL messages that have been sent

References cumulativeNumberOfUTILMessages.

◆ getStatsFromQueue()

◆ init()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.init ( )
private

Initialize all the variables.

Do note that the problem is not yet parsed at this moment in time!

References agentID, askToProcess, assignmentHistory, convergence, currentValues, domains, goodsToProcess, infos, init(), lastValueMessage, LOG, loggers, maximize, numberOfVariables, owners, problem, ready, usedSpaceSize, variableDomainSize, variablePointer, and variablesReadyCounter.

Referenced by init(), and notifyIn().

Here is the call graph for this function:

◆ log()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< 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 processASKMessage(), processUTILMessage(), processVALUEmessageParent(), processVALUEmessagePseudoParent(), sendASK(), sendDONE(), sendGood(), sendVALUEChild(), sendVALUEPseudo(), and startProcess().

◆ notifyIn()

◆ processASKMessage()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.processASKMessage ( VariableInfo variable)
private

Process an ASK message.

If the tree has no more new information, sent a DONE message. Otherwise respond with a good.

Parameters
variableThe variable information of the variable that received this ASK message

References frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.children, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.done, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getAmax(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.infeasible, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.isDone, LOG, log(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.notResponded, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.numberOfChildren, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.parent, sendASK(), sendDONE(), sendGood(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.terminated, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.toString(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.tree, and frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.variableID.

Referenced by processUTILMessage().

Here is the call graph for this function:

◆ processDONE()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.processDONE ( VariableInfo variable,
String sender )
private

Process a DONE message.

Author
Brammert Ottens, 1 nov 2009
Parameters
variablethe variable that received the DONE message
senderthe sender of the DONE message

References processDONE().

Referenced by processDONE().

Here is the call graph for this function:

◆ processUTILMessage()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.processUTILMessage ( VariableInfo variable,
Good< Val, U > g,
String sender,
String[] variables,
HashMap< String, Val[]> domains,
boolean withVars )
private

Process a good that has been received.

Parameters
variableThe variable information
gThe good received
senderThe sender of the good
variablesThe variables for which domain size information is being sent
domainsThe domains of the reported variables
withVarstrue when the util message contained variables

References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, ASODPOPBinaryDomains(), assignmentHistory, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.children, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.childrenPointer, convergence, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.currentContextMap, currentValues, domains, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.done, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getNewVariable(), frodo2.algorithms.odpop.Good< Val extends Addable< Val >, U extends Addable< U > >.getUtility(), infos, frodo2.algorithms.asodpop.Good< Val extends Addable< Val >, U extends Addable< U > >.isConfirmed(), LOG, log(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.notResponded, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.numberOfChildren, processASKMessage(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.pseudo_children, queue, reportStats, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.root, sendASK(), sendVALUEChild(), sendVALUEPseudo(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.setNewVariable(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.terminated, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.toString(), frodo2.algorithms.asodpop.Good< Val extends Addable< Val >, U extends Addable< U > >.toString(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.tree, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.variableID, variablePointer, and variablesReadyCounter.

Here is the call graph for this function:

◆ processVALUEmessageParent()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.processVALUEmessageParent ( VariableInfo variable,
HashMap< String, Val > values,
boolean isConfirmed )
private

Process a VALUE message.

Parameters
variableThe Variable information
valuesThe values reporeted in the VALUE message
isConfirmedtrue when the VALUE message is confirmed, i.e. the algorithm is terminating

References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, ASODPOPBinaryDomains(), assignmentHistory, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.children, convergence, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.currentContextMap, currentValues, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getRandomValue(), infos, LOG, log(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.numberOfChildren, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.parent, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.pseudo_children, queue, reportStats, sendVALUEChild(), sendVALUEPseudo(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.setCurrentContext(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.toString(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.tree, frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.variableID, variablePointer, and variablesReadyCounter.

Here is the call graph for this function:

◆ processVALUEmessagePseudoParent()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.processVALUEmessagePseudoParent ( VariableInfo variable,
String sender,
Val value )
private

◆ reset()

◆ sendASK()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.sendASK ( String child,
VariableInfo var )
private

◆ sendDONE()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.sendDONE ( String parent,
String varID )
private

Send a DONE message to ones parent.

Parameters
parentThe recepient of the message
varIDThe sending variable

References LOG, log(), and sendMessageToVariable().

Referenced by processASKMessage().

Here is the call graph for this function:

◆ sendGood()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.sendGood ( Good< Val, U > g,
VariableInfo variable )
private

Sent a good.

If the good has already been sent, wait until a new message can be sent.

Parameters
gThe good to be send
variableThe variable who is sending the good

References frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.acknowledged, frodo2.algorithms.asodpop.Good< Val extends Addable< Val >, U extends Addable< U > >.equals(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getNewVariable(), frodo2.communication.Message.getType(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.goodsToSend, frodo2.algorithms.asodpop.Good< Val extends Addable< Val >, U extends Addable< U > >.isConfirmed(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.lastSent, LOG, log(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.parent, queue, sendMessageToVariable(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.setNewVariable(), frodo2.algorithms.asodpop.Good< Val extends Addable< Val >, U extends Addable< U > >.toString(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.tree, and frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.variableID.

Referenced by processASKMessage().

Here is the call graph for this function:

◆ sendMessageToVariable()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.sendMessageToVariable ( String variable,
Message msg )
protected

Send a message to a variable.

Parameters
variableThe recepient of the message
msgThe message to be send

References owners, and queue.

Referenced by sendASK(), sendDONE(), sendGood(), sendVALUEChild(), and sendVALUEPseudo().

◆ sendVALUEChild()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.sendVALUEChild ( VariableInfo varInfo,
Val value,
HashMap< String, Val > currentContext,
boolean isConfirmed,
String child )
private

Send a VALUE message to a child.

Parameters
varInfoContains all information ASODPOP has collected on this variable
valueThe current value of the variable
currentContextThe current context of the variable
isConfirmedtrue when this is a confirmed VALUE message
childThe variable that is to receive this message

References frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.childrenPointer, LOG, log(), sendMessageToVariable(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.tree, and frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.variableID.

Referenced by processUTILMessage(), processVALUEmessageParent(), and processVALUEmessagePseudoParent().

Here is the call graph for this function:

◆ sendVALUEPseudo()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.sendVALUEPseudo ( String variableID,
Val value,
String child )
private

Send a VALUE message to a pseudo child.

Parameters
variableIDThe variable ID
valueThe current value of the variable
childThe variable that is to receive this message

References LOG, log(), and sendMessageToVariable().

Referenced by processUTILMessage(), processVALUEmessageParent(), and processVALUEmessagePseudoParent().

Here is the call graph for this function:

◆ setCombinationMethod()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.setCombinationMethod ( String method) throws ClassNotFoundException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
private

Set the method that defines how the available information is combined into a single variable assignment.

Parameters
methodThe method of combination
Exceptions
ClassNotFoundExceptionif the heuristic is not found
NoSuchMethodExceptionif the heuristic does not have a constructor that takes in an ASODPOPBinaryDomains
InvocationTargetExceptionif the heuristic constructor throws an exception
IllegalAccessExceptionif the heuristic constructor is not accessible
InstantiationExceptionif the heuristic is abstract
IllegalArgumentExceptionshould never happen

References setCombinationMethod().

Referenced by ASODPOPBinaryDomains(), ASODPOPBinaryDomains(), ASODPOPBinaryDomains(), and setCombinationMethod().

Here is the call graph for this function:

◆ setQueue()

◆ setSilent()

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

◆ startProcess()

void frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.startProcess ( String varID)
private

This method starts the optimization process, by first handling the messages that have already been received, and after that by sending ASK messages to start things up.

Parameters
varIDThe ID of the variable that is ready.

References frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.children, convergence, infos, LOG, log(), frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.parent, startProcess(), variablePointer, and variablesReadyCounter.

Referenced by startProcess().

Here is the call graph for this function:

Member Data Documentation

◆ ACK_MSG_TYPE

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.ACK_MSG_TYPE = new MessageType ("ASO-DPOP", "Ack")
static

The type of an acknowledge message.

Referenced by getMsgTypes().

◆ agentFinished

boolean frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.agentFinished
private

true when the agent has finished, and false otherwise

Referenced by notifyIn().

◆ agentID

String frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.agentID
protected

The ID of this agent.

Referenced by init().

◆ ASK_MSG

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.ASK_MSG = UTILpropagation.ASK_MSG
static

The type of the ASK message.

Referenced by getMsgTypes().

◆ askToProcess

boolean [] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.askToProcess
private

For each variable, it records whether an ASK message has been received before initialization.

Referenced by init(), and reset().

◆ assignmentHistoriesMap

HashMap<String, ArrayList<CurrentAssignment<Val> > > frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.assignmentHistoriesMap
protected

For each variable its assignment history.

Referenced by ASODPOPBinaryDomains(), getAssignmentHistories(), and reset().

◆ assignmentHistory

ArrayList<CurrentAssignment<Val> > [] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.assignmentHistory
protected

For each variable the assignment history.

Referenced by init(), processUTILMessage(), processVALUEmessageParent(), processVALUEmessagePseudoParent(), and reset().

◆ collectStats

boolean frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.collectStats
private

true when statistics should be collected in the tree, and false otherwise

◆ combinationMethod

determineAssignment<Val, U> frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.combinationMethod
protected

The method used to combine VALUE and UTIL information into a speculative variable assignment.

◆ CONV_STATS_MSG_TYPE

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.CONV_STATS_MSG_TYPE = ASODPOP.CONV_STATS_MSG_TYPE
static

The type of the message containing the assignment history.

Referenced by getStatsFromQueue().

◆ convergence

final boolean frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.convergence
protected

Whether the listener should record the assignment history or not.

Referenced by init(), processUTILMessage(), processVALUEmessageParent(), processVALUEmessagePseudoParent(), and startProcess().

◆ cumulativeDummyFillPercentage

double frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.cumulativeDummyFillPercentage
private

The cumulative dummy fill percentage.

Referenced by getAverageDummyFillTreePercentage().

◆ cumulativeFillPercentage

double frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.cumulativeFillPercentage
private

The percentage of the problem that has been stored.

Referenced by getAverageFillTreePercentage().

◆ cumulativeNumberOfDummies

long frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.cumulativeNumberOfDummies
private

The cumulative number of dummies.

Referenced by getAverageNumberOfDummies().

◆ cumulativeNumberOfSpeculativeUTILmessages

int frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.cumulativeNumberOfSpeculativeUTILmessages
private

The cumulative number of speculative UTIL messages that have been sent during the run of this algorithm.

Referenced by getCumulativeNumberOfSpeculativeUTILmsgs().

◆ cumulativeNumberOfUTILMessages

int frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.cumulativeNumberOfUTILMessages
private

total number of UTIl messages that have been sent

Referenced by getNumberOfUTILmessages().

◆ currentValues

Val [] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.currentValues
protected

For each variable this agent owns, its current value is stored.

Referenced by getCurrentSolution(), init(), processUTILMessage(), processVALUEmessageParent(), and processVALUEmessagePseudoParent().

◆ dfsReceived

int frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.dfsReceived
private

The number of DFS messages received.

◆ domains

Val [][] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.domains
protected

For each variable owned by this agent, its domain.

Referenced by init(), processUTILMessage(), and reset().

◆ DONE_MSG

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.DONE_MSG = UTILpropagation.DONE_MSG
static

The type of the DONE message.

Referenced by getMsgTypes().

◆ fillPercentageCounter

int frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.fillPercentageCounter
private

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

Referenced by getAverageDummyFillTreePercentage(), getAverageFillTreePercentage(), and getAverageNumberOfDummies().

◆ finalTime

long frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.finalTime
private

The time at which all ASODPOP modules have finished.

Referenced by getFinalTime().

◆ goodsToProcess

LinkedList<Message> [] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.goodsToProcess
private

For each variable, a list of goods received before it was initialized.

Referenced by init(), notifyIn(), and reset().

◆ infeasibleUtil

U frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.infeasibleUtil
private

The minus infinty object.

◆ infos

VariableInfo [] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.infos
private

A map from variableIDs to the corresponding VariableInfo container.

Referenced by init(), processUTILMessage(), processVALUEmessageParent(), processVALUEmessagePseudoParent(), reset(), and startProcess().

◆ lastValueMessage

VALUEmsgChild<Val> [] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.lastValueMessage
private

For each variable, it records the last VALUE message received before initialization.

Referenced by init(), and reset().

◆ LOG

◆ loggers

HashMap<String, BufferedWriter> frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.loggers
protected

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

Referenced by init(), log(), and reset().

◆ maximize

boolean frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.maximize
private

when true we are maximizing, when false we are minimizing

Referenced by init().

◆ numberOfVariables

int frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.numberOfVariables
private

Number of variables owned by this agent.

Referenced by init().

◆ OUTPUT_MSG_TYPE

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.OUTPUT_MSG_TYPE = ASODPOP.OUTPUT_MSG_TYPE
static

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

Referenced by getStatsFromQueue().

◆ owners

Map<String, String> frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.owners
protected

For each variable the agent that owns it.

Referenced by init(), reset(), and sendMessageToVariable().

◆ problem

DCOPProblemInterface<Val, U> frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.problem
protected

◆ queue

◆ ready

boolean [] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.ready
protected

Tells one when a variable is ready to start the algorithm.

Referenced by init(), and reset().

◆ reportStats

boolean frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.reportStats = true
private

Whether to report stats.

Referenced by processUTILMessage(), and processVALUEmessageParent().

◆ START_MSG_TYPE

MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< 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.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.started = false
protected

Whether the algorithm has been started.

◆ usedSpaceSize

int [] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.usedSpaceSize
private

The number of spaces per variable.

Referenced by init().

◆ UTIL_MSG

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.UTIL_MSG = UTILpropagation.UTIL_MSG
static

The type of the UTIL message.

Referenced by getMsgTypes(), and notifyIn().

◆ UTIL_MSG_DOM

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.UTIL_MSG_DOM = UTILpropagation.UTIL_MSG_DOM
static

The type of the UTIL message with domain information.

Referenced by getMsgTypes().

◆ UTIL_MSG_DOM_VARS

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.UTIL_MSG_DOM_VARS = UTILpropagation.UTIL_MSG_DOM_VARS
static

The type of the UTIL message with variable IDs and domain information.

Referenced by getMsgTypes().

◆ UTIL_MSG_VARS

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.UTIL_MSG_VARS = UTILpropagation.UTIL_MSG_VARS
static

◆ UTIL_STATS_MSG_TYPE

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.UTIL_STATS_MSG_TYPE = new MessageType ("ASO-DPOP", "UTILstatsMessage")
static

The type of messages sent to the statistics monitor.

◆ VALUE_MSG_TYPE_CHILD

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VALUE_MSG_TYPE_CHILD = new MessageType ("ASO-DPOP", "VALUEtoChild")
static

The type of a value message to a child.

Referenced by getMsgTypes().

◆ VALUE_MSG_TYPE_PSEUDO

final MessageType frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.VALUE_MSG_TYPE_PSEUDO = new MessageType ("ASO-DPOP", "VALUEtoPseudo")
static

The type of a value message to a pseudo child.

Referenced by getMsgTypes().

◆ variableDomainSize

int [] frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.variableDomainSize
protected

For each variable its domain size is stored.

Referenced by init(), and reset().

◆ variablePointer

HashMap<String, Integer> frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.variablePointer
protected

◆ variablesReadyCounter

int frodo2.algorithms.asodpop.ASODPOPBinaryDomains< Val extends Addable< Val >, U extends Addable< U > >.variablesReadyCounter
private

Counter for the number of variables that has terminated.

Referenced by init(), processUTILMessage(), processVALUEmessageParent(), and startProcess().


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