|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
Test suite for XCSPparser. More...

Public Member Functions | |
| XCSPparserTest (String name) | |
| Generates a test using the specified method. | |
| XCSPparserTest (String name, boolean maximize) | |
| Generates a test using the specified method. | |
| XCSPparserTest (String name, boolean extendedRandNeighborhoods, boolean publicAgents) | |
| Generates a test using the specified method. | |
| void | testGetZeroUtility () |
| Test method for getZeroUtility(). | |
| void | testGetPlusInfUtility () |
| Test method for getPlusInfUtility(). | |
| void | testGetMinInfUtility () |
| Test method for getMinInfUtility(). | |
| void | testGetAgents () |
| Test method for XCSPparser.getAgents(). | |
| void | testGetOwner () |
| Test method for XCSPparser.getOwner(java.lang.String). | |
| void | testGetOwners () |
| Test method for XCSPparser.getOwners(). | |
| void | testGetNbrVars () |
| Test method for XCSPparser.getNbrVars(). | |
| void | testGetNbrVarsString () |
| Test method for XCSPparser.getNbrVars(java.lang.String). | |
| void | testGetVariables () |
| Test method for XCSPparser.getVariables(). | |
| void | testGetVariablesString () |
| Test method for XCSPparser.getVariables(java.lang.String). | |
| void | testGetExtVars () |
| Test method for XCSPparser.getExtVars(). | |
| void | testGetNeighborVars () |
| Test method for XCSPparser.getNeighborVars(java.lang.String). | |
| void | testGetNeighborVarsWithAnonymVars () |
| Test method for XCSPparser.getNeighborVars(java.lang.String, boolean). | |
| void | testGetNeighborVars (boolean withAnonymVars) |
| Test for getNeighborVars. | |
| void | testGetNbrNeighbors () |
| Test method for XCSPparser.getNbrNeighbors(java.lang.String). | |
| void | testGetNeighborhoods () |
| Test method for XCSPparser.getNeighborhoods(java.lang.String). | |
| void | testGetAnonymNeighborhoods () |
| Test method for XCSPparser.getAnonymNeighborhoods(java.lang.String). | |
| void | testGetNeighborhoodSizes () |
| Test method for XCSPparser.getNeighborhoodSizes(java.lang.String). | |
| void | testGetAgentNeighborhoods () |
| Test method for XCSPparser.getAgentNeighborhoods(java.lang.String). | |
| void | testGetDomainSize () |
| Test method for XCSPparser.getDomainSize(java.lang.String). | |
| void | testGetDomain () throws JDOMException |
| Test method for frodo2.algorithms.XCSPparser.getDomain(java.lang.String). | |
| void | testSetDomain () |
| Tests the setDomain() method. | |
| void | testGetSubProblem () |
| Test method for XCSPparser.getSubProblem(String). | |
| void | testIsRandom () throws JDOMException |
| Test method for frodo2.algorithms.XCSPparser.isRandom(java.lang.String). | |
| void | testGetSolutionSpacesWithRandVars () |
| Test method for getSolutionSpaces() with random variables. | |
| void | testGetSolutionSpaces () |
| Test method for getSolutionSpaces() ignoring random variables. | |
| void | testGetProbabilitySpaces () |
| Test method for getProbabilitySpaces(). | |
| void | testGetSolutionSpacesForVarWithRandVars () |
| Test method for getSolutionSpaces(String) with random variables. | |
| void | testGetSolutionSpacesForVar () |
| Test method for getSolutionSpaces(String) ignoring random variables. | |
| void | testGetProbabilitySpacesForVar () |
| Test method for getProbabilitySpaces(String). | |
| void | testGetUtility () |
| Test for the method getUtility() on complete assignments. | |
| void | testMaximize () |
| Test for the method maximize(). | |
Static Public Member Functions | |
| static TestSuite | suite () |
Protected Member Functions | |
| void | setUp () |
| void | tearDown () throws Exception |
| Map< String, ? extends Collection< String > > | getNeighborhoods (final boolean withAnonymVars) |
| Computes the correct neighborhoods. | |
| void | testGetSolutionSpaces (DCOPProblemInterface< AddableInteger, AddableReal > problem, List< ? extends UtilitySolutionSpace< AddableInteger, AddableReal > > refSpaces, String var, final boolean withRandVars) |
| Test method for getSolutionSpaces(String, boolean). | |
Protected Attributes | |
| RandGraphFactory.Graph | graph |
| Random graph used to generate a constraint graph. | |
| Document | probDoc |
| Random XCSP problem. | |
| XCSPparser< AddableInteger, AddableReal > | parser |
| The parser. | |
| DCOPProblemInterface< AddableInteger, AddableReal > | prob |
| The parsed problem instance. | |
| ArrayList< Hypercube< AddableInteger, AddableReal > > | solutionSpaces = new ArrayList< Hypercube<AddableInteger, AddableReal> > () |
| The list of solution spaces in the problem. | |
| ArrayList< Hypercube< AddableInteger, AddableReal > > | probSpaces = new ArrayList< Hypercube<AddableInteger, AddableReal> > () |
| The list of probability spaces in the problem. | |
Private Member Functions | |
| HashSet< String > | getExtendedRandNeighbors (String var) |
| Builds the set of all random variables reachable from var by paths involving only random variables. | |
| void | testGetNeighborhoods (final boolean onlyAnonymVars) |
| Test for XCSPparser.getNeighborhoods(java.lang.String) and XCSPparser.getAnonymNeighborhoods(java.lang.String). | |
| void | testGetSolutionSpacesForVar (final boolean withRandVars) |
| Test method for getSolutionSpaces(String, boolean). | |
Private Attributes | |
| final boolean | maximize |
| Whether to test on maximization problems. | |
| final int | maxNbrVars = 15 |
| Maximum number of variables in the random graph. | |
| final int | maxNbrEdges = 100 |
| Maximum number of edges in the random graph. | |
| final int | maxNbrAgents = 5 |
| Maximum number of agents. | |
| boolean | extendedRandNeighborhoods |
| Whether we want extended random neighborhoods. | |
| boolean | publicAgents = false |
| Whether each agent knows the identities of all agents. | |
Test suite for XCSPparser.
| frodo2.algorithms.test.XCSPparserTest.XCSPparserTest | ( | String | name | ) |
Generates a test using the specified method.
| name | name of the method |
Referenced by suite().
| frodo2.algorithms.test.XCSPparserTest.XCSPparserTest | ( | String | name, |
| boolean | maximize ) |
Generates a test using the specified method.
| name | name of the method |
| maximize | whether to test on maximization problems |
References maximize.
| frodo2.algorithms.test.XCSPparserTest.XCSPparserTest | ( | String | name, |
| boolean | extendedRandNeighborhoods, | ||
| boolean | publicAgents ) |
Generates a test using the specified method.
| name | name of the method |
| extendedRandNeighborhoods | whether we want extended random neighborhoods |
| publicAgents | Whether each agent knows the identities of all agents |
References extendedRandNeighborhoods, and publicAgents.
|
private |
Builds the set of all random variables reachable from var by paths involving only random variables.
| var | the input variable |
References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.isRandom().
Referenced by getNeighborhoods(), and testGetSubProblem().

