FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.solutionSpaces.JaCoP.Predicate Class Reference

Predicate wrapper that translates a predicate expression from XCSP into constraints available in JaCoP. More...

Inheritance diagram for frodo2.solutionSpaces.JaCoP.Predicate:

Public Member Functions

 Predicate (String constraintParameters, String predicateParameters, String description, StoreCloneable store)
 It creates/imposes constraints into the store as soon as the Predicate constraint is being imposed.
String toString ()
ArrayList< Constraint > decompose (Store store) throws FailException
PrimitiveConstraint getConstraint (StoreCloneable store) throws FailException
 It allows to obtain the constraint specified by the predicate without imposing it.
void imposeDecomposition (Store store) throws FailException
ArrayList< Var > auxiliaryVariables ()
List< IntVarCloneablearguments ()
Predicate cloneInto (StoreCloneable targetStore) throws CloneNotSupportedException
String id ()

Package Attributes

String constraintParameters
 The XCSP parameters of the constraint.
final boolean debug = false
 Whether to print out debug information.
String description
 The functional representation of the predicate.
StoreCloneable store
 The constraint store.
String predicateParameters
 The XCSP parameters of the predicate.
ArrayList< Constraint > decompositionConstraints
 The auxiliary constraints created.
ArrayList< Var > auxilaryVariables
 The auxiliary variables created.
IntVarCloneable valuationVar
 The utility variable (if this is a soft constraint).

Private Member Functions

Object parse (String token, StringTokenizer tokenizer, StoreCloneable store, HashMap< String, Object > variableMaping) throws FailException

Static Private Member Functions

static IntVarCloneable getIntVarCloneable (StoreCloneable store, String name, String name2, int minVal, int maxVal) throws FailException
 Looks up or creates a variable in the input store.
static IntVarCloneable getIntVarCloneable (StoreCloneable store, String name, String name2, IntDomain dom) throws FailException
 Looks up or creates a variable in the input store.

Detailed Description

Predicate wrapper that translates a predicate expression from XCSP into constraints available in JaCoP.

It accepts only functional representation. Possibly, some auxiliary variables will be created.

Author
Radoslaw Szymanek and Krzysztof Kuchcinski for the initial version developed for JaCoP 2.4;
Arnaud Jutzeler and Thomas Leaute for the modified version ported to FRODO and JaCoP 3.

Constructor & Destructor Documentation

◆ Predicate()

frodo2.solutionSpaces.JaCoP.Predicate.Predicate ( String constraintParameters,
String predicateParameters,
String description,
StoreCloneable store )

It creates/imposes constraints into the store as soon as the Predicate constraint is being imposed.

Parameters
constraintParametersparameters to the constraint.
predicateParametersparameters specified within a predicate definition.
descriptiondescription of the constraint specified as the predicate.
storethe constraint store in which context the constraints are being created/imposed.

References constraintParameters, decompose(), description, predicateParameters, and store.

Referenced by cloneInto().

Here is the call graph for this function:

Member Function Documentation

◆ arguments()

◆ auxiliaryVariables()

ArrayList< Var > frodo2.solutionSpaces.JaCoP.Predicate.auxiliaryVariables ( )
See also
org.jacop.constraints.DecomposedConstraint#auxiliaryVariables()

References auxilaryVariables.

◆ cloneInto()

Predicate frodo2.solutionSpaces.JaCoP.Predicate.cloneInto ( StoreCloneable targetStore) throws CloneNotSupportedException

◆ decompose()

ArrayList< Constraint > frodo2.solutionSpaces.JaCoP.Predicate.decompose ( Store store) throws FailException
See also
org.jacop.constraints.DecomposedConstraint#decompose(org.jacop.core.Store)

References auxilaryVariables, constraintParameters, debug, decompositionConstraints, description, getIntVarCloneable(), parse(), predicateParameters, and store.

Referenced by imposeDecomposition(), and Predicate().

Here is the call graph for this function:

◆ getConstraint()

PrimitiveConstraint frodo2.solutionSpaces.JaCoP.Predicate.getConstraint ( StoreCloneable store) throws FailException

It allows to obtain the constraint specified by the predicate without imposing it.

Parameters
storethe constraint store in which context the constraint is being created.
Returns
the constraint represented by this predicate constraint (expression).
Exceptions
FailExceptionthrown if a variable with an empty domain was encountered
Bug
Can't the token also be an IntVar or an Integer?...

