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

An XCSP parser that provides convenient methods to extract information from XCSP files. More...

Inheritance diagram for frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >:

Classes

class  Relation
 The representation of an XCSP relation. More...

Public Member Functions

 XCSPparser ()
 Empty constructor.
 XCSPparser (Element root)
 Constructor from a JDOM root Element in XCSP format.
 XCSPparser (Document doc)
 Constructor from a JDOM Document in XCSP format.
 XCSPparser (Document doc, Boolean countNCCCs)
 Constructor from a JDOM Document in XCSP format.
 XCSPparser (Document doc, Boolean countNCCCs, HashSet< String > spacesToIgnore)
 Constructor from a JDOM Document in XCSP format.
 XCSPparser (Document doc, boolean countNCCCs, boolean extendedRandNeighborhoods)
 Constructor from a JDOM Document in XCSP format.
 XCSPparser (Document doc, boolean countNCCCs, boolean extendedRandNeighborhoods, boolean publicAgents)
 Constructor from a JDOM Document in XCSP format.
 XCSPparser (Document doc, Element params)
 Constructor.
void setDomClass (Class< V > domClass)
 Sets the class to be used for variable values.
Class< V > getDomClass ()
void addSpaceToIgnore (String spaceToIgnore)
 Adds a space to be ignored.
void setUtilClass (Class< U > utilClass)
 Sets the class to be used for utility values.
String getAgent ()
getZeroUtility ()
getPlusInfUtility ()
getMinInfUtility ()
List< ? extends UtilitySolutionSpace< V, U > > getProbabilitySpaces ()
 Extracts probability spaces from the constraints in the problem.
List< ? extends UtilitySolutionSpace< V, U > > getProbabilitySpaces (String var)
 Extracts probability spaces involving the input variable from the constraints in the problem.
List< ? extends UtilitySolutionSpace< V, U > > getSolutionSpaces ()
 Returns the solution spaces in the problem.
List< ? extends UtilitySolutionSpace< V, U > > getSolutionSpaces (String var)
 Extracts solution spaces involving the input variable from the constraints in the problem.
List< ? extends UtilitySolutionSpace< V, U > > getSolutionSpaces (final boolean withAnonymVars)
 Extracts solution spaces from the constraints in the problem.
List< ? extends UtilitySolutionSpace< V, U > > getSolutionSpaces (DCOPProblemInterface< V, U > problem, final boolean withAnonymVars)
 Extracts solution spaces from the constraints in the problem.
List< ? extends UtilitySolutionSpace< V, U > > getSolutionSpaces (String var, final boolean withAnonymVars)
 Extracts solution spaces involving the input variable from the constraints in the problem.
List<? extends UtilitySolutionSpace< V, U > > getSolutionSpaces (String var, Set< String > forbiddenVars)
 Returns the solution spaces involving the input variable and none of the forbidden variables.
List<? extends UtilitySolutionSpace< V, U > > getSolutionSpaces (String var, boolean withAnonymVars, Set< String > forbiddenVars)
 Extracts solution spaces involving the input variable from the constraints in the problem.
List<? extends UtilitySolutionSpace< V, U > > getSolutionSpaces (Set< String > vars, boolean withAnonymVars, Set< String > forbiddenVars)
 Extracts solution spaces involving the input variables from the constraints in the problem.
boolean isCountingNCCCs ()
void incrNCCCs (long incr)
 Increments the number of constraint checks.
void setNCCCs (long ncccs)
 Sets the NCCC count.
long getNCCCs ()
boolean removeSpace (String name)
 Removes the space with the given name.
boolean addSolutionSpace (UtilitySolutionSpace< V, U > space)
 Adds a solution space to the problem.
Set< String > getAgents ()
String getOwner (String var)
 Returns the name of the agent owning the input variable.
boolean setOwner (String var, String owner)
 Sets the owner agent for the input variable.
Map< String, String > getOwners ()
int getNbrVars ()
 Extracts the number of variables in the problem.
int getNbrVars (String owner)
 Computes the number of variables owned by the input agent.
int getNbrIntVars ()
Set< String > getAllVars ()
Set< String > getVariables ()
Set< String > getVariables (String owner)
 Returns the set of variables owned by a given agent.
Set< String > getMyVars ()
Set< String > getExtVars ()
Set< String > getAnonymVars ()
boolean addVariable (String name, String owner, String domain)
 Adds a new variable.
boolean addVariable (String name, String owner, V[] domain)
 Adds a new variable.
XCSPparser< V, U > getSubProblem (String agent)
 Builds the subproblem description for a given agent by extracting it from the overall problem description.
HashSet< String > getNeighborVars (String var)
 Extracts the collection of neighbors of a given variable.
HashSet< String > getNeighborVars (String var, final boolean withAnonymVars)
 Extracts the collection of neighbors of a given variable.
int getNbrNeighbors (String var)
 Extracts the number of neighbors of an input variable.
int getNbrNeighbors (String var, final boolean withAnonymVars)
 Extracts the number of neighbors of an input variable.
Map< String, HashSet< String > > getNeighborhoods (String agent)
 Parses the problem description to construct, for each variable owned by the input agent, its list of neighbors.
Map< String, HashSet< String > > getNeighborhoods ()
 Returns the neighborhood of each internal variable.
Map< String, HashSet< String > > getAnonymNeighborhoods (String agent)
 Parses the problem description to construct, for each variable owned by the input agent, its list of neighbors with no specified owner.
Map< String, HashSet< String > > getAnonymNeighborhoods ()
Map< String, HashSet< String > > getNeighborhoods (String agent, final boolean withAnonymVars, final boolean onlyAnonymVars)
 Parses the problem description to construct, for each variable owned by the input agent, its list of neighbors.
Map< String, Integer > getNeighborhoodSizes (String agent)
 Computes the number of neighboring variables of all variables owned by a given agent.
Map< String, Integer > getNeighborhoodSizes ()
 Returns the number of neighboring variables of all internal variables.
Map< String, Collection< String > > getAgentNeighborhoods (String agent)
 Gets the agent neighborhoods.
Map< String, Collection< String > > getAgentNeighborhoods ()
Map< String, Collection< String > > getBackyardNeighborhood (String var)
 This method only makes sense in subclasses of XCSPparser that handle backyard variables.
int getDomainSize (String var)
 Extracts the size of the domain of the input variable.
V[] getDomain (String var)
 Extracts the domain of a given variable.
void setDomain (String var, V[] dom)
 Sets the domain of a variable in the problem.
void setProbSpace (String var, Map< V, Double > prob)
 Adds to the problem a probability space for the input random variable.
String toString ()
String toDOT ()
boolean isRandom (String var)
 Returns whether the input variable is defined as a random variable.
Document groundVars (String[] vars, V[] values)
 Transforms the problem into one where some variables' values have been fixed.
UtilitySolutionSpace< V, U > getUtility (Map< String, V > assignments)
 Computes the total utility of the input assignment to variables, ignoring variables with no specified owner.
UtilitySolutionSpace< V, U > getUtility (Map< String, V > assignments, final boolean withAnonymVars)
 Computes the total utility of the input assignment to variables.