|
protected |
Computes the correct neighborhoods.
| withAnonymVars | whether to consider anonymous neighbors |
References getExtendedRandNeighbors(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), and frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.isRandom().
Referenced by testGetAgentNeighborhoods(), testGetNbrNeighbors(), testGetNeighborhoods(), testGetNeighborhoodSizes(), and testGetNeighborVars().

|
protected |
References frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.RandGraphFactory.getRandGraph(), graph, maxNbrAgents, maxNbrEdges, maxNbrVars, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), parser, probDoc, probSpaces, and solutionSpaces.

|
static |
References suite(), and XCSPparserTest().
Referenced by frodo2.algorithms.test.AllTests.suite(), and suite().

|
protected |
| void frodo2.algorithms.test.XCSPparserTest.testGetAgentNeighborhoods | ( | ) |
Test method for XCSPparser.getAgentNeighborhoods(java.lang.String).
References getNeighborhoods(), graph, frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.isRandom(), and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetAgents | ( | ) |
Test method for XCSPparser.getAgents().
| void frodo2.algorithms.test.XCSPparserTest.testGetAnonymNeighborhoods | ( | ) |
Test method for XCSPparser.getAnonymNeighborhoods(java.lang.String).
References testGetNeighborhoods().

| void frodo2.algorithms.test.XCSPparserTest.testGetDomain | ( | ) | throws JDOMException |
Test method for frodo2.algorithms.XCSPparser.getDomain(java.lang.String).
| JDOMException | if an error occurs while reading the problem description |
References frodo2.solutionSpaces.AddableInteger.fromString(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getDomain(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), graph, prob, and probDoc.

| void frodo2.algorithms.test.XCSPparserTest.testGetDomainSize | ( | ) |
Test method for XCSPparser.getDomainSize(java.lang.String).
References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getDomain(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getDomainSize(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetExtVars | ( | ) |
Test method for XCSPparser.getExtVars().
References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getExtVars(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getOwners(), graph, and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetMinInfUtility | ( | ) |
Test method for getMinInfUtility().
References frodo2.solutionSpaces.AddableReal.add(), frodo2.solutionSpaces.AddableReal.equals(), and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetNbrNeighbors | ( | ) |
Test method for XCSPparser.getNbrNeighbors(java.lang.String).
References getNeighborhoods(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.isRandom(), and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetNbrVars | ( | ) |
Test method for XCSPparser.getNbrVars().
| void frodo2.algorithms.test.XCSPparserTest.testGetNbrVarsString | ( | ) |
Test method for XCSPparser.getNbrVars(java.lang.String).
| void frodo2.algorithms.test.XCSPparserTest.testGetNeighborhoods | ( | ) |
Test method for XCSPparser.getNeighborhoods(java.lang.String).
References testGetNeighborhoods().
Referenced by testGetAnonymNeighborhoods(), and testGetNeighborhoods().

|
private |
Test for XCSPparser.getNeighborhoods(java.lang.String) and XCSPparser.getAnonymNeighborhoods(java.lang.String).
| onlyAnonymVars | whether we are only interested in random neighbors |
References getNeighborhoods(), graph, frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.isRandom(), and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetNeighborhoodSizes | ( | ) |
Test method for XCSPparser.getNeighborhoodSizes(java.lang.String).
References getNeighborhoods(), graph, frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.isRandom(), and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetNeighborVars | ( | ) |
Test method for XCSPparser.getNeighborVars(java.lang.String).
References testGetNeighborVars().
Referenced by testGetNeighborVars(), and testGetNeighborVarsWithAnonymVars().

| void frodo2.algorithms.test.XCSPparserTest.testGetNeighborVars | ( | boolean | withAnonymVars | ) |
Test for getNeighborVars.
| withAnonymVars | if false, ignores variables with no specified owner |
References getNeighborhoods(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.isRandom(), and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetNeighborVarsWithAnonymVars | ( | ) |
Test method for XCSPparser.getNeighborVars(java.lang.String, boolean).
References testGetNeighborVars().

| void frodo2.algorithms.test.XCSPparserTest.testGetOwner | ( | ) |
Test method for XCSPparser.getOwner(java.lang.String).
| void frodo2.algorithms.test.XCSPparserTest.testGetOwners | ( | ) |
Test method for XCSPparser.getOwners().
References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getOwners(), graph, and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetPlusInfUtility | ( | ) |
Test method for getPlusInfUtility().
References frodo2.solutionSpaces.AddableReal.add(), frodo2.solutionSpaces.AddableReal.equals(), and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetProbabilitySpaces | ( | ) |
Test method for getProbabilitySpaces().
References prob, and probSpaces.
| void frodo2.algorithms.test.XCSPparserTest.testGetProbabilitySpacesForVar | ( | ) |
Test method for getProbabilitySpaces(String).
References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getProbabilitySpaces(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), graph, and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetSolutionSpaces | ( | ) |
Test method for getSolutionSpaces() ignoring random variables.
References frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.iterator(), frodo2.java, prob, and testGetSolutionSpaces().
Referenced by testGetSolutionSpaces(), testGetSolutionSpacesForVar(), and testGetSolutionSpacesWithRandVars().

|
protected |
Test method for getSolutionSpaces(String, boolean).
| problem | the problem |
| refSpaces | the reference spaces |
| var | the variable |
| withRandVars | if true, also considers random variables |

| void frodo2.algorithms.test.XCSPparserTest.testGetSolutionSpacesForVar | ( | ) |
Test method for getSolutionSpaces(String) ignoring random variables.
References frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.iterator(), frodo2.java, prob, and testGetSolutionSpacesForVar().
Referenced by testGetSolutionSpacesForVar(), and testGetSolutionSpacesForVarWithRandVars().

|
private |
Test method for getSolutionSpaces(String, boolean).
| withRandVars | if true, considers random variables |
Test with default cost
Test with and without forbidden vars
References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), graph, prob, and testGetSolutionSpaces().

| void frodo2.algorithms.test.XCSPparserTest.testGetSolutionSpacesForVarWithRandVars | ( | ) |
Test method for getSolutionSpaces(String) with random variables.
References testGetSolutionSpacesForVar().

| void frodo2.algorithms.test.XCSPparserTest.testGetSolutionSpacesWithRandVars | ( | ) |
Test method for getSolutionSpaces() with random variables.
References testGetSolutionSpaces().

| void frodo2.algorithms.test.XCSPparserTest.testGetSubProblem | ( | ) |
Test method for XCSPparser.getSubProblem(String).
References frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgents(), getExtendedRandNeighbors(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getProbabilitySpaces(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces(), graph, and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetUtility | ( | ) |
Test for the method getUtility() on complete assignments.
References frodo2.solutionSpaces.AddableReal.add(), graph, and prob.

| void frodo2.algorithms.test.XCSPparserTest.testGetVariables | ( | ) |
Test method for XCSPparser.getVariables().
| void frodo2.algorithms.test.XCSPparserTest.testGetVariablesString | ( | ) |
Test method for XCSPparser.getVariables(java.lang.String).
| void frodo2.algorithms.test.XCSPparserTest.testGetZeroUtility | ( | ) |
Test method for getZeroUtility().
References frodo2.solutionSpaces.AddableReal.add(), frodo2.solutionSpaces.AddableReal.equals(), and prob.

| void frodo2.algorithms.test.XCSPparserTest.testIsRandom | ( | ) | throws JDOMException |
Test method for frodo2.algorithms.XCSPparser.isRandom(java.lang.String).
| JDOMException | if an error occurred when reading the problem description |
| void frodo2.algorithms.test.XCSPparserTest.testMaximize | ( | ) |
Test for the method maximize().
References frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getAgents(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSubProblem(), and frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.maximize().

| void frodo2.algorithms.test.XCSPparserTest.testSetDomain | ( | ) |
Tests the setDomain() method.
References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getProbabilitySpaces(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.isRandom(), frodo2.solutionSpaces.AddableReal.multiply(), and frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.setDomain().

|
private |
Whether we want extended random neighborhoods.
Referenced by XCSPparserTest().
|
protected |
Random graph used to generate a constraint graph.
Referenced by setUp(), tearDown(), testGetAgentNeighborhoods(), testGetAgents(), testGetDomain(), testGetExtVars(), testGetNbrVars(), testGetNbrVarsString(), testGetNeighborhoods(), testGetNeighborhoodSizes(), testGetOwner(), testGetOwners(), testGetProbabilitySpacesForVar(), testGetSolutionSpacesForVar(), testGetSubProblem(), testGetUtility(), testGetVariables(), and testGetVariablesString().
|
private |
Whether to test on maximization problems.
Referenced by XCSPparserTest().
|
private |
Maximum number of agents.
Referenced by setUp().
|
private |
Maximum number of edges in the random graph.
Referenced by setUp().
|
private |
|
protected |
The parser.
Referenced by setUp(), and tearDown().
|
protected |
The parsed problem instance.
Referenced by testGetAgentNeighborhoods(), testGetAgents(), testGetDomain(), testGetDomainSize(), testGetExtVars(), testGetMinInfUtility(), testGetNbrNeighbors(), testGetNbrVars(), testGetNbrVarsString(), testGetNeighborhoods(), testGetNeighborhoodSizes(), testGetNeighborVars(), testGetOwner(), testGetOwners(), testGetPlusInfUtility(), testGetProbabilitySpaces(), testGetProbabilitySpacesForVar(), testGetSolutionSpaces(), testGetSolutionSpacesForVar(), testGetSolutionSpacesForVar(), testGetSubProblem(), testGetUtility(), testGetVariables(), testGetVariablesString(), testGetZeroUtility(), and testIsRandom().
|
protected |
Random XCSP problem.
Referenced by setUp(), tearDown(), testGetDomain(), and testIsRandom().
|
protected |
The list of probability spaces in the problem.
Referenced by setUp(), and testGetProbabilitySpaces().
|
private |
Whether each agent knows the identities of all agents.
Referenced by XCSPparserTest().
|
protected |
The list of solution spaces in the problem.
Referenced by setUp().