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

This is a solver that reads in the problem, creates the agents, runs the problem and then collects the statistics . More...

Inheritance diagram for frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >:

Public Member Functions

 DSAsolver ()
 Constructor.
 DSAsolver (boolean useTCP)
 Constructor.
 DSAsolver (Class< V > domClass, Class< U > utilClass)
 Constructor.
 DSAsolver (Class< V > domClass, Class< U > utilClass, boolean useTCP)
 Constructor.
 DSAsolver (String agentDesc)
 Constructor.
 DSAsolver (String agentDesc, boolean useTCP)
 Constructor.
 DSAsolver (String agentDescFile, Class< V > domClass, Class< U > utilClass)
 Constructor.
 DSAsolver (String agentDescFile, Class< V > domClass, Class< U > utilClass, boolean useTCP)
 Constructor.
 DSAsolver (Document agentDesc)
 Constructor.
 DSAsolver (Document agentDesc, boolean useTCP)
 Constructor.
 DSAsolver (String variant, String conflictCost, double p, boolean sync, int maxRounds) throws JDOMException, IOException
 Constructor.
 DSAsolver (boolean measureTime, boolean useTCP, boolean measureMsgs, Class< ? extends XCSPparser< V, U > > parserClass, Class< V > domClass, Class< U > utilClass, String variant, String conflictCost, double p, boolean sync, int maxRounds)
 Constructor.
void setConvergence (boolean convergence)
 Sets the convergence parameter to the desired value.
ArrayList< StatsReportergetSolGatherers ()
SolutionWithConvergence< V, U > buildSolution ()
void clear ()
Public Member Functions inherited from 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.
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.

Protected Member Functions

void parseParams (String[] params)
String getParamsHeader ()
String getParamsToLine ()
Protected Member Functions inherited from frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >
String getFileHeader (Document problemFile)
 Returns the header for the output CSV file.
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.
 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.

Protected Attributes

DSA< V, U > dsaModule
 The DSA module.
SolutionCollector< V, U > solCollector
 The SolutionCollector module.
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.

Private Member Functions

Element getElement (Element modules)
 Looks up the Element for the DSA module in the agent configuration file.

Additional Inherited Members

Static Public Member Functions inherited from frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >
static void main (String[] args) throws Exception
 Solves a problem and writes statistics to a file.

Detailed Description

This is a solver that reads in the problem, creates the agents, runs the problem and then collects the statistics .

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

Constructor & Destructor Documentation

◆ DSAsolver() [1/12]

Constructor.

◆ DSAsolver() [2/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( boolean useTCP)

Constructor.

Parameters
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.

◆ DSAsolver() [3/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( Class< V > domClass,
Class< U > utilClass )

Constructor.

Parameters
domClassthe class to use for variable values
utilClassthe class to use for utilities

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.setDomClass(), and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.setUtilClass().

Here is the call graph for this function:

◆ DSAsolver() [4/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( Class< V > domClass,
Class< U > utilClass,
boolean useTCP )

Constructor.

Parameters
domClassthe class to use for variable values
utilClassthe class to use for utilities
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 >.setDomClass(), frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.setUtilClass(), and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.useTCP.

Here is the call graph for this function:

◆ DSAsolver() [5/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( String agentDesc)

Constructor.

Parameters
agentDescpath to the agent description file

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

◆ DSAsolver() [6/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( String agentDesc,
boolean useTCP )

Constructor.

Parameters
agentDescpath to the agent description 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 >.agentDesc, and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.useTCP.

◆ DSAsolver() [7/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( String agentDescFile,
Class< V > domClass,
Class< U > utilClass )

Constructor.

Parameters
agentDescFiledescription of the agent to be used
domClassthe class to be used for variable values
utilClassthe class to be used for utility values

References frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.setDomClass(), and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.setUtilClass().

Here is the call graph for this function:

◆ DSAsolver() [8/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( String agentDescFile,
Class< V > domClass,
Class< U > utilClass,
boolean useTCP )

Constructor.

Parameters
agentDescFiledescription of the agent to be used
domClassthe class to be used for variable values
utilClassthe class to be used for utility values
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 >.setDomClass(), frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.setUtilClass(), and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.useTCP.

Here is the call graph for this function:

◆ DSAsolver() [9/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( Document agentDesc)

Constructor.

Parameters
agentDescdescription of the agent to be used

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

◆ DSAsolver() [10/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( Document agentDesc,
boolean useTCP )

Constructor.

Parameters
agentDescdescription of the agent 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, and frodo2.algorithms.AbstractSolver< DCOPProblemInterface< V, U >, V, U, S >.useTCP.

◆ DSAsolver() [11/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( String variant,
String conflictCost,
double p,
boolean sync,
int maxRounds ) throws JDOMException, IOException

Constructor.

Parameters
variant"A", "B", "C", "D" or "E"
conflictCostthe cost of a conflict
pthe probability of change
syncwhether to run synchronously
maxRoundsthe maximum number of rounds
Exceptions
IOExceptionif the agent configuration file cannot be opened
JDOMExceptionif a parsing error occurred

References parseParams().

Here is the call graph for this function:

◆ DSAsolver() [12/12]

frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.DSAsolver ( boolean measureTime,
boolean useTCP,
boolean measureMsgs,
Class< ? extends XCSPparser< V, U > > parserClass,
Class< V > domClass,
Class< U > utilClass,
String variant,
String conflictCost,
double p,
boolean sync,
int maxRounds )

Constructor.

Parameters
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 values
utilClassthe class of utility values
variant"A", "B", "C", "D" or "E"
conflictCostthe cost of a conflict
pthe probability of change
syncwhether to run synchronously
maxRoundsthe maximum number of rounds

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

Here is the call graph for this function:

Member Function Documentation

◆ buildSolution()

◆ clear()

void frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.clear ( )

◆ getElement()

Element frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.getElement ( Element modules)
private

Looks up the Element for the DSA module in the agent configuration file.

Parameters
modulesa list of modules
Returns
the DSA module element, or null if not found

Referenced by getParamsToLine(), and parseParams().

◆ getParamsHeader()

◆ getParamsToLine()

◆ getSolGatherers()

◆ parseParams()

void frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.parseParams ( String[] params)
protected
See also
AbstractDCOPsolver.parseParams(java.lang.String[])
Parameters
params{variant, conflictCost, p, sync, maxRounds}

Reimplemented from frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.

References getElement().

Referenced by DSAsolver(), and DSAsolver().

Here is the call graph for this function:

◆ setConvergence()

void frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.setConvergence ( boolean convergence)

Sets the convergence parameter to the desired value.

Parameters
convergencetrue when convergence must be measured, and false otherwise

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

Member Data Documentation

◆ dsaModule

DSA<V, U> frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.dsaModule
protected

The DSA module.

Referenced by buildSolution(), and getSolGatherers().

◆ solCollector

SolutionCollector<V, U> frodo2.algorithms.localSearch.dsa.DSAsolver< V extends Addable< V >, U extends Addable< U > >.solCollector
protected

The SolutionCollector module.

Referenced by buildSolution(), and getSolGatherers().


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