UtilitySolutionSpace< V, U > getExpectedUtility (Map< String, V > assignments)
 Computes the expectation over the random variables of the utility for the input assignments.
UtilitySolutionSpace< V, U > getParamUtility (Map< String[], BasicUtilitySolutionSpace< V, ArrayList< V > > > assignments)
 Computes the total utility of the input assignment to variables, conditioned on the values of parameters.
boolean maximize ()
void setMaximize (boolean maximize)
 Sets whether utility should be maximized, or cost minimized.
void rescale (U multiply, U add)
 Rescales the problem.
Document switchMaxMin (int shiftInt)
 Change the problem from a maximisation problem to a minimisation problem.
void reset (ProblemInterface< V, U > newProblem)
 Resets this problem to be the same as the input one.
int getNumberOfCoordinationConstraints ()
 Returns the number of spaces that are shared between different agents.
boolean multipleTypes ()
UtilitySolutionSpace< V, U > addUnarySpace (String name, String var, V[] dom, U[] utils)
 Add a unary solution space to the problem.
DCOPProblemInterface< V, U > parse ()
Public Member Functions inherited from frodo2.algorithms.ParserInterface< V, U >
ProblemInterface< V, U > parse ()

Static Public Member Functions

static Document parse (File file) throws JDOMException, IOException
 Creates a JDOM Document out of the input XML file in XCSP format.
static Document parse (File file, boolean checkXCSP) throws JDOMException, IOException
 Creates a JDOM Document out of the input XML file (not necessarily in XCSP format).
static Document parse (String path) throws Exception
 Creates a JDOM Document out of the input XML file path in XCSP format.
static Document parse (String path, boolean checkXCSP) throws Exception
 Creates a JDOM Document out of the input XML file path (not necessarily in XCSP format).
static Document parse (InputStream stream) throws JDOMException, IOException
 Creates a JDOM Document out of the input XML stream in XCSP format.
static Document parse (InputStream stream, boolean checkXCSP) throws JDOMException, IOException
 Creates a JDOM Document out of the input XML stream (not necessarily in XCSP format).
static String toString (Document doc)
 Returns a human-friendly String representation of the input JDOM Document.
static String toString (Element root)
 Returns a human-friendly String representation of the input JDOM Element.
static void main (String[] args) throws Exception
 Parses the input problem.
static String toDOT (Document doc)
 Returns the constraint graph in DOT format.
static String toDOT (Element root)
 Returns the constraint graph in DOT format.
static< V extends Addable< V > Element getRelation (UtilitySolutionSpace< V, ? extends Addable<?> > hypercube, String id, String nature)
 Generates the XCSP "relation" or "probability" fragment corresponding to the input hypercube.
static Element getConstraint (UtilitySolutionSpace<?, ?> hypercube, String id, String ref)
 Creates an XCSP-formated description of this contraint.

Protected Member Functions

 XCSPparser (Element root, boolean countNCCCs, boolean extendedRandNeighborhoods)
 Constructor from a JDOM root Element in XCSP format.
 XCSPparser (Element root, boolean countNCCCs, boolean extendedRandNeighborhoods, boolean publicAgents)
 Constructor from a JDOM root Element in XCSP format.
 XCSPparser (Element root, boolean countNCCCs)
 Constructor from a JDOM root Element in XCSP format.
 XCSPparser (Element root, boolean countNCCCs, boolean extendedRandNeighborhoods, HashSet< String > spacesToIgnoreNcccs, boolean mpc)
 Constructor from a JDOM root Element in XCSP format.
XCSPparser< V, U > newInstance (Element instance)
 Calls the corresponding constructor.
getInfeasibleUtil ()
List< ? extends UtilitySolutionSpace< V, U > > getSpaces (Set< String > vars, final boolean withAnonymVars, final boolean getProbs, Set< String > forbiddenVars, DCOPProblemInterface< V, U > problem)
 Extracts hypercubes from the constraints in the problem.
void parseConstraint (ArrayList< UtilitySolutionSpace< V, U > > spaces, Element constraint, HashMap< String, V[]> variablesHashMap, HashMap< String, Relation< V, U > > relationInfos, Set< String > vars, final boolean getProbs, final boolean withAnonymVars, U infeasibleUtil, Set< String > forbiddenVars, DCOPProblemInterface< V, U > problem)
 Parses a constraint.
void foundUndefinedRelations (HashSet< String > relationNames)
 Prints out an error message.
V[] getDomain (Element domainElmt, final boolean debugLoad)
 Parses and instantiates a domain from a domain Element.
boolean ignore (String spaceClass)

Protected Attributes

Element root
 JDOM Element in XCSP format.
Class< U > utilClass = (Class<U>) AddableInteger.class
 The class to be used for utility values.
valInstance = (V) new AddableInteger ()
 An instance of V.
final boolean extendedRandNeighborhoods
 If true, neighborhood relationships between decision variables are extended through random variables.
final boolean publicAgents
 Whether each agent knows the identities of all agents.
final boolean mpc
 Whether to behave in MPC mode.
final boolean countNCCCs
 Whether to count constraint checks.
HashSet< String > spacesToIgnoreNcccs
 a set of spaces for which ncccs should be ignored

Private Member Functions

boolean checkUniqueConstraintNames ()
 Checks that all constraints have unique names.
HashSet< String > getAgentNeighbors (String var)
 Returns the neighboring agents of the input variable.
HashSet< String > getScope (String var)
 Returns the agent scope of the variable.
void setDomain (String var, ArrayList< V > domain, Map< V, Double > weights)
 Sets the domain of a variable.

Static Private Member Functions

static String usage ()

Private Attributes

Class< V > domClass = (Class<V>) AddableInteger.class
 The class to be used for variable values.
long ncccCount
 The NCCC count.

Detailed Description

An XCSP parser that provides convenient methods to extract information from XCSP files.

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

Constructor & Destructor Documentation

