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

A MASproblem parser that is able to handle multiple types of agents. More...

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

Public Member Functions

 MASparser (Element root)
 Constructor from a JDOM root Element.
 MASparser (Element root, boolean countNCCCs)
 Constructor from a JDOM root Element.
 MASparser (String agentName, String type, Element root, boolean countNCCCs, HashSet< String > spacesToIgnoreNcccs)
 Constructor from a JDOM root Element.
 MASparser (String agentName, String type, Element root, boolean countNCCCs)
 Constructor from a JDOM root Element.
 MASparser (Document doc)
 Constructor from a JDOM Document.
 MASparser (Document doc, Element params)
 Constructor.
String getType ()
String getAgent ()
Set< String > getAgents ()
getZeroUtility ()
getPlusInfUtility ()
getMinInfUtility ()
Element getLocalProblem ()
MASparser< V, U > getSubProblem (String agent)
boolean multipleTypes ()
void reset (ProblemInterface< V, U > newProblem)
void setDomClass (Class< V > domClass)
Class< V > getDomClass ()
void setUtilClass (Class< U > utilClass)
Class< U > getUtilClass ()
utilInstance ()
void incrNCCCs (long incr)
void setNCCCs (long ncccs)
long getNCCCs ()
String toString ()
MASparser< V, U > parse ()
Public Member Functions inherited from frodo2.solutionSpaces.ProblemInterface< V, U >
void reset (ProblemInterface< V, U > newProblem)
 Resets this problem to be the same as the input one.
void setDomClass (Class< V > domClass)
 Sets the class to be used for variable values.
Class< V > getDomClass ()
void setUtilClass (Class< U > utilClass)
 Sets the class to be used for utility values.
Class< U > getUtilClass ()
getZeroUtility ()
getPlusInfUtility ()
getMinInfUtility ()
String getAgent ()
Set< String > getAgents ()
ProblemInterface< V, U > getSubProblem (String agent)
 Builds the subproblem description for a given agent by extracting it from the overall problem description.
boolean multipleTypes ()
void incrNCCCs (long incr)
 Increments the number of constraint checks.
long getNCCCs ()
void setNCCCs (long ncccs)
 Sets the NCCC count.
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.
static Document parse (String path) throws JDOMException, IOException
 Creates a JDOM Document out of the input XML file path in XCSP format.
static Document parse (InputStream stream) throws JDOMException, IOException
 Creates a JDOM Document out of the input XML stream in XCSP format.

Protected Attributes

Element root
 the JDOM root element
String type
 the type of the agent owning this problem
Class< V > domClass = (Class<V>) AddableInteger.class
 The class to be used for variable values.
Class< U > utilClass = (Class<U>) AddableInteger.class
 The class to be used for utility values.
final boolean countNCCCs
 Whether to count constraint checks.
HashSet< String > spacesToIgnoreNcccs
 a set of spaces for which ncccs should be ignored

Private Attributes

String agentName
 the name of the agent owning the problem, if applicable
long ncccCount
 The NCCC count.

Static Private Attributes

static final long serialVersionUID = 5407324017599034300L
 Used for serialization.

Detailed Description

A MASproblem parser that is able to handle multiple types of agents.

Author
Brammert Ottens, 8 jun 2010
Parameters
<U>the type used for decision values
<V>the type used for utility values

Constructor & Destructor Documentation

◆ MASparser() [1/6]

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

Constructor from a JDOM root Element.

Parameters
rootthe JDOM root Element

References root.

Referenced by getSubProblem(), and parse().

◆ MASparser() [2/6]

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

Constructor from a JDOM root Element.

Parameters
rootthe JDOM root Element
countNCCCstrue when NCCCs should be counted

References countNCCCs, and root.

◆ MASparser() [3/6]

frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.MASparser ( String agentName,
String type,
Element root,
boolean countNCCCs,
HashSet< String > spacesToIgnoreNcccs )

Constructor from a JDOM root Element.

Parameters
agentNamethe name of the agent owning the input subproblem
typethe type of the agent
rootthe JDOM root Element
countNCCCstrue when NCCCs should be counted
spacesToIgnoreNcccsthe list of spaces who's NCCCs should not be counted

References agentName, countNCCCs, root, spacesToIgnoreNcccs, and type.

◆ MASparser() [4/6]

frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.MASparser ( String agentName,
String type,
Element root,
boolean countNCCCs )

Constructor from a JDOM root Element.

