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

An optimal solution to the problem. More...

Inheritance diagram for frodo2.algorithms.Solution< V, U >:

Public Member Functions

 Solution (U reportedUtil, U trueUtil, Map< String, V > assignments, int nbrMsgs, long totalMsgSize, long maxMsgSize, long ncccCount, long timeNeeded, HashMap< String, Long > moduleEndTimes)
 Constructor.
 Solution (int nbrVariables, U reportedUtil, U trueUtil, Map< String, V > assignments, int nbrMsgs, long totalMsgSize, long maxMsgSize, long ncccCount, long timeNeeded, HashMap< String, Long > moduleEndTimes, int numberOfCoordinationConstraints)
 Constructor.
 Solution (int nbrVariables, U reportedUtil, U trueUtil, Map< String, V > assignments, int nbrMsgs, long totalMsgSize, long maxMsgSize, long ncccCount, long timeNeeded, HashMap< String, Long > moduleEndTimes, int numberOfCoordinationConstraints, int treeWidth)
 Constructor.
 Solution (U reportedUtil, U trueUtil, Map< String, V > assignments, int nbrMsgs, TreeMap< MessageType, Integer > msgNbrs, TreeMap< Object, Integer > msgsNbrsSentPerAgent, TreeMap< Object, Integer > msgsNbrsReceivedPerAgent, long totalMsgSize, TreeMap< MessageType, Long > msgSizes, TreeMap< Object, Long > msgSizesSentPerAgent, TreeMap< Object, Long > msgSizesReveivedPerAgent, long maxMsgSize, TreeMap< MessageType, Long > maxMsgSizes, long ncccCount, long timeNeeded, HashMap< String, Long > moduleEndTimes)
 Constructor.
 Solution (int nbrVariables, U reportedUtil, U trueUtil, Map< String, V > assignments, int nbrMsgs, TreeMap< MessageType, Integer > msgNbrs, TreeMap< Object, Integer > msgsNbrsSentPerAgent, TreeMap< Object, Integer > msgsNbrsReceivedPerAgent, long totalMsgSize, TreeMap< MessageType, Long > msgSizes, TreeMap< Object, Long > msgSizesSentPerAgent, TreeMap< Object, Long > msgSizesReveivedPerAgent, long maxMsgSize, TreeMap< MessageType, Long > maxMsgSizes, long ncccCount, long timeNeeded, HashMap< String, Long > moduleEndTimes, int numberOfCoordinationConstraints)
 Constructor.
 Solution (int nbrVariables, U reportedUtil, U trueUtil, Map< String, V > assignments, int nbrMsgs, TreeMap< MessageType, Integer > msgNbrs, TreeMap< Object, Integer > msgsNbrsSentPerAgent, TreeMap< Object, Integer > msgsNbrsReceivedPerAgent, long totalMsgSize, TreeMap< MessageType, Long > msgSizes, TreeMap< Object, Long > msgSizesSentPerAgent, TreeMap< Object, Long > msgSizesReveivedPerAgent, long maxMsgSize, TreeMap< MessageType, Long > maxMsgSizes, long ncccCount, long timeNeeded, HashMap< String, Long > moduleEndTimes, int treeWidth, int numberOfCoordinationConstraints)
 Constructor.
 Solution (int nbrVariables, U reportedUtil, U trueUtil, Map< String, V > assignments, int nbrMsgs, TreeMap< MessageType, Integer > msgNbrs, TreeMap< Object, Integer > msgsNbrsSentPerAgent, TreeMap< Object, Integer > msgsNbrsReceivedPerAgent, long totalMsgSize, TreeMap< MessageType, Long > msgSizes, TreeMap< Object, Long > msgSizesSentPerAgent, TreeMap< Object, Long > msgSizesReveivedPerAgent, long maxMsgSize, TreeMap< MessageType, Long > maxMsgSizes, long ncccCount, long timeNeeded, long cumulativelTime, HashMap< String, Long > moduleEndTimes, int treeWidth, int numberOfCoordinationConstraints)
 Constructor.
getReportedUtil ()
getUtility ()
void setUtility (U util)
 Sets the utility.
Map< String, V > getAssignments ()
long getNcccCount ()
int getNbrMsgs ()
void setNbrMsgs (int nbrMsgsNew)
 Sets the total number of messages.
long getTotalMsgSize ()
long getMaxMsgSize ()
void setTotalMsgSize (long totalMsgSizeNew)
 Sets the total amount of information exchanged.
long getTimeNeeded ()
long getTotalTime ()
void setTimeNeeded (long timeNeededNew)
 Sets the total runtime.
HashMap< String, Long > getTimesNeeded ()
TreeMap< MessageType, Long > getMsgSizes ()
TreeMap< MessageType, Long > getMaxMsgSizes ()
TreeMap< MessageType, Integer > getMsgNbrs ()
int getTreeWidth ()
int getNumberOfCoordinationConstraints ()
int getNbrVariables ()
String toString ()
String toLineString ()

Protected Attributes

reportedUtil
 The reported utility of the solution.
trueUtil
 The true utility of the solution.
Map< String, V > assignments
 For each variable, its assignment in the solution found to the problem.
long ncccCount
 The number of ncccs used.
long timeNeeded
 The time needed to solve the problem.
long cumulativeTime
 The cumulative time needed for all agents to find a solution.
HashMap< String, Long > moduleEndTimes
 For each module in the algorithm, the time at which it finished.
int nbrMsgs
 The number of messages sent by the algorithm.
long totalMsgSize
 The total amount of information sent by the algorithm (in bytes).
long maxMsgSize
 The size (in bytes) of the largest message.
TreeMap< MessageType, Integer > msgNbrs
 The total number of messages that has been sent per message type.
TreeMap< MessageType, Long > msgSizes
 The total amount of information that has been sent per message type.
TreeMap< MessageType, Long > maxMsgSizes
 For each message type, the size (in bytes) of the largest message of that type.
int treeWidth = -1
 The tree width of the tree on which the algorithm has run.

Private Attributes

int numberOfVariables
 The number of variables that occur in the problem.
int numberOfCoordinationConstraints
 The number of constraints whose variables are owned by different agents.

Detailed Description

An optimal solution to the problem.

Parameters
<V>type used for variable values
<U>type used for utility values
Todo
Make all attributes public; get rid of cumbersome constructors, setters and getters

Constructor & Destructor Documentation

◆ Solution() [1/7]

frodo2.algorithms.Solution< V, U >.Solution ( U reportedUtil,
U trueUtil,
Map< String, V > assignments,
int nbrMsgs,
long totalMsgSize,
long maxMsgSize,
long ncccCount,
long timeNeeded,
HashMap< String, Long > moduleEndTimes )

Constructor.

Parameters
reportedUtilthe reported optimal utility
trueUtilthe true optimal utility
assignmentsthe optimal assignments
nbrMsgsThe total number of messages sent
totalMsgSizeThe total message size
maxMsgSizethe size (in bytes) of the largest message
ncccCountthe ncccs used
timeNeededthe time needed to solve the problem
moduleEndTimeseach module's end time

References assignments, maxMsgSize, moduleEndTimes, nbrMsgs, ncccCount, reportedUtil, timeNeeded, totalMsgSize, and trueUtil.

◆ Solution() [2/7]

frodo2.algorithms.Solution< V, U >.Solution ( int nbrVariables,
U reportedUtil,
U trueUtil,
Map< String, V > assignments,
int nbrMsgs,
long totalMsgSize,
long maxMsgSize,
long ncccCount,
long timeNeeded,
HashMap< String, Long > moduleEndTimes,
int numberOfCoordinationConstraints )

Constructor.

Parameters
nbrVariablesthe total number of variables in the problem
reportedUtilthe reported optimal utility
trueUtilthe true optimal utility
assignmentsthe optimal assignments
nbrMsgsThe total number of messages sent
totalMsgSizeThe total message size
maxMsgSizethe size (in bytes) of the largest message
ncccCountthe ncccs used
timeNeededthe time needed to solve the problem
moduleEndTimeseach module's end time
numberOfCoordinationConstraintsthe number of constraints that contain variables that are owned by different agents