◆ XCSPparser() [1/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( )

Empty constructor.

Referenced by getSubProblem(), main(), newInstance(), reset(), toDOT(), toDOT(), and toString().

◆ XCSPparser() [2/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Element root)

Constructor from a JDOM root Element in XCSP format.

Parameters
rootthe JDOM root Element in XCSP format

References checkUniqueConstraintNames(), and root.

Here is the call graph for this function:

◆ XCSPparser() [3/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Element root,
boolean countNCCCs,
boolean extendedRandNeighborhoods )
protected

Constructor from a JDOM root Element in XCSP format.

Parameters
rootthe JDOM root Element in XCSP format
countNCCCsWhether to count constraint checks
extendedRandNeighborhoodswhether we want extended random neighborhoods

References countNCCCs, extendedRandNeighborhoods, and root.

◆ XCSPparser() [4/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Element root,
boolean countNCCCs,
boolean extendedRandNeighborhoods,
boolean publicAgents )
protected

Constructor from a JDOM root Element in XCSP format.

Parameters
rootthe JDOM root Element in XCSP format
countNCCCsWhether to count constraint checks
extendedRandNeighborhoodswhether we want extended random neighborhoods
publicAgentsWhether each agent knows the identities of all agents

References checkUniqueConstraintNames(), countNCCCs, extendedRandNeighborhoods, publicAgents, and root.

Here is the call graph for this function:

◆ XCSPparser() [5/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Element root,
boolean countNCCCs )
protected

Constructor from a JDOM root Element in XCSP format.

Parameters
rootthe JDOM root Element in XCSP format
countNCCCsWhether to count constraint checks

References countNCCCs, and root.

◆ XCSPparser() [6/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Element root,
boolean countNCCCs,
boolean extendedRandNeighborhoods,
HashSet< String > spacesToIgnoreNcccs,
boolean mpc )
protected

Constructor from a JDOM root Element in XCSP format.

Parameters
rootthe JDOM root Element in XCSP format
countNCCCsWhether to count constraint checks
extendedRandNeighborhoodswhether we want extended random neighborhoods
spacesToIgnoreNcccslist of spaces for which NCCCs should NOT be counted
mpcWhether to behave in MPC mode

References checkUniqueConstraintNames(), countNCCCs, extendedRandNeighborhoods, mpc, root, and spacesToIgnoreNcccs.

Here is the call graph for this function:

◆ XCSPparser() [7/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Document doc)

Constructor from a JDOM Document in XCSP format.

Parameters
docthe JDOM Document in XCSP format

◆ XCSPparser() [8/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Document doc,
Boolean countNCCCs )

Constructor from a JDOM Document in XCSP format.

Parameters
docthe JDOM Document in XCSP format
countNCCCsWhether to count constraint checks

References countNCCCs.

◆ XCSPparser() [9/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Document doc,
Boolean countNCCCs,
HashSet< String > spacesToIgnore )

Constructor from a JDOM Document in XCSP format.

Parameters
docthe JDOM Document in XCSP format
countNCCCsWhether to count constraint checks
spacesToIgnorelist of spaces for which NCCCs should NOT be counted

References countNCCCs.

◆ XCSPparser() [10/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Document doc,
boolean countNCCCs,
boolean extendedRandNeighborhoods )

Constructor from a JDOM Document in XCSP format.

Parameters
docthe JDOM Document in XCSP format
countNCCCsWhether to count constraint checks
extendedRandNeighborhoodswhether we want extended random neighborhoods

References countNCCCs, and extendedRandNeighborhoods.

◆ XCSPparser() [11/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Document doc,
boolean countNCCCs,
boolean extendedRandNeighborhoods,
boolean publicAgents )

Constructor from a JDOM Document in XCSP format.

Parameters
docthe JDOM Document in XCSP format
countNCCCsWhether to count constraint checks
extendedRandNeighborhoodswhether we want extended random neighborhoods
publicAgentsWhether each agent knows the identities of all agents

References countNCCCs, extendedRandNeighborhoods, and publicAgents.

◆ XCSPparser() [12/12]

frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.XCSPparser ( Document doc,
Element params )

Constructor.

Parameters
docthe JDOM Document in XCSP format
paramsthe parameters of the solver

References checkUniqueConstraintNames(), domClass, setDomClass(), setUtilClass(), spacesToIgnoreNcccs, and toDOT().

Here is the call graph for this function:

Member Function Documentation

◆ addSolutionSpace()

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.addSolutionSpace ( UtilitySolutionSpace< V, U > space)

Adds a solution space to the problem.

Parameters
spacethe solution space
Returns
true if the space was added, false if the space's name is null or is already taken
Note
Ignores the relation name of this space, if any

References getConstraint(), getRelation(), and root.

Referenced by addUnarySpace().

Here is the call graph for this function:

◆ addSpaceToIgnore()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.addSpaceToIgnore ( String spaceToIgnore)

Adds a space to be ignored.

Author
Brammert Ottens, 8 feb. 2011
Parameters
spaceToIgnorethe name of the space to be ignored

Referenced by frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.setUp().

◆ addUnarySpace()

UtilitySolutionSpace< V, U > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.addUnarySpace ( String name,
String var,
V[] dom,
U[] utils )

Add a unary solution space to the problem.

Parameters
namethe name of the space
varthe unique variable in the space's scope
domthe allowed variable values
utilsthe valuation for each variable value
Returns
the newly added space

References addSolutionSpace(), and getInfeasibleUtil().

Here is the call graph for this function:

◆ addVariable() [1/2]

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.addVariable ( String name,
String owner,
String domain )

Adds a new variable.

Parameters
namevariable name
ownername of the variable's agent
domainreference to the variable's domain
Returns
true if the variable was added, false if a variable with the same name already exists or no domain with given name exists

References getAgents(), getDomain(), and root.

Referenced by addVariable().

Here is the call graph for this function:

◆ addVariable() [2/2]

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.addVariable ( String name,
String owner,
V[] domain )

Adds a new variable.

Parameters
namevariable name
ownername of the variable's agent
domainvariable domain
Returns
true if the variable was added, false if a variable with the same name already exists

References addVariable(), getDomain(), and root.

Here is the call graph for this function:

◆ checkUniqueConstraintNames()

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.checkUniqueConstraintNames ( )
private

Checks that all constraints have unique names.

Returns
false if constraints with the same name have been detected

References root.

Referenced by XCSPparser(), XCSPparser(), XCSPparser(), and XCSPparser().

◆ foundUndefinedRelations()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.foundUndefinedRelations ( HashSet< String > relationNames)
protected

Prints out an error message.

Parameters
relationNamesnames of the undefined relations

Reimplemented in frodo2.benchmarks.vehiclerouting.XCSPparserVRP< U extends Addable< U > >, and frodo2.solutionSpaces.JaCoP.JaCoPxcspParser< V extends Addable< V > >.

References root.

Referenced by getSubProblem().

◆ getAgent()

◆ getAgentNeighborhoods() [1/2]

Map< String, Collection< String > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getAgentNeighborhoods ( )
Returns
for each internal variable, the collection of neighboring agents

References getAgent(), and getAgentNeighborhoods().

Here is the call graph for this function:

◆ getAgentNeighborhoods() [2/2]

Map< String, Collection< String > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getAgentNeighborhoods ( String agent)

Gets the agent neighborhoods.

Parameters
agentthe owner agent, or null if we want all variables
Returns
for each variable owned by the input agent (or for each variable if the input is null), the collection of neighboring agents

References getAgentNeighbors(), getOwner(), and getVariables().

Referenced by getAgentNeighborhoods().

Here is the call graph for this function:

◆ getAgentNeighbors()

HashSet< String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getAgentNeighbors ( String var)
private

Returns the neighboring agents of the input variable.

Parameters
varthe variable
Returns
the variable's neighboring agents

References getOwner(), getScope(), isRandom(), and root.

Referenced by getAgentNeighborhoods().

Here is the call graph for this function:

◆ getAgents()

◆ getAllVars()

Set< String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getAllVars ( )
Returns
all variables, including the ones with no specified owner

References getAnonymVars(), and getVariables().

Referenced by frodo2.algorithms.test.ProblemTest.testGetDomain(), and frodo2.algorithms.test.ProblemTest.testGetDomainSize().

Here is the call graph for this function:

◆ getAnonymNeighborhoods() [1/2]

Map< String, HashSet< String > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getAnonymNeighborhoods ( )
Returns
for each internal variable, its collection of neighbors with no specified owner

References getAgent(), and getAnonymNeighborhoods().

Here is the call graph for this function:

◆ getAnonymNeighborhoods() [2/2]

Map< String, HashSet< String > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getAnonymNeighborhoods ( String agent)

Parses the problem description to construct, for each variable owned by the input agent, its list of neighbors with no specified owner.

Parameters
agentthe name of the agent
Returns
for each of the agent's variables, its collection of neighbors with no specified owner

References getNeighborhoods().

Referenced by getAnonymNeighborhoods().

Here is the call graph for this function:

◆ getAnonymVars()

Set< String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getAnonymVars ( )
Returns
the variables with no specified owner

References getVariables().

Referenced by getAllVars().

Here is the call graph for this function:

◆ getBackyardNeighborhood()

Map< String, Collection< String > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getBackyardNeighborhood ( String var)

This method only makes sense in subclasses of XCSPparser that handle backyard variables.

Parameters
varvariable
Returns
an empty map

◆ getConstraint()

Element frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getConstraint ( UtilitySolutionSpace<?, ?> hypercube,
String id,
String ref )
static

Creates an XCSP-formated description of this contraint.

Parameters
hypercubethe constraint
idthe name of the constraint
refthe name of the relation
Returns
the corresponding constraint description

Referenced by addSolutionSpace(), frodo2.algorithms.test.AllTests.generateProblem(), frodo2.benchmarks.maxdiscsp.MaxDisCSPProblemGenerator.generateProblem(), frodo2.algorithms.test.AllTests.generateSizedProblem(), and groundVars().

◆ getDomain() [1/2]

V[] frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getDomain ( Element domainElmt,
final boolean debugLoad )
protected

Parses and instantiates a domain from a domain Element.

Author
Radoslaw Szymanek
Parameters
domainElmtthe JDOM Element representing the domain
debugLoadif true, prints out some debug information
Returns
an array of domain values

References valInstance.

◆ getDomain() [2/2]

V[] frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getDomain ( String var)

Extracts the domain of a given variable.

Parameters
varthe variable
Returns
an array of domain values

References getDomain(), and root.

Referenced by addVariable(), addVariable(), getDomain(), getSpaces(), parse(), and frodo2.algorithms.test.ProblemTest.testGetDomain().

Here is the call graph for this function:

◆ getDomainSize()

int frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getDomainSize ( String var)

Extracts the size of the domain of the input variable.

Parameters
varthe variable
Returns
the size of the domain of var

References root.

Referenced by frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.notifyIn(), frodo2.algorithms.test.ProblemTest.testGetDomainSize(), and frodo2.algorithms.dpop.count.test.TestCountSolutions.testRandom().

◆ getDomClass()

Class< V > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getDomClass ( )
Returns
the class used for domain values

References domClass.

◆ getExpectedUtility()

UtilitySolutionSpace< V, U > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getExpectedUtility ( Map< String, V > assignments)

Computes the expectation over the random variables of the utility for the input assignments.

Parameters
assignmentsvalues for variables
Returns
the expectation of the utility for the input assignments

References frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.expectation(), getProbabilitySpaces(), and getUtility().

Here is the call graph for this function:

◆ getExtVars()

Set< String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getExtVars ( )
Returns
the variables that are owned by a different agent

References getAgent(), and root.

Here is the call graph for this function:

◆ getInfeasibleUtil()

U frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getInfeasibleUtil ( )
protected
Returns
-INF if we are maximizing, +INF if we are minimizing

References getMinInfUtility(), getPlusInfUtility(), maximize(), and root.

Referenced by addUnarySpace(), getParamUtility(), getSpaces(), getUtility(), and frodo2.solutionSpaces.JaCoP.JaCoPxcspParser< V extends Addable< V > >.getUtility().

Here is the call graph for this function:

◆ getMinInfUtility()

◆ getMyVars()

Set< String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getMyVars ( )
Returns
the internal variables

References getAgent(), and getVariables().

Referenced by frodo2.algorithms.test.ProblemTest.testGetNbrNeighbors().

Here is the call graph for this function:

◆ getNbrIntVars()

int frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNbrIntVars ( )
Returns
the number of internal variables

References getAgent(), and getNbrVars().

Here is the call graph for this function:

◆ getNbrNeighbors() [1/2]

int frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNbrNeighbors ( String var)

Extracts the number of neighbors of an input variable.

Parameters
varthe variable
Returns
the number of neighbor variables of var
Warning
Ignores variables with no specified owner.

References getNbrNeighbors().

Referenced by getNbrNeighbors(), and frodo2.algorithms.test.ProblemTest.testGetNbrNeighbors().

Here is the call graph for this function:

◆ getNbrNeighbors() [2/2]

int frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNbrNeighbors ( String var,
final boolean withAnonymVars )

Extracts the number of neighbors of an input variable.

Parameters
varthe variable
withAnonymVarsif false, ignores variables with no specified owner
Returns
the number of neighbor variables of var

References getNeighborVars().

Here is the call graph for this function:

◆ getNbrVars() [1/2]

◆ getNbrVars() [2/2]

int frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNbrVars ( String owner)

Computes the number of variables owned by the input agent.

Parameters
ownername of the agent
Returns
the number of variables owned by owner

References root.

◆ getNCCCs()

long frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNCCCs ( )
Returns
the number of constraint checks

◆ getNeighborhoods() [1/3]

Map< String, HashSet< String > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNeighborhoods ( )

Returns the neighborhood of each internal variable.

Returns
for each of the agent's variables, its collection of neighbors
Warning
Ignores variables with no specified owner.

References getAgent(), and getNeighborhoods().

Here is the call graph for this function:

◆ getNeighborhoods() [2/3]

Map< String, HashSet< String > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNeighborhoods ( String agent)

Parses the problem description to construct, for each variable owned by the input agent, its list of neighbors.

Parameters
agentthe name of the agent
Returns
for each of the agent's variables, its collection of neighbors
Warning
Ignores variables with no specified owner.

References getNeighborhoods().

Referenced by getAnonymNeighborhoods(), getNeighborhoods(), getNeighborhoods(), and getNeighborhoodSizes().

Here is the call graph for this function:

◆ getNeighborhoods() [3/3]

Map< String, HashSet< String > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNeighborhoods ( String agent,
final boolean withAnonymVars,
final boolean onlyAnonymVars )

Parses the problem description to construct, for each variable owned by the input agent, its list of neighbors.

Parameters
agentthe name of the agent
withAnonymVarsif false, ignores variables with no specified owner
onlyAnonymVarsif true, only considers variables with no specified owner (in which case this superseeds withAnonymVars)
Returns
for each of the agent's variables, its collection of neighbors
Todo
Improve the performance by avoiding to call getNeighborVars on each variable, which requires parsing the constraints multiple times.

References getNeighborVars(), getVariables(), and isRandom().

Here is the call graph for this function:

◆ getNeighborhoodSizes() [1/2]

Map< String, Integer > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNeighborhoodSizes ( )

Returns the number of neighboring variables of all internal variables.

Returns
for each internal variable, its number of neighboring variables
Warning
Ignores variables with no specified owner.

References getAgent(), and getNeighborhoodSizes().

Here is the call graph for this function:

◆ getNeighborhoodSizes() [2/2]

Map< String, Integer > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNeighborhoodSizes ( String agent)

Computes the number of neighboring variables of all variables owned by a given agent.

Parameters
agentname of the agent
Returns
for each variable owned by agent, its number of neighboring variables
Warning
Ignores variables with no specified owner.

References getNeighborhoods().

Referenced by getNeighborhoodSizes().

Here is the call graph for this function:

◆ getNeighborVars() [1/2]

HashSet< String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNeighborVars ( String var)

Extracts the collection of neighbors of a given variable.

Parameters
varthe name of the variable
Returns
a collection of neighbor variables of var
Warning
Ignores variables with no specified owner.

References getNeighborVars().

Referenced by getNbrNeighbors(), getNeighborhoods(), getNeighborVars(), frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.notifyIn(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.setUp(), and toDOT().

Here is the call graph for this function:

◆ getNeighborVars() [2/2]

HashSet< String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNeighborVars ( String var,
final boolean withAnonymVars )

Extracts the collection of neighbors of a given variable.

Parameters
varthe name of the variable
withAnonymVarsif false, ignores variables with no specified owner
Returns
a collection of neighbor variables of var

References isRandom(), and root.

Here is the call graph for this function:

◆ getNumberOfCoordinationConstraints()

int frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getNumberOfCoordinationConstraints ( )

Returns the number of spaces that are shared between different agents.

Author
Brammert Ottens, 6 mrt 2010
Returns
the number of spaces that are shared between different agents

References getOwners(), and getSolutionSpaces().

Here is the call graph for this function:

◆ getOwner()

◆ getOwners()

Map< String, String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getOwners ( )
Returns
for each variable, the name of its owner agent

References getNbrVars(), and root.

Referenced by getNumberOfCoordinationConstraints().

Here is the call graph for this function:

◆ getParamUtility()

UtilitySolutionSpace< V, U > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getParamUtility ( Map< String[], BasicUtilitySolutionSpace< V, ArrayList< V > > > assignments)

Computes the total utility of the input assignment to variables, conditioned on the values of parameters.

Parameters
assignmentsvalues for variables
Returns
the optimal conditional utility corresponding to the input assignment

References frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.compose(), getInfeasibleUtil(), getSolutionSpaces(), getZeroUtility(), and frodo2.output.

Here is the call graph for this function:

◆ getPlusInfUtility()

◆ getProbabilitySpaces() [1/2]

List< ? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getProbabilitySpaces ( )

Extracts probability spaces from the constraints in the problem.

Returns
a list of hypercubes, or null if some information is missing in the problem file

References getSpaces().

Referenced by frodo2.algorithms.dpop.param.ParamDPOPsolver< V extends Addable< V >, U extends Addable< U > >.getExpectedOptUtil(), getExpectedUtility(), and parse().

Here is the call graph for this function:

◆ getProbabilitySpaces() [2/2]

List< ? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getProbabilitySpaces ( String var)

Extracts probability spaces involving the input variable from the constraints in the problem.

Returns
a list of hypercubes, or null if some information is missing in the problem file
Parameters
varthe variable of interest

References getSpaces().

Here is the call graph for this function:

◆ getRelation()

static< V extends Addable< V > Element frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getRelation ( UtilitySolutionSpace< V, ? extends Addable<?> > hypercube,
String id,
String nature )
static

Generates the XCSP "relation" or "probability" fragment corresponding to the input hypercube.

Parameters
<V>the type used for variable values
hypercubethe hypercube
idid of the relation/probability
natureeither "relation" or "probability"
Returns
the XCSP "relation" or "probability" fragment corresponding to the input hypercube

Referenced by addSolutionSpace(), frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.test.AllTests.generateSizedProblem(), groundVars(), and setDomain().

◆ getScope()

HashSet< String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getScope ( String var)
private

Returns the agent scope of the variable.

Parameters
varthe variable
Returns
the agent scope of the variable

References root.

Referenced by getAgentNeighbors().

◆ getSolutionSpaces() [1/8]

◆ getSolutionSpaces() [2/8]

List< ? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces ( DCOPProblemInterface< V, U > problem,
final boolean withAnonymVars )

Extracts solution spaces from the constraints in the problem.

Parameters
problemthe problem instance that should be notified of contraint checks
withAnonymVarswhether hypercubes involving variables with unknown owners should be taken into account
Returns
a list of hypercubes, or null if some information is missing in the problem file

References getSpaces().

Here is the call graph for this function:

◆ getSolutionSpaces() [3/8]

List< ? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces ( final boolean withAnonymVars)

Extracts solution spaces from the constraints in the problem.

Returns
a list of hypercubes, or null if some information is missing in the problem file
Parameters
withAnonymVarswhether hypercubes involving variables with unknown owners should be taken into account

References getSolutionSpaces().

Here is the call graph for this function:

◆ getSolutionSpaces() [4/8]

List<? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces ( Set< String > vars,
boolean withAnonymVars,
Set< String > forbiddenVars )

Extracts solution spaces involving the input variables from the constraints in the problem.

Returns
a list of hypercubes, or null if some information is missing in the problem file
Parameters
varsthe variables of interest
withAnonymVarswhether hypercubes involving variables with unknown owners should be taken into account
forbiddenVarsany space involving any of these variables will be ignored

References getSpaces().

Here is the call graph for this function:

◆ getSolutionSpaces() [5/8]

List< ? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces ( String var)

Extracts solution spaces involving the input variable from the constraints in the problem.

Returns
a list of hypercubes, or null if some information is missing in the problem file
Parameters
varthe variable of interest
Warning
Ignores hypercubes involving variables whose owner is unknown.

References getSpaces().

Here is the call graph for this function:

◆ getSolutionSpaces() [6/8]

List<? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces ( String var,
boolean withAnonymVars,
Set< String > forbiddenVars )

Extracts solution spaces involving the input variable from the constraints in the problem.

Returns
a list of hypercubes, or null if some information is missing in the problem file
Parameters
varthe variable of interest
withAnonymVarswhether hypercubes involving variables with unknown owners should be taken into account
forbiddenVarsany space involving any of these variables will be ignored

References getSpaces().

Here is the call graph for this function:

◆ getSolutionSpaces() [7/8]

List< ? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces ( String var,
final boolean withAnonymVars )

Extracts solution spaces involving the input variable from the constraints in the problem.

Returns
a list of hypercubes, or null if some information is missing in the problem file
Parameters
varthe variable of interest
withAnonymVarswhether hypercubes involving variables with unknown owners should be taken into account

References getSpaces().

Here is the call graph for this function:

◆ getSolutionSpaces() [8/8]

List<? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces ( String var,
Set< String > forbiddenVars )

Returns the solution spaces involving the input variable and none of the forbidden variables.

Parameters
varthe variable of interest
forbiddenVarsany space involving any of these variables will be ignored
Returns
a list of spaces, or null if some information is missing

References getSpaces().

Here is the call graph for this function:

◆ getSpaces()

List< ? extends UtilitySolutionSpace< V, U > > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getSpaces ( Set< String > vars,
final boolean withAnonymVars,
final boolean getProbs,
Set< String > forbiddenVars,
DCOPProblemInterface< V, U > problem )
protected

Extracts hypercubes from the constraints in the problem.

Author
Radoslaw Szymanek, Thomas Leaute & Brammert Ottens
Returns
a list of hypercubes, or null if some information is missing in the problem file
Parameters
varsif null, returns all constraints; otherwise, returns only the constraints involving at least one of the variables in vars
withAnonymVarswhether hypercubes involving variables with unknown owners should be taken into account
getProbsif true, returns the probability spaces (ignoring withAnonymVars); else, returns the solution spaces
forbiddenVarsany space involving any of these variables will be ignored
problemthe problem instance that should be notified of constraint checks
Todo
The implementation can be improved so as to only parse things that are needed (wrt var).

References getDomain(), getInfeasibleUtil(), getZeroUtility(), parseConstraint(), root, utilClass, and valInstance.

Referenced by getProbabilitySpaces(), getProbabilitySpaces(), getSolutionSpaces(), getSolutionSpaces(), getSolutionSpaces(), getSolutionSpaces(), getSolutionSpaces(), getSolutionSpaces(), and getSolutionSpaces().

Here is the call graph for this function:

◆ getSubProblem()

XCSPparser< V, U > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getSubProblem ( String agent)

Builds the subproblem description for a given agent by extracting it from the overall problem description.

Parameters
agentthe name of the agent
Returns
the subproblem corresponding to agent, or null if agent owns no variable

Reimplemented in frodo2.benchmarks.vehiclerouting.XCSPparserVRP< U extends Addable< U > >, and frodo2.solutionSpaces.JaCoP.JaCoPxcspParser< V extends Addable< V > >.

References domClass, foundUndefinedRelations(), getAgents(), getOwner(), isRandom(), newInstance(), root, setDomClass(), setUtilClass(), utilClass, and XCSPparser().

Referenced by main().

Here is the call graph for this function:

◆ getUtility() [1/2]

UtilitySolutionSpace< V, U > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getUtility ( Map< String, V > assignments)

Computes the total utility of the input assignment to variables, ignoring variables with no specified owner.

This methods actually returns a UtilitySolutionSpace. If not all variables in the problem are assigned a value, the space will represent the utility of the assignment, conditioned on the free variables. If all variables are grounded, the method returns a scalar UtilitySolutionSpace.

Parameters
assignmentsvalues for variables
Returns
the optimal (possibly conditional) utility corresponding to the input assignment

References getUtility().

Referenced by getExpectedUtility(), getUtility(), 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.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(), and frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.testRandom().

Here is the call graph for this function:

◆ getUtility() [2/2]

UtilitySolutionSpace< V, U > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getUtility ( Map< String, V > assignments,
final boolean withAnonymVars )

Computes the total utility of the input assignment to variables.

This methods actually returns a UtilitySolutionSpace. If not all variables in the problem are assigned a value, the space will represent the utility of the assignment, conditioned on the free variables. If all variables are grounded, the method returns a scalar UtilitySolutionSpace.

Parameters
assignmentsvalues for variables
withAnonymVarsif false, ignores variable with no specified owner
Returns
the optimal (possibly conditional) utility corresponding to the input assignment

References getInfeasibleUtil(), getSolutionSpaces(), getZeroUtility(), frodo2.output, and frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.slice().

Here is the call graph for this function:

◆ getVariables() [1/2]

◆ getVariables() [2/2]

Set< String > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getVariables ( String owner)

Returns the set of variables owned by a given agent.

Parameters
ownerthe name of the agent; if null, returns all variables with no specified owner
Returns
a set of variables owned by owner

References root.

◆ getZeroUtility()

◆ groundVars()

Document frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.groundVars ( String[] vars,
V[] values )

Transforms the problem into one where some variables' values have been fixed.

Parameters
varsthe variables whoses values should be fixed
valuesthe values for the variables
Returns
the transformed problem
Warning
Does not work if one of the contraints sees all its variables grounded.
Todo
Test this method.

References getConstraint(), getRelation(), getSolutionSpaces(), root, and frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.slice().

Here is the call graph for this function:

◆ ignore()

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.ignore ( String spaceClass)
protected
Author
Brammert Ottens, 7 feb. 2011
Parameters
spaceClassthe space class for which we want to know whether ncccs should be ignored or not
Returns
true when ncccs should be ignored, and false otherwise

Referenced by parseConstraint().

◆ incrNCCCs()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.incrNCCCs ( long incr)

Increments the number of constraint checks.

Parameters
incrthe increment

◆ isCountingNCCCs()

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.isCountingNCCCs ( )
Returns
whether this parser is counting NCCCs

◆ isRandom()

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.isRandom ( String var)

Returns whether the input variable is defined as a random variable.

Parameters
varthe name of the variable
Returns
true if the input variable is a random variable, false if not or if the variable is unknown

References root.

Referenced by getAgentNeighbors(), getNeighborhoods(), getNeighborVars(), getSubProblem(), frodo2.solutionSpaces.JaCoP.JaCoPxcspParser< V extends Addable< V > >.getSubProblem(), parse(), and setDomain().

◆ main()

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

Parses the input problem.

Parameters
argsthe path to the XCSP file
Exceptions
Exceptionif an error occurs

References getAgents(), getSubProblem(), frodo2.outFile, parse(), root, toDOT(), usage(), and XCSPparser().

Here is the call graph for this function:

◆ maximize()

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.maximize ( )

◆ multipleTypes()

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.multipleTypes ( )
Returns
true when agents can be of different types, and false otherwise

◆ newInstance()

XCSPparser< V, U > frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.newInstance ( Element instance)
protected

◆ parse() [1/7]

◆ parse() [2/7]

Document frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse ( File file) throws JDOMException, IOException
static

Creates a JDOM Document out of the input XML file in XCSP format.

Parameters
filethe XML file
Returns
a JDOM Document resulting from the parsing of the input file
Exceptions
JDOMExceptionif a parsing error occurs while reading the file
IOExceptionif an I/O error occurs while accessing the file
Note
The input file will be checked against the XCSP schema file

Referenced by frodo2.algorithms.AbstractSolver< P extends ProblemInterface< V, U, V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.AbstractSolver(), frodo2.gui.SimpleGUI.actionPerformed(), 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.dpop.count.SolutionCounter< V extends Addable< V >, U extends Addable< U > >.count(), frodo2.solutionSpaces.JaCoP.tests.JaCoPtests< V extends Addable< V > >.JaCoPtests(), frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.main(), frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.main(), main(), frodo2.algorithms.mpc_discsp.tests.MPC_DisWCSP4tests.MPC_DisWCSP4tests(), parse(), parse(), frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.parseProblem(), frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.randomTest(), frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.randomTest(), frodo2.controller.ConfigurationManager.runExperiment(), frodo2.algorithms.adopt.test.ADOPTagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.adopt.test.testADOPT.setUp(), frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.asodpop.tests.ASODPOPagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryAgentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.param.test.ParamDPOPtest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.setUp(), frodo2.algorithms.dpop.restart.test.TestSDPOP< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.stochastic.robust.test.Robust_E_DPOPagentTest< V extends Addable< V > >.setUp(), frodo2.algorithms.dpop.stochastic.test.E_DPOPagentTest< V extends Addable< V > >.setUp(), frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest.setUp(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.setUp(), frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.duct.tests.DUCTagentChildSearchTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentChildTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentPruningSearchTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentPruningTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentTest.setUp(), frodo2.algorithms.localSearch.dsa.tests.DSAagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.localSearch.mgm.tests.MGMagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.odpop.tests.ODPOPagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.odpop.tests.ODPOPagentTestBinaryDomains< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.synchbb.test.SynchBBagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.test.ProblemTest.setUp(), frodo2.algorithms.test.XCSPparserTest.setUp(), frodo2.algorithms.dpop.count.SolutionCounter< V extends Addable< V >, U extends Addable< U > >.SolutionCounter(), frodo2.controller.userIO.DistributedSolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve(), frodo2.gui.SimpleGUI.solveProblem(), frodo2.algorithms.adopt.test.testADOPT.test(), 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.varOrdering.dfs.tests.LocalRandVarsDFStest.test(), frodo2.solutionSpaces.vehiclerouting.test.VRPtests.test(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.testComputeDFS(), 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.testPreprocessing.testRandom(), frodo2.algorithms.asodpop.tests.ASODPOPagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryAgentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.dsa.tests.DSAagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.mgm.tests.MGMagentTest< V extends Addable< V >, U extends Addable< U > >.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(), and frodo2.algorithms.varOrdering.election.tests.VariableElectionTest< S extends Comparable< S > &Serializable >.testRandom().

◆ parse() [3/7]

Document frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse ( File file,
boolean checkXCSP ) throws JDOMException, IOException
static

Creates a JDOM Document out of the input XML file (not necessarily in XCSP format).

Parameters
filethe XML file
checkXCSPif true, checks that the input XCSP file is properly formatted
Returns
a JDOM Document resulting from the parsing of the input file
Exceptions
JDOMExceptionif a parsing error occurs while reading the file
IOExceptionif an I/O error occurs while accessing the file

◆ parse() [4/7]

Document frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse ( InputStream stream) throws JDOMException, IOException
static

Creates a JDOM Document out of the input XML stream in XCSP format.

Parameters
streamthe XML stream
Returns
a JDOM Document resulting from the parsing of the input file
Exceptions
JDOMExceptionif a parsing error occurs while reading the file
IOExceptionif an I/O error occurs while accessing the file
Note
The input stream will be checked against the XCSP schema file

◆ parse() [5/7]

Document frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse ( InputStream stream,
boolean checkXCSP ) throws JDOMException, IOException
static

Creates a JDOM Document out of the input XML stream (not necessarily in XCSP format).

Parameters
streamthe XML stream
checkXCSPif true, checks that the input XCSP file is properly formatted
Returns
a JDOM Document resulting from the parsing of the input file
Exceptions
JDOMExceptionif a parsing error occurs while reading the file
IOExceptionif an I/O error occurs while accessing the file

◆ parse() [6/7]

Document frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse ( String path) throws Exception
static

Creates a JDOM Document out of the input XML file path in XCSP format.

Parameters
paththe XML file path
Returns
a JDOM Document resulting from the parsing of the input file
Exceptions
Exceptionif an error occurs
Note
The input file will be checked against the XCSP schema file

References parse().

Here is the call graph for this function:

◆ parse() [7/7]

Document frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse ( String path,
boolean checkXCSP ) throws Exception
static

Creates a JDOM Document out of the input XML file path (not necessarily in XCSP format).

Parameters
paththe XML file path
checkXCSPif true, checks that the input XCSP file is properly formatted
Returns
a JDOM Document resulting from the parsing of the input file
Exceptions
Exceptionif an error occurs

References parse().

Here is the call graph for this function:

◆ parseConstraint()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parseConstraint ( ArrayList< UtilitySolutionSpace< V, U > > spaces,
Element constraint,
HashMap< String, V[]> variablesHashMap,
HashMap< String, Relation< V, U > > relationInfos,
Set< String > vars,
final boolean getProbs,
final boolean withAnonymVars,
U infeasibleUtil,
Set< String > forbiddenVars,
DCOPProblemInterface< V, U > problem )
protected

Parses a constraint.

Parameters
spacesthe list of spaces to which the constraint should be added
constraintthe XCSP description of the constraint
variablesHashMapthe domain of each variable
relationInfosrelations, indexed by their names
varsif null, returns all constraints; otherwise, returns only the constraints involving at least one of the variables in vars
getProbsif true, returns the probability spaces (ignoring withAnonymVars); else, returns the solution spaces
withAnonymVarswhether constraints involving variables with unknown owners should be taken into account
infeasibleUtilthe infeasible utility
forbiddenVarsany space involving any of these variables will be ignored
problemthe problem instance that should be notified of constraint checks

References frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.Relation< V extends Addable< V >, U extends Addable< U > >.defaultUtil, getOwner(), ignore(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.Relation< V extends Addable< V >, U extends Addable< U > >.tuples, utilClass, and frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.Relation< V extends Addable< V >, U extends Addable< U > >.utilities.

Referenced by getSpaces().

Here is the call graph for this function:

◆ removeSpace()

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.removeSpace ( String name)

Removes the space with the given name.

Parameters
namethe name of the space
Returns
true if the space was present and had been removed

References root.

◆ rescale()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.rescale ( U multiply,
U add )

Rescales the problem.

Parameters
multiplymultiplies all costs/utilities by multiply
addafter multiplying all costs/utilities by multiply (if required), adds add

Reimplemented in frodo2.benchmarks.vehiclerouting.XCSPparserVRP< U extends Addable< U > >.

References root.

◆ reset()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.reset ( ProblemInterface< V, U > newProblem)

Resets this problem to be the same as the input one.

Parameters
newProblemthe problem

References root, utilClass, valInstance, and XCSPparser().

Here is the call graph for this function:

◆ setDomain() [1/2]

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setDomain ( String var,
ArrayList< V > domain,
Map< V, Double > weights )
private

Sets the domain of a variable.

Parameters
varthe variable
domainits new domain
weightsnormalized weights for each value in the new domain (used only if the variable is random)

References getRelation(), isRandom(), root, and toString().

Here is the call graph for this function:

◆ setDomain() [2/2]

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setDomain ( String var,
V[] dom )

Sets the domain of a variable in the problem.

If the input domain has values that appear more than once, it is reduced so as to only contain each value once. If the input variable is a random variable, the input domain is treated as a set of samples, and the probability law for the random variable is re-computed so as to reflect the frequency of each value in the sample set. If the variable is unknown, it adds it to the problem, assuming it is a random variable.

Parameters
varthe name of the variable
domthe domain; if empty, does nothing
Todo
Test the case when the variable is unknown.

References setDomain().

Referenced by setDomain(), and setProbSpace().

Here is the call graph for this function:

◆ setDomClass()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setDomClass ( Class< V > domClass)

Sets the class to be used for variable values.

Parameters
domClassthe class for variable values

References domClass.

Referenced by getSubProblem(), frodo2.algorithms.adopt.test.ADOPTagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.param.test.ParamDPOPtest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.stochastic.robust.test.Robust_E_DPOPagentTest< V extends Addable< V > >.setUp(), frodo2.algorithms.dpop.stochastic.test.E_DPOPagentTest< V extends Addable< V > >.setUp(), frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.duct.tests.DUCTagentChildSearchTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentChildTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentPruningSearchTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentPruningTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentTest.setUp(), frodo2.algorithms.synchbb.test.SynchBBagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.asodpop.tests.ASODPOPagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryAgentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.dsa.tests.DSAagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.mgm.tests.MGMagentTest< V extends Addable< V >, U extends Addable< U > >.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(), and XCSPparser().

◆ setMaximize()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setMaximize ( boolean maximize)

Sets whether utility should be maximized, or cost minimized.

Parameters
maximizetrue iff this should be a maximization problem

References maximize(), and root.

Here is the call graph for this function:

◆ setNCCCs()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setNCCCs ( long ncccs)

Sets the NCCC count.

Parameters
ncccsthe NCCC count

◆ setOwner()

boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setOwner ( String var,
String owner )

Sets the owner agent for the input variable.

Parameters
varthe variable
ownerthe owner
Returns
false if the owner was not changed because the variable does not exist

References getAgents(), and root.

Here is the call graph for this function:

◆ setProbSpace()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setProbSpace ( String var,
Map< V, Double > prob )

Adds to the problem a probability space for the input random variable.

Parameters
varrandom variable
probweighted samples

References setDomain().

Here is the call graph for this function:

◆ setUtilClass()

void frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setUtilClass ( Class< U > utilClass)

Sets the class to be used for utility values.

Parameters
utilClassthe class for utility values

Reimplemented in frodo2.benchmarks.vehiclerouting.XCSPparserVRP< U extends Addable< U > >.

References utilClass.

Referenced by getSubProblem(), frodo2.algorithms.adopt.test.ADOPTagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.param.test.ParamDPOPtest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.stochastic.robust.test.Robust_E_DPOPagentTest< V extends Addable< V > >.setUp(), frodo2.algorithms.dpop.stochastic.test.E_DPOPagentTest< V extends Addable< V > >.setUp(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.setUp(), frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.duct.tests.DUCTagentChildSearchTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentChildTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentPruningSearchTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentPruningTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentTest.setUp(), frodo2.algorithms.duct.tests.NormalizeInfTest.setUp(), frodo2.algorithms.duct.tests.NormalizeTest.setUp(), frodo2.algorithms.odpop.tests.UTILpropagationTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.synchbb.test.SynchBBagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), 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.dpop.test.UTILpropagationTest< U extends Addable< U > >.testComputeDFS(), 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.asodpop.tests.ASODPOPagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryAgentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.dsa.tests.DSAagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.mgm.tests.MGMagentTest< V extends Addable< V >, U extends Addable< U > >.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.algorithms.varOrdering.election.tests.VariableElectionTest< S extends Comparable< S > &Serializable >.testRandom(), and XCSPparser().

◆ switchMaxMin()

Document frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.switchMaxMin ( int shiftInt)

Change the problem from a maximisation problem to a minimisation problem.

Author
Brammert Ottens, 9 sep 2009
Parameters
shiftIntthe amount with which to shift all numbers to ensure all numbers having the same sign
Returns
A Document with the same problem, but now represented as a minimisation problem
Todo
Compute the shift instead of taking it as an argument.

Reimplemented in frodo2.solutionSpaces.JaCoP.JaCoPxcspParser< V extends Addable< V > >.

References maximize(), root, and utilClass.

Referenced by frodo2.benchmarks.auctions.main.CATSToXCSP.toXCSP().

Here is the call graph for this function:

◆ toDOT() [1/3]

String frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.toDOT ( )
Returns
a DOT-formatted representation of the problem

References root, and XCSPparser().

Here is the call graph for this function:

◆ toDOT() [2/3]

String frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.toDOT ( Document doc)
static

Returns the constraint graph in DOT format.

Parameters
docthe XCSP instance document
Returns
a String representation of the constraint graph in DOT format

References toDOT().

Referenced by frodo2.gui.SimpleGUI.actionPerformed(), main(), toDOT(), and XCSPparser().

Here is the call graph for this function:

◆ toDOT() [3/3]

String frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.toDOT ( Element root)
static

Returns the constraint graph in DOT format.

Parameters
rootthe XCSP instance element
Returns
a String representation of the constraint graph in DOT format

References getAgents(), getNbrVars(), getNeighborVars(), getOwner(), getVariables(), root, and XCSPparser().

Here is the call graph for this function:

◆ toString() [1/3]

String frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.toString ( )
See also
java.lang.Object#toString()

References getAgent(), root, and XCSPparser().

Here is the call graph for this function:

◆ toString() [2/3]

String frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.toString ( Document doc)
static

Returns a human-friendly String representation of the input JDOM Document.

Parameters
docthe JDOM Document
Returns
a String representation of the input Document

Referenced by frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.main(), setDomain(), and frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.toString().

◆ toString() [3/3]

String frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.toString ( Element root)
static

Returns a human-friendly String representation of the input JDOM Element.

Parameters
rootthe JDOM Element
Returns
a String representation of the input Element

References root.

◆ usage()

String frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.usage ( )
staticprivate
Returns
a description of the allowed arguments for the main() method

Referenced by main().

Member Data Documentation

◆ countNCCCs

◆ domClass

Class<V> frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.domClass = (Class<V>) AddableInteger.class
private

The class to be used for variable values.

Referenced by getDomClass(), getSubProblem(), parse(), setDomClass(), and XCSPparser().

◆ extendedRandNeighborhoods

final boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.extendedRandNeighborhoods
protected

If true, neighborhood relationships between decision variables are extended through random variables.

In other words, for a given decision variable x, its neighborhood consists of:

  • the decision variables that share constraints with x (as usual),
  • the decision variables that are direct neighbors of any random variable that can be reached from x by a path that involves only random variables.

Referenced by frodo2.solutionSpaces.JaCoP.JaCoPxcspParser< V extends Addable< V > >.getSubProblem(), frodo2.solutionSpaces.JaCoP.JaCoPxcspParser< V extends Addable< V > >.parse(), XCSPparser(), XCSPparser(), XCSPparser(), XCSPparser(), XCSPparser(), and frodo2.benchmarks.vehiclerouting.XCSPparserVRP< U extends Addable< U > >.XCSPparserVRP().

◆ mpc

final boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.mpc
protected

Whether to behave in MPC mode.

In MPC mode:

  • each agent knows the identities of all agents;
  • all variables are known to all agents.

Referenced by XCSPparser(), and frodo2.benchmarks.vehiclerouting.XCSPparserVRP< U extends Addable< U > >.XCSPparserVRP().

◆ ncccCount

long frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.ncccCount
private

The NCCC count.

◆ publicAgents

final boolean frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.publicAgents
protected

◆ root

◆ spacesToIgnoreNcccs

HashSet<String> frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.spacesToIgnoreNcccs
protected

◆ utilClass

◆ valInstance

V frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.valInstance = (V) new AddableInteger ()
protected

An instance of V.

Referenced by getDomain(), getSpaces(), and reset().


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