References constraintParameters, debug, description, parse(), predicateParameters, and store.

Here is the call graph for this function:

◆ getIntVarCloneable() [1/2]

IntVarCloneable frodo2.solutionSpaces.JaCoP.Predicate.getIntVarCloneable ( StoreCloneable store,
String name,
String name2,
int minVal,
int maxVal ) throws FailException
staticprivate

Looks up or creates a variable in the input store.

Parameters
storethe store
namethe name of the variable
name2another, synonymous name for the variable (if any)
minValminimum variable value
maxValmaximum variable value
Returns
the variable
Exceptions
FailExceptionif the resulting variable domain is empty

References getIntVarCloneable(), and store.

Referenced by decompose(), getIntVarCloneable(), and parse().

Here is the call graph for this function:

◆ getIntVarCloneable() [2/2]

IntVarCloneable frodo2.solutionSpaces.JaCoP.Predicate.getIntVarCloneable ( StoreCloneable store,
String name,
String name2,
IntDomain dom ) throws FailException
staticprivate

Looks up or creates a variable in the input store.

Parameters
storethe store
namethe name of the variable
name2another, synonymous name for the variable (if any)
domthe variable domain
Returns
the variable
Exceptions
FailExceptionif the resulting variable domain is empty

References store.

◆ id()

String frodo2.solutionSpaces.JaCoP.Predicate.id ( )

◆ imposeDecomposition()

void frodo2.solutionSpaces.JaCoP.Predicate.imposeDecomposition ( Store store) throws FailException
See also
org.jacop.constraints.DecomposedConstraint#imposeDecomposition(org.jacop.core.Store)

References auxilaryVariables, decompose(), decompositionConstraints, and store.

Here is the call graph for this function:

◆ parse()

Object frodo2.solutionSpaces.JaCoP.Predicate.parse ( String token,
StringTokenizer tokenizer,
StoreCloneable store,
HashMap< String, Object > variableMaping ) throws FailException
private
Parameters
tokenthe current token
tokenizerthe tokenizer
storethe constraint store
variableMapinga mapping from name to variable or constant
Returns
a constraint
Exceptions
FailExceptionthrown if one of the encountered variables has an empty domain

References auxilaryVariables, decompositionConstraints, getIntVarCloneable(), parse(), and store.

Referenced by decompose(), getConstraint(), and parse().

Here is the call graph for this function:

◆ toString()

String frodo2.solutionSpaces.JaCoP.Predicate.toString ( )
See also
java.lang.Object#toString()

Member Data Documentation

◆ auxilaryVariables

ArrayList<Var> frodo2.solutionSpaces.JaCoP.Predicate.auxilaryVariables
package

The auxiliary variables created.

Referenced by auxiliaryVariables(), decompose(), imposeDecomposition(), and parse().

◆ constraintParameters

String frodo2.solutionSpaces.JaCoP.Predicate.constraintParameters
package

The XCSP parameters of the constraint.

Referenced by decompose(), getConstraint(), and Predicate().

◆ debug

final boolean frodo2.solutionSpaces.JaCoP.Predicate.debug = false
package

Whether to print out debug information.

Referenced by decompose(), and getConstraint().

◆ decompositionConstraints

ArrayList<Constraint> frodo2.solutionSpaces.JaCoP.Predicate.decompositionConstraints
package

The auxiliary constraints created.

Referenced by decompose(), imposeDecomposition(), and parse().

◆ description

String frodo2.solutionSpaces.JaCoP.Predicate.description
package

The functional representation of the predicate.

Referenced by decompose(), getConstraint(), and Predicate().

◆ predicateParameters

String frodo2.solutionSpaces.JaCoP.Predicate.predicateParameters
package

The XCSP parameters of the predicate.

Referenced by decompose(), getConstraint(), and Predicate().

◆ store

StoreCloneable frodo2.solutionSpaces.JaCoP.Predicate.store
package

◆ valuationVar

IntVarCloneable frodo2.solutionSpaces.JaCoP.Predicate.valuationVar
package

The utility variable (if this is a soft constraint).

Referenced by arguments(), and frodo2.solutionSpaces.JaCoP.JaCoPxcspParser< V extends Addable< V > >.parsePredicate().


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