Parameters
agentNamethe name of the agent owning the input subproblem
typethe type of the agent
rootthe JDOM root Element
countNCCCstrue when NCCCs should be counted

References agentName, countNCCCs, root, and type.

◆ MASparser() [5/6]

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

Constructor from a JDOM Document.

Parameters
docthe JDOM Document

◆ MASparser() [6/6]

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

Constructor.

Parameters
docthe JDOM Document
paramsthe parameters of the parser

References setUtilClass(), and spacesToIgnoreNcccs.

Here is the call graph for this function:

Member Function Documentation

◆ getAgent()

◆ getAgents()

Set< String > frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.getAgents ( )

◆ getDomClass()

Class< V > frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.getDomClass ( )

◆ getLocalProblem()

Element frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.getLocalProblem ( )
Author
Brammert Ottens, 10 jun 2010
Returns
the local problem of the agent
Warning
should only be called by agents!

Implements frodo2.solutionSpaces.MASProblemInterface< V extends Addable< V >, U extends Addable< U > >.

References root.

◆ getMinInfUtility()

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

◆ getNCCCs()

long frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.getNCCCs ( )

◆ getPlusInfUtility()

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

◆ getSubProblem()

MASparser< V, U > frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.getSubProblem ( String agent)
See also
frodo2.solutionSpaces.ProblemInterface.getSubProblem(java.lang.String)

References countNCCCs, MASparser(), root, and spacesToIgnoreNcccs.

Referenced by frodo2.algorithms.test.MASparserTest.testGetSubProblemString().

Here is the call graph for this function:

◆ getType()

◆ getUtilClass()

Class< U > frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.getUtilClass ( )

◆ getZeroUtility()

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

◆ incrNCCCs()

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

◆ multipleTypes()

boolean frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.multipleTypes ( )

◆ parse() [1/4]

MASparser< V, U > frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.parse ( )
See also
ParserInterface.parse()

References MASparser().

Here is the call graph for this function:

◆ parse() [2/4]

Document frodo2.algorithms.MASparser< 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.

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
Author
Thomas Leaute

Referenced by parse(), and frodo2.algorithms.test.MASparserTest.testParseString().

◆ parse() [3/4]

Document frodo2.algorithms.MASparser< 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
Author
Thomas Leaute

◆ parse() [4/4]

Document frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.parse ( String path) throws JDOMException, IOException
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
JDOMExceptionif a parsing error occurs while reading the file
IOExceptionif an I/O error occurs while accessing the file

References parse().

Here is the call graph for this function:

◆ reset()

◆ setDomClass()

void frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.setDomClass ( Class< V > domClass)
See also
ProblemInterface.setDomClass(java.lang.Class)

References domClass.

◆ setNCCCs()

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

◆ setUtilClass()

void frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.setUtilClass ( Class< U > utilClass)
See also
frodo2.solutionSpaces.ProblemInterface.setUtilClass(java.lang.Class)

References utilClass.

Referenced by MASparser().

◆ toString()

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

References agentName, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.toString(), and type.

Here is the call graph for this function:

◆ utilInstance()

Member Data Documentation

◆ agentName

String frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.agentName
private

the name of the agent owning the problem, if applicable

Referenced by getAgent(), MASparser(), MASparser(), and toString().

◆ countNCCCs

final boolean frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.countNCCCs
protected

Whether to count constraint checks.

Referenced by getSubProblem(), incrNCCCs(), MASparser(), MASparser(), MASparser(), and setNCCCs().

◆ domClass

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

The class to be used for variable values.

Referenced by getDomClass(), and setDomClass().

◆ ncccCount

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

The NCCC count.

Referenced by getNCCCs().

◆ root

Element frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.root
protected

◆ serialVersionUID

final long frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.serialVersionUID = 5407324017599034300L
staticprivate

Used for serialization.

◆ spacesToIgnoreNcccs

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

a set of spaces for which ncccs should be ignored

Referenced by getSubProblem(), MASparser(), and MASparser().

◆ type

String frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.type
protected

the type of the agent owning this problem

Referenced by getType(), MASparser(), MASparser(), and toString().

◆ utilClass

Class<U> frodo2.algorithms.MASparser< V extends Addable< V >, U extends Addable< U > >.utilClass = (Class<U>) AddableInteger.class
protected

The class to be used for utility values.

Referenced by getMinInfUtility(), getPlusInfUtility(), getUtilClass(), getZeroUtility(), setUtilClass(), and utilInstance().


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