References assignments, maxMsgSize, moduleEndTimes, nbrMsgs, ncccCount, numberOfCoordinationConstraints, reportedUtil, timeNeeded, totalMsgSize, and trueUtil.

◆ Solution() [3/7]

frodo2.algorithms.Solution< V, U >.Solution ( int nbrVariables,
U reportedUtil,
U trueUtil,
Map< String, V > assignments,
int nbrMsgs,
long totalMsgSize,
long maxMsgSize,
long ncccCount,
long timeNeeded,
HashMap< String, Long > moduleEndTimes,
int numberOfCoordinationConstraints,
int treeWidth )

Constructor.

Parameters
nbrVariablesthe total number of variables in the problem
reportedUtilthe reported optimal utility
trueUtilthe true optimal utility
assignmentsthe optimal assignments
nbrMsgsThe total number of messages sent
totalMsgSizeThe total message size
maxMsgSizethe size (in bytes) of the largest message
ncccCountthe ncccs used
timeNeededthe time needed to solve the problem
moduleEndTimeseach module's end time
numberOfCoordinationConstraintsthe number of constraints that contain variables that are owned by different agents
treeWidththe width of the tree on which the algorithm has run

References assignments, maxMsgSize, moduleEndTimes, nbrMsgs, ncccCount, numberOfCoordinationConstraints, reportedUtil, timeNeeded, totalMsgSize, treeWidth, and trueUtil.

◆ Solution() [4/7]

frodo2.algorithms.Solution< V, U >.Solution ( U reportedUtil,
U trueUtil,
Map< String, V > assignments,
int nbrMsgs,
TreeMap< MessageType, Integer > msgNbrs,
TreeMap< Object, Integer > msgsNbrsSentPerAgent,
TreeMap< Object, Integer > msgsNbrsReceivedPerAgent,
long totalMsgSize,
TreeMap< MessageType, Long > msgSizes,
TreeMap< Object, Long > msgSizesSentPerAgent,
TreeMap< Object, Long > msgSizesReveivedPerAgent,
long maxMsgSize,
TreeMap< MessageType, Long > maxMsgSizes,
long ncccCount,
long timeNeeded,
HashMap< String, Long > moduleEndTimes )

Constructor.

Parameters
reportedUtilthe reported optimal utility
trueUtilthe true optimal utility
assignmentsthe optimal assignments
nbrMsgsThe total number of messages sent
msgNbrsThe number of messages sent per message type
msgsNbrsSentPerAgentthe number of message sent by each agent
msgsNbrsReceivedPerAgentthe number of messages received by each agent
totalMsgSizeThe total message size
msgSizesThe amount of information sent per message type
msgSizesSentPerAgentthe amount of information sent by each agent, in bytes
msgSizesReveivedPerAgentthe amount of information received by each agent, in bytes
maxMsgSizethe size (in bytes) of the largest message
maxMsgSizesfor each message type, the size (in bytes) of the largest message of that type
ncccCountthe ncccs used
timeNeededthe time needed to solve the problem
moduleEndTimeseach module's end time

References assignments, maxMsgSize, maxMsgSizes, moduleEndTimes, msgNbrs, msgSizes, nbrMsgs, ncccCount, reportedUtil, timeNeeded, totalMsgSize, and trueUtil.

◆ Solution() [5/7]

frodo2.algorithms.Solution< V, U >.Solution ( int nbrVariables,
U reportedUtil,
U trueUtil,
Map< String, V > assignments,
int nbrMsgs,
TreeMap< MessageType, Integer > msgNbrs,
TreeMap< Object, Integer > msgsNbrsSentPerAgent,
TreeMap< Object, Integer > msgsNbrsReceivedPerAgent,
long totalMsgSize,
TreeMap< MessageType, Long > msgSizes,
TreeMap< Object, Long > msgSizesSentPerAgent,
TreeMap< Object, Long > msgSizesReveivedPerAgent,
long maxMsgSize,
TreeMap< MessageType, Long > maxMsgSizes,
long ncccCount,
long timeNeeded,
HashMap< String, Long > moduleEndTimes,
int numberOfCoordinationConstraints )

