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

An abstract convenient class for solving DCOP instances. More...

Inheritance diagram for frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >:

Public Member Functions

 AbstractDCOPsolver (String agentDesc, boolean measureTime, boolean useTCP, boolean measureMsgs, Class<? extends XCSPparser< V, U > > parserClass, Class< V > domClass, Class< U > valuationClass)
 Constructor.
solve (Document problem, int nbrElectionRounds, boolean measureMsgs, Long timeout, boolean cleanAfterwards)
solve (DCOPProblemInterface< V, U > problem, int nbrElectionRounds, boolean measureMsgs, Long timeout, boolean cleanAfterwards)
solve (Document problem)
solve (DCOPProblemInterface< V, U > problem)
solve (Document problem, Long timeout)
solve (DCOPProblemInterface< V, U > problem, Long timeout)
solve (Document problem, boolean cleanAfterwards)
solve (DCOPProblemInterface< V, U > problem, boolean cleanAfterwards)
solve (Document problem, int nbrElectionRounds)
solve (DCOPProblemInterface< V, U > problem, int nbrElectionRounds)
solve (Document problem, int nbrElectionRounds, boolean measureMsgs)
solve (DCOPProblemInterface< V, U > problem, int nbrElectionRounds, boolean measureMsgs)
solve (Document problem, int nbrElectionRounds, boolean measureMsgs, Long timeout)
solve (DCOPProblemInterface< V, U > problem, int nbrElectionRounds, boolean measureMsgs, Long timeout)
solve (Document problem, int nbrElectionRounds, Long timeout)
solve (DCOPProblemInterface< V, U > problem, int nbrElectionRounds, Long timeout)
solve (Document problem, boolean cleanAfterwards, Long timeout)
solve (DCOPProblemInterface< V, U > problem, boolean cleanAfterwards, Long timeout) throws OutOfMemoryError
Public Member Functions inherited from frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >
void setProblem (P problem)
 Sets the problem.
void setFactory (AgentFactory< V, U > factory)
 Sets the agent factory.
void setDomClass (Class< V > domClass)
 Sets the class for variable values.
void setUtilClass (Class< U > utilClass)
 Sets the class for utility values.
Document getAgentDesc ()
abstract List<? extends StatsReportergetSolGatherers ()
abstract S buildSolution ()
solve (Document problem)
 Solves the input problem.
String plotStats (Solution< V, U > sol)
 Puts the statistics in a format that can easily be processed after the experiments.
String plotDummyStats (boolean maximize)
 Used when the solver was not able to solve the problem.

Static Public Member Functions

static void main (String[] args) throws Exception
 Solves a problem and writes statistics to a file.

Protected Member Functions

String getFileHeader (Document problemFile)
 Returns the header for the output CSV file.
String getParamsHeader ()
String getParamsToLine ()
String getProbStats (Document problemFile, String probFilename)
 Parses the statistics about the problem instance.
String getTimeoutLine (String algoName, Document problemFile, String probFilename)
 Returns a timeout line for the output CSV file.
 AbstractDCOPsolver ()
 Dummy constructor.
 AbstractDCOPsolver (String agentDescFile)
 Constructor from an agent configuration file.
 AbstractDCOPsolver (String agentDescFile, boolean useTCP)
 Constructor from an agent configuration file.
 AbstractDCOPsolver (String agentDescFile, boolean useTCP, int shift)
 Constructor from an agent configuration file.
 AbstractDCOPsolver (Document agentDesc)
 Constructor.
void parseParams (String[] params)
 Parses solver parameters.
 AbstractDCOPsolver (Document agentDesc, boolean useTCP)
 Constructor.
 AbstractDCOPsolver (Document agentDesc, Class< ? extends XCSPparser< V, U > > parserClass)
 Constructor.
 AbstractDCOPsolver (Document agentDesc, Class< ? extends XCSPparser< V, U > > parserClass, boolean useTCP)
 Constructor.
void setNbrElectionRounds (int nbrElectionRounds)
 Sets the number of rounds of VariableElection.
void setProblemRescalerShift (int shift)
 Sets the shift parameter of the ProblemRescaler module (if used).
void overrideMsgTypes ()
 Overrides message types if necessary.
Protected Member Functions inherited from frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >
 AbstractSolver ()
 Dummy constructor.
void clear ()
 Clears the parser.

Additional Inherited Members

Protected Attributes inherited from frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >
Document agentDesc
 Description of the agent to be used.
AgentFactory< V, U > factory
 The agent factory.
Class< ? extends XCSPparser< V, U > > parserClass
 The class of the parser to be used.
List<? extends StatsReportersolGatherers
 The list of modules that record statistics about problem solving.
problem
 The problem.
final boolean useTCP
 Whether to use TCP pipes or shared memory pipes.

Detailed Description

An abstract convenient class for solving DCOP instances.

Author
Thomas Leaute
Parameters
<V>type used for variable values
<U>type used for utility values
<S>type used for the solution

Constructor & Destructor Documentation

◆ AbstractDCOPsolver() [1/9]

frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractDCOPsolver ( )
protected

Dummy constructor.

Referenced by main().

◆ AbstractDCOPsolver() [2/9]

frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractDCOPsolver ( String agentDescFile)
protected

Constructor from an agent configuration file.

Parameters
agentDescFilethe agent configuration file

◆ AbstractDCOPsolver() [3/9]

frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractDCOPsolver ( String agentDescFile,
boolean useTCP )
protected

Constructor from an agent configuration file.

Parameters
agentDescFilethe agent configuration file
useTCPWhether to use TCP pipes or shared memory pipes
Warning
Using TCP pipes automatically disables simulated time.

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.useTCP.

◆ AbstractDCOPsolver() [4/9]

frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractDCOPsolver ( String agentDescFile,
boolean useTCP,
int shift )
protected

Constructor from an agent configuration file.

Parameters
agentDescFilethe agent configuration file
useTCPWhether to use TCP pipes or shared memory pipes
shiftThe shift parameter for the ProblemRescaler (if used)
Warning
Using TCP pipes automatically disables simulated time.

References setProblemRescalerShift(), and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.useTCP.

Here is the call graph for this function:

◆ AbstractDCOPsolver() [5/9]

frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractDCOPsolver ( Document agentDesc)
protected

Constructor.

Parameters
agentDesca JDOM Document for the agent description

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.agentDesc.

◆ AbstractDCOPsolver() [6/9]

frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractDCOPsolver ( String agentDesc,
boolean measureTime,
boolean useTCP,
boolean measureMsgs,
Class<? extends XCSPparser< V, U > > parserClass,
Class< V > domClass,
Class< U > valuationClass )

Constructor.

Parameters
agentDescthe path to the agent description file
measureTimewhether to measure simulated time
useTCPwhether to use TCP pipes instead of shared memory (if true, disables the simulated time metric)
measureMsgswhether to measure messages
parserClassThe class of the parser to be used
domClassthe class of variable assignments
valuationClassthe class of valuations

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.agentDesc, frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.parserClass, and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.useTCP.

◆ AbstractDCOPsolver() [7/9]

frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractDCOPsolver ( Document agentDesc,
boolean useTCP )
protected

Constructor.

Parameters
agentDesca JDOM Document for the agent description
useTCPWhether to use TCP pipes or shared memory pipes
Warning
Using TCP pipes automatically disables simulated time.

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.agentDesc, and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.useTCP.

◆ AbstractDCOPsolver() [8/9]

frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractDCOPsolver ( Document agentDesc,
Class< ? extends XCSPparser< V, U > > parserClass )
protected

Constructor.

Parameters
agentDescThe agent description
parserClassThe class of the parser to be used

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.agentDesc, and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.parserClass.

◆ AbstractDCOPsolver() [9/9]

frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractDCOPsolver ( Document agentDesc,
Class< ? extends XCSPparser< V, U > > parserClass,
boolean useTCP )
protected

Constructor.

Parameters
agentDescThe agent description
parserClassThe class of the parser to be used
useTCPWhether to use TCP pipes or shared memory pipes
Warning
Using TCP pipes automatically disables simulated time.

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.agentDesc, frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.parserClass, and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.useTCP.

Member Function Documentation

◆ getFileHeader()

String frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.getFileHeader ( Document problemFile)
protected

Returns the header for the output CSV file.

Parameters
problemFilethe problem file
Returns
the titles of the columns in the output CSV file

References getParamsHeader().

Referenced by main().

Here is the call graph for this function:

◆ getParamsHeader()

String frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.getParamsHeader ( )
protected

◆ getParamsToLine()

String frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.getParamsToLine ( )
protected

◆ getProbStats()

String frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.getProbStats ( Document problemFile,
String probFilename )
protected

Parses the statistics about the problem instance.

Parameters
problemFilethe problem instance
probFilenamethe filename of the problem instance
Returns
the statistics

Referenced by getTimeoutLine(), and main().

◆ getTimeoutLine()

String frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.getTimeoutLine ( String algoName,
Document problemFile,
String probFilename )
protected

Returns a timeout line for the output CSV file.

Parameters
algoNamethe name of the algorithm
problemFilethe problem instance
probFilenamethe filename of the problem instance
Returns
a line in the output CSV file that corresponds to a timeout

References getProbStats().

Referenced by main().

Here is the call graph for this function:

◆ main()

void frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.main ( String[] args) throws Exception
static

Solves a problem and writes statistics to a file.

Parameters
args[algoName, problemFile, outputFile, timeout in seconds, solverClassName, agentConfigFile, agentParam1, agentParam2...]
Exceptions
Exceptionif an error occurs

References AbstractDCOPsolver(), getFileHeader(), getParamsToLine(), getProbStats(), getTimeoutLine(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), parseParams(), solve(), frodo2.timeout, and frodo2.algorithms.Solution< V, U >.toLineString().

Here is the call graph for this function:

◆ overrideMsgTypes()

◆ parseParams()

void frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.parseParams ( String[] params)
protected

◆ setNbrElectionRounds()

void frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.setNbrElectionRounds ( int nbrElectionRounds)
protected

Sets the number of rounds of VariableElection.

Parameters
nbrElectionRoundsthe number of rounds of VariableElection (must be greater than the diameter of the constraint graph)

Reimplemented in frodo2.algorithms.dpop.privacy.P2_DPOPsolver< V extends Addable< V >, U extends Addable< U > >, and frodo2.algorithms.dpop.privacy.P_DPOPsolver< V extends Addable< V > >.

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.agentDesc.

Referenced by solve(), and solve().

◆ setProblemRescalerShift()

void frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.setProblemRescalerShift ( int shift)
protected

◆ solve() [1/18]

◆ solve() [2/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( DCOPProblemInterface< V, U > problem,
boolean cleanAfterwards )

◆ solve() [3/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( DCOPProblemInterface< V, U > problem,
boolean cleanAfterwards,
Long timeout ) throws OutOfMemoryError

◆ solve() [4/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( DCOPProblemInterface< V, U > problem,
int nbrElectionRounds )

◆ solve() [5/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( DCOPProblemInterface< V, U > problem,
int nbrElectionRounds,
boolean measureMsgs )

◆ solve() [6/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( DCOPProblemInterface< V, U > problem,
int nbrElectionRounds,
boolean measureMsgs,
Long timeout )

◆ solve() [7/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( DCOPProblemInterface< V, U > problem,
int nbrElectionRounds,
boolean measureMsgs,
Long timeout,
boolean cleanAfterwards )

◆ solve() [8/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( DCOPProblemInterface< V, U > problem,
int nbrElectionRounds,
Long timeout )

◆ solve() [9/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( DCOPProblemInterface< V, U > problem,
Long timeout )

◆ solve() [10/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( Document problem)
See also
AbstractSolver.solve(org.jdom2.Document)

References overrideMsgTypes(), and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.problem.

Here is the call graph for this function:

◆ solve() [11/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( Document problem,
boolean cleanAfterwards )
See also
AbstractSolver.solve(org.jdom2.Document, boolean)

References overrideMsgTypes(), and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.problem.

Here is the call graph for this function:

◆ solve() [12/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( Document problem,
boolean cleanAfterwards,
Long timeout )
See also
AbstractSolver.solve(org.jdom2.Document, boolean, java.lang.Long)

References overrideMsgTypes(), frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.problem, and frodo2.timeout.

Here is the call graph for this function:

◆ solve() [13/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( Document problem,
int nbrElectionRounds )
See also
AbstractSolver.solve(org.jdom2.Document, int)

References overrideMsgTypes(), and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.problem.

Here is the call graph for this function:

◆ solve() [14/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( Document problem,
int nbrElectionRounds,
boolean measureMsgs )
See also
AbstractSolver.solve(org.jdom2.Document, int, boolean)

References overrideMsgTypes(), and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.problem.

Here is the call graph for this function:

◆ solve() [15/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( Document problem,
int nbrElectionRounds,
boolean measureMsgs,
Long timeout )
See also
AbstractSolver.solve(org.jdom2.Document, int, boolean, java.lang.Long)

References overrideMsgTypes(), frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.problem, and frodo2.timeout.

Here is the call graph for this function:

◆ solve() [16/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( Document problem,
int nbrElectionRounds,
boolean measureMsgs,
Long timeout,
boolean cleanAfterwards )
See also
AbstractSolver.solve(org.jdom2.Document, int, boolean, java.lang.Long, boolean)

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.agentDesc, overrideMsgTypes(), frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.problem, setNbrElectionRounds(), solve(), and frodo2.timeout.

Referenced by frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.checkOutput(), frodo2.algorithms.dpop.stochastic.test.E_DPOPagentTest< V extends Addable< V > >.checkOutput(), frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.checkOutput(), frodo2.algorithms.synchbb.test.SynchBBagentTest< V extends Addable< V >, U extends Addable< U > >.checkOutput(), main(), solve(), solve(), frodo2.solutionSpaces.JaCoP.tests.JaCoPproblemTest< V extends Addable< V > >.solve(), 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.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.algorithms.adopt.test.ADOPTagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.dpop.count.test.TestCountSolutions.testRandom(), frodo2.algorithms.odpop.tests.ODPOPagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.odpop.tests.ODPOPagentTestBinaryDomains< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.testRandom(), 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().

Here is the call graph for this function:

◆ solve() [17/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( Document problem,
int nbrElectionRounds,
Long timeout )
See also
AbstractSolver.solve(org.jdom2.Document, int, java.lang.Long)

References overrideMsgTypes(), frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.problem, and frodo2.timeout.

Here is the call graph for this function:

◆ solve() [18/18]

S frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve ( Document problem,
Long timeout )
See also
AbstractSolver.solve(org.jdom2.Document, java.lang.Long)

References overrideMsgTypes(), frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.problem, and frodo2.timeout.

Here is the call graph for this function:

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