Constructor.

Parameters
nbrVariablesthe total number of variables in the problem
reportedUtilthe reported optimal utility
trueUtilthe true optimal utility
assignmentsthe optimal assignments
nbrMsgsThe total number of messages sent
msgNbrsThe number of messages sent per message type
msgsNbrsSentPerAgentthe number of message sent by each agent
msgsNbrsReceivedPerAgentthe number of messages received by each agent
totalMsgSizeThe total message size
msgSizesThe amount of information sent per message type
msgSizesSentPerAgentthe amount of information sent by each agent, in bytes
msgSizesReveivedPerAgentthe amount of information received by each agent, in bytes
maxMsgSizethe size (in bytes) of the largest message
maxMsgSizesfor each message type, the size (in bytes) of the largest message of that type
ncccCountthe ncccs used
timeNeededthe time needed to solve the problem
moduleEndTimeseach module's end time
numberOfCoordinationConstraintsthe number of constraints that contain variables that are owned by different agents

References assignments, maxMsgSize, maxMsgSizes, moduleEndTimes, msgNbrs, msgSizes, nbrMsgs, ncccCount, numberOfCoordinationConstraints, reportedUtil, timeNeeded, totalMsgSize, and trueUtil.

◆ Solution() [6/7]

frodo2.algorithms.Solution< V, U >.Solution ( int nbrVariables,
U reportedUtil,
U trueUtil,
Map< String, V > assignments,
int nbrMsgs,
TreeMap< MessageType, Integer > msgNbrs,
TreeMap< Object, Integer > msgsNbrsSentPerAgent,
TreeMap< Object, Integer > msgsNbrsReceivedPerAgent,
long totalMsgSize,
TreeMap< MessageType, Long > msgSizes,
TreeMap< Object, Long > msgSizesSentPerAgent,
TreeMap< Object, Long > msgSizesReveivedPerAgent,
long maxMsgSize,
TreeMap< MessageType, Long > maxMsgSizes,
long ncccCount,
long timeNeeded,
HashMap< String, Long > moduleEndTimes,
int treeWidth,
int numberOfCoordinationConstraints )

Constructor.

Parameters
nbrVariablesthe total number of variables in the problem
reportedUtilthe reported optimal utility
trueUtilthe true optimal utility
assignmentsthe optimal assignments
nbrMsgsThe total number of messages sent
msgNbrsThe number of messages sent per message type
msgsNbrsSentPerAgentthe number of message sent by each agent
msgsNbrsReceivedPerAgentthe number of messages received by each agent
totalMsgSizeThe total message size
msgSizesThe amount of information sent per message type
msgSizesSentPerAgentthe amount of information sent by each agent, in bytes
msgSizesReveivedPerAgentthe amount of information received by each agent, in bytes
maxMsgSizethe size (in bytes) of the largest message
maxMsgSizesfor each message type, the size (in bytes) of the largest message of that type
ncccCountthe ncccs used
timeNeededthe time needed to solve the problem
moduleEndTimeseach module's end time
treeWidththe width of the tree on which the algorithm has run
numberOfCoordinationConstraintsthe number of constraints that contain variables that are owned by different agents

References assignments, maxMsgSize, maxMsgSizes, moduleEndTimes, msgNbrs, msgSizes, nbrMsgs, ncccCount, numberOfCoordinationConstraints, reportedUtil, timeNeeded, totalMsgSize, treeWidth, and trueUtil.

◆ Solution() [7/7]

frodo2.algorithms.Solution< V, U >.Solution ( int nbrVariables,
U reportedUtil,
U trueUtil,
Map< String, V > assignments,
int nbrMsgs,
TreeMap< MessageType, Integer > msgNbrs,
TreeMap< Object, Integer > msgsNbrsSentPerAgent,
TreeMap< Object, Integer > msgsNbrsReceivedPerAgent,
long totalMsgSize,
TreeMap< MessageType, Long > msgSizes,
TreeMap< Object, Long > msgSizesSentPerAgent,
TreeMap< Object, Long > msgSizesReveivedPerAgent,
long maxMsgSize,
TreeMap< MessageType, Long > maxMsgSizes,
long ncccCount,
long timeNeeded,
long cumulativelTime,
HashMap< String, Long > moduleEndTimes,
int treeWidth,
int numberOfCoordinationConstraints )

Constructor.

Parameters
nbrVariablesthe total number of variables in the problem
reportedUtilthe reported optimal utility
trueUtilthe true optimal utility
assignmentsthe optimal assignments
nbrMsgsThe total number of messages sent
msgNbrsThe number of messages sent per message type
msgsNbrsSentPerAgentthe number of message sent by each agent
msgsNbrsReceivedPerAgentthe number of messages received by each agent
totalMsgSizeThe total message size
msgSizesThe amount of information sent per message type
msgSizesSentPerAgentthe amount of information sent by each agent, in bytes
msgSizesReveivedPerAgentthe amount of information received by each agent, in bytes
maxMsgSizethe size (in bytes) of the largest message
maxMsgSizesfor each message type, the size (in bytes) of the largest message of that type
ncccCountthe ncccs used
timeNeededthe time needed to solve the problem
cumulativelTimethe cumulative time needed by all the agents to terminate
moduleEndTimeseach module's end time
treeWidththe width of the tree on which the algorithm has run
numberOfCoordinationConstraintsthe number of constraints that contain variables that are owned by different agents

References assignments, maxMsgSize, maxMsgSizes, moduleEndTimes, msgNbrs, msgSizes, nbrMsgs, ncccCount, numberOfCoordinationConstraints, reportedUtil, timeNeeded, totalMsgSize, treeWidth, and trueUtil.

Member Function Documentation

◆ getAssignments()

◆ getMaxMsgSize()

long frodo2.algorithms.Solution< V, U >.getMaxMsgSize ( )
Returns
the size (in bytes) of the largest message

◆ getMaxMsgSizes()

TreeMap< MessageType, Long > frodo2.algorithms.Solution< V, U >.getMaxMsgSizes ( )
Returns
for each message type, the size (in bytes) of the largest message

◆ getMsgNbrs()

TreeMap< MessageType, Integer > frodo2.algorithms.Solution< V, U >.getMsgNbrs ( )
Author
Brammert Ottens, 24 aug 2009
Returns
the total amount of information per message type

Referenced by frodo2.algorithms.dpop.restart.test.TestSDPOP< V extends Addable< V >, U extends Addable< U > >.testAddDisconnected().

◆ getMsgSizes()

TreeMap< MessageType, Long > frodo2.algorithms.Solution< V, U >.getMsgSizes ( )
Author
Brammert Ottens, 24 aug 2009
Returns
the total number of messages per message type

Referenced by frodo2.algorithms.dpop.restart.test.TestSDPOP< V extends Addable< V >, U extends Addable< U > >.testReuse().

◆ getNbrMsgs()

◆ getNbrVariables()

int frodo2.algorithms.Solution< V, U >.getNbrVariables ( )
Author
Brammert Ottens, 7 mrt 2010
Returns
the number of variables in the problem

◆ getNcccCount()

◆ getNumberOfCoordinationConstraints()

int frodo2.algorithms.Solution< V, U >.getNumberOfCoordinationConstraints ( )
Author
Brammert Ottens, 6 mrt 2010
Returns
the number of constraints that contain variables that are owned by different agents

◆ getReportedUtil()

◆ getTimeNeeded()

◆ getTimesNeeded()

HashMap< String, Long > frodo2.algorithms.Solution< V, U >.getTimesNeeded ( )
Author
Brammert Ottens, 22 jun 2009
Returns
the end time of each of the modules

◆ getTotalMsgSize()

◆ getTotalTime()

long frodo2.algorithms.Solution< V, U >.getTotalTime ( )
Author
Brammert Ottens, 17 jan. 2011
Returns
the cumulative time needed to solve the problem

◆ getTreeWidth()

◆ getUtility()

U frodo2.algorithms.Solution< V, U >.getUtility ( )
Returns
the true utility of the solution

References trueUtil.

Referenced by frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.checkOutput(), frodo2.algorithms.synchbb.test.SynchBBagentTest< V extends Addable< V >, U extends Addable< U > >.checkOutput(), frodo2.algorithms.AbstractSolver< P extends ProblemInterface< V, U, V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.plotStats(), frodo2.algorithms.duct.DUCTsolver< V extends Addable< V > >.plotStats(), frodo2.solutionSpaces.JaCoP.tests.JaCoPproblemTest< V extends Addable< V > >.solve(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.asodpop.tests.ASODPOPTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.dpop.memory.tests.MB_DPOPagentTest.test(), frodo2.algorithms.dpop.privacy.test.P2_DPOPagentTest< V extends Addable< V >, E extends AddableLimited< AddableInteger, E >.test(), frodo2.algorithms.dpop.privacy.test.P3halves_DPOPagentTest< V extends Addable< V >, E extends AddableLimited< AddableInteger, E >.test(), frodo2.algorithms.maxsum.tests.MaxSumTests< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.mpc_discsp.tests.MPC_DisWCSP4tests.test(), frodo2.algorithms.odpop.tests.UTILpropagationTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.test(), frodo2.solutionSpaces.vehiclerouting.test.VRPtests.test(), frodo2.algorithms.dpop.restart.test.TestSDPOP< V extends Addable< V >, U extends Addable< U > >.testGeneric(), frodo2.algorithms.dpop.privacy.test.P_DPOPagentTest< V extends Addable< V > >.testP_DPOPvsDPOP(), frodo2.solutionSpaces.JaCoP.tests.JaCoPtests< V extends Addable< V > >.testProblemFromRepository(), frodo2.solutionSpaces.JaCoP.tests.JaCoPtests< V extends Addable< V > >.testRandomExtensionalProblem(), and frodo2.algorithms.dpop.restart.test.TestSDPOP< V extends Addable< V >, U extends Addable< U > >.testReuse().

◆ setNbrMsgs()

void frodo2.algorithms.Solution< V, U >.setNbrMsgs ( int nbrMsgsNew)

Sets the total number of messages.

Parameters
nbrMsgsNewnew total number of messages

References nbrMsgs.

◆ setTimeNeeded()

void frodo2.algorithms.Solution< V, U >.setTimeNeeded ( long timeNeededNew)

Sets the total runtime.

Parameters
timeNeededNewnew total runtime

References timeNeeded.

◆ setTotalMsgSize()

void frodo2.algorithms.Solution< V, U >.setTotalMsgSize ( long totalMsgSizeNew)

Sets the total amount of information exchanged.

Parameters
totalMsgSizeNewnew total amount of information exchanged

References totalMsgSize.

◆ setUtility()

void frodo2.algorithms.Solution< V, U >.setUtility ( U util)

Sets the utility.

Parameters
utilthe utility

◆ toLineString()

String frodo2.algorithms.Solution< V, U >.toLineString ( )
Returns
a representation of this solution that fits on one line (for the output CSV file)

Referenced by frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.main().

◆ toString()

Member Data Documentation

◆ assignments

◆ cumulativeTime

long frodo2.algorithms.Solution< V, U >.cumulativeTime
protected

The cumulative time needed for all agents to find a solution.

Todo
Apparently not used anywhere
See also
"https://sourceforge.net/p/frodo2/support-requests/8/"

Referenced by frodo2.algorithms.duct.DUCTSolution< V extends Addable< V > >.DUCTSolution().

◆ maxMsgSize

◆ maxMsgSizes

◆ moduleEndTimes

◆ msgNbrs

◆ msgSizes

◆ nbrMsgs

◆ ncccCount

◆ numberOfCoordinationConstraints

◆ numberOfVariables

int frodo2.algorithms.Solution< V, U >.numberOfVariables
private

The number of variables that occur in the problem.

◆ reportedUtil

◆ timeNeeded

◆ totalMsgSize

◆ treeWidth

◆ trueUtil


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