choco.kernel.model
Interface Model

All Superinterfaces:
IPretty, Serializable
All Known Subinterfaces:
Model2
All Known Implementing Classes:
ASAPCPModel, CarSeqModel, CPModel, CPModel2, NSPModel, Picross, RackConfig, RackConfig2, RuleModel, SimpleSchedule

public interface Model
extends IPretty, Serializable


Method Summary
 void addConstraint(Constraint... c)
          Deprecated.  
 void addConstraint(Constraint c)
          Add one constraint to the model.
 void addConstraint(String options, Constraint... c)
          Deprecated.  
 void addConstraint(String options, Constraint c)
          Add one constraint to the model.
 void addConstraints(Constraint... c)
          Add one or more constraint to the model.
 void addConstraints(String options, Constraint... c)
          Add one or more constraint to the model.
 void addOptions(String options, IOptions... element)
           
 void addVariable(String options, Variable... v)
          Deprecated.  
 void addVariable(String options, Variable v)
          Add one variable with options to the model
 void addVariable(Variable... v)
          Deprecated.  
 void addVariable(Variable v)
          Add a variable to the model
 void addVariables(String options, Variable... v)
          Add one or more variables to the model with particular options
 void addVariables(Variable... v)
          Add one or more variables to the model
 String constraintsToString()
          Create and return a string representation of the constraints of the Model
 boolean contains(Constraint c)
           
 IntegerConstantVariable getConstantVar(int i)
          Returns a constant variable.
 Constraint getConstraint(int i)
          Network management: Retrieve a constraint by its index.
 Iterator<Constraint> getConstraintByType(ConstraintType t)
          Return an iterator over constraint of a certain type
 Iterator<Constraint> getConstraintIterator()
          Return an iterator over the constraints of the model
 Iterator<Variable> getConstVarIterator()
          Retrieves an iterator over constantes variables of the model
 Boolean getDefaultExpressionDecomposition()
          Return the default expression decomposition
 Iterator<Constraint> getIntConstraintIterator()
          Deprecated.  
 IntegerVariable getIntVar(int i)
          Network management: Retrieve a variable by its index (all integer variables of the model are numbered in sequence from 0 on)
 int getIntVarIndex(IntDomainVar c)
          Deprecated.  
 int getIntVarIndex(IntVar c)
          Deprecated.  
 Iterator<IntegerVariable> getIntVarIterator()
          Retrieves an iterator over IntegerVariables of the model
 Iterator<MultipleVariables> getMultipleVarIterator()
          Retrieves an iterator over MultipleVariables of the model (if stored)
 int getNbConstantVars()
          Returns the number of variables modelling constant.
 int getNbConstraintByType(ConstraintType t)
          Return the number of constraint of a certain type
 int getNbConstraints()
          retrieving the total number of constraints over integers
 int getNbIntVars()
          retrieving the total number of variables
 int getNbRealVars()
          Returns the number of variables modelling real numbers.
 int getNbSetVars()
          Returns the number of variables modelling real numbers.
 int getNbStoredMultipleVars()
          Returns the number of stored multiple variables.
 int getNbTotVars()
          Return the total numbers of variables of the model
 RealVariable getRealVar(int i)
          Returns a real variable.
 Iterator<RealVariable> getRealVarIterator()
          Retrieves an iterator over RealVariables of the model
 SetVariable getSetVar(int i)
          Returns a set variable.
 Iterator<SetVariable> getSetVarIterator()
          Retrieves an iterator over SetVariables of the model
 MultipleVariables getStoredMultipleVar(int i)
          Returns a multiple variable.
 void removeConstraint(Constraint c)
          Remove a constraint from the model.
 void removeVariable(Variable... v)
          Deprecated.  
 void removeVariable(Variable v)
          Remove one variable from the model (also remove constraints linked to the variable)
 void removeVariables(Variable... v)
          Remove one or more variables from the model (also remove constraints linked to the variables)
 void setDefaultExpressionDecomposition(Boolean decomposedExp)
          Set the default expression decomposition (BEWARE : it only concerns expression without particular decomposition option) If decomposedExp is set to false: Every expression is then used to check a tuple in a dynamic way just like a nary relation that is defined without listing all the possible tuples.
 String solutionToString()
          Return a string representation of a solution. !!
 String varsToString()
          Create and return a string representation of the variables of the Model
 
Methods inherited from interface choco.IPretty
pretty
 

Method Detail

getIntVarIndex

@Deprecated
int getIntVarIndex(IntDomainVar c)
Deprecated. 

Retrieves the index of an IntDomainVar

Parameters:
c - Solver variable
Returns:
the indexe of the solver variable in the model.

getNbConstraints

int getNbConstraints()
retrieving the total number of constraints over integers

Returns:
the total number of constraints over integers in the model

getConstraint

Constraint getConstraint(int i)
Network management: Retrieve a constraint by its index.

Parameters:
i - index of the constraint in the model
Returns:
Constraint

getIntConstraintIterator

Iterator<Constraint> getIntConstraintIterator()
Deprecated. 

Return an iterator over the integer constraints of the model

Returns:
an iterator over the integer constraints of the model
See Also:
getConstraintIterator()

getConstraintIterator

Iterator<Constraint> getConstraintIterator()
Return an iterator over the constraints of the model

Returns:
an iterator over the constraints of the model

getConstraintByType

Iterator<Constraint> getConstraintByType(ConstraintType t)
Return an iterator over constraint of a certain type

Parameters:
t - type
Returns:
iterator over constraint of type t

getNbConstraintByType

int getNbConstraintByType(ConstraintType t)
Return the number of constraint of a certain type

Parameters:
t - the type of constraint
Returns:
a integer

varsToString

String varsToString()
Create and return a string representation of the variables of the Model

Returns:
a string print of variables of the model

constraintsToString

String constraintsToString()
Create and return a string representation of the constraints of the Model

Returns:
a string print of the constraints of the Model

solutionToString

String solutionToString()
Return a string representation of a solution. !! Beware, not really correct!! Use Solver API instead

Returns:
a string represenstation of the variables of the model
See Also:
IPretty.pretty()

getIntVar

IntegerVariable getIntVar(int i)
Network management: Retrieve a variable by its index (all integer variables of the model are numbered in sequence from 0 on)

Parameters:
i - index of the variable in the model
Returns:
IntegerVariable

getIntVarIndex

@Deprecated
int getIntVarIndex(IntVar c)
Deprecated. 

Return the index of the intVar in the model

Parameters:
c - the int var
Returns:
the index

getNbIntVars

int getNbIntVars()
retrieving the total number of variables

Returns:
the total number of variables in the model

getRealVar

RealVariable getRealVar(int i)
Returns a real variable.

Parameters:
i - index of the variable
Returns:
the i-th real variable

getNbRealVars

int getNbRealVars()
Returns the number of variables modelling real numbers.

Returns:
int

getConstantVar

IntegerConstantVariable getConstantVar(int i)
Returns a constant variable.

Parameters:
i - index of the variable
Returns:
the i-th real variable

getNbConstantVars

int getNbConstantVars()
Returns the number of variables modelling constant.

Returns:
int

getSetVar

SetVariable getSetVar(int i)
Returns a set variable.

Parameters:
i - index of the variable
Returns:
the i-th real variable

getNbSetVars

int getNbSetVars()
Returns the number of variables modelling real numbers.

Returns:
int

getStoredMultipleVar

MultipleVariables getStoredMultipleVar(int i)
Returns a multiple variable.

Parameters:
i - index of the variable
Returns:
the i-th stored multiple variable

getNbStoredMultipleVars

int getNbStoredMultipleVars()
Returns the number of stored multiple variables.

Returns:
int

getNbTotVars

int getNbTotVars()
Return the total numbers of variables of the model

Returns:
total number of variables of the model

addOptions

void addOptions(String options,
                IOptions... element)

addVariable

void addVariable(Variable v)
Add a variable to the model

Parameters:
v - a variable

addVariable

void addVariable(String options,
                 Variable v)
Add one variable with options to the model

Parameters:
options - define options of the variables
v - one or more variables

addVariable

@Deprecated
void addVariable(Variable... v)
Deprecated. 

Add one or more variables to the model

Parameters:
v - one or more variables
See Also:
addVariables(choco.kernel.model.variables.Variable[])

addVariable

@Deprecated
void addVariable(String options,
                            Variable... v)
Deprecated. 

Add one or more variables to the model with particular options

Parameters:
options - defines options of the variables
v - one or more variables
See Also:
addVariables(String, choco.kernel.model.variables.Variable[])

addVariables

void addVariables(Variable... v)
Add one or more variables to the model

Parameters:
v - one or more variables

addVariables

void addVariables(String options,
                  Variable... v)
Add one or more variables to the model with particular options

Parameters:
options - defines options of the variables
v - one or more variables

removeVariable

@Deprecated
void removeVariable(Variable... v)
Deprecated. 

Remove one or more variables from the model (also remove constraints linked to the variables)

Parameters:
v - variables to remove
See Also:
removeVariables(choco.kernel.model.variables.Variable[])

removeVariable

void removeVariable(Variable v)
Remove one variable from the model (also remove constraints linked to the variable)

Parameters:
v - the variable to remove

removeVariables

void removeVariables(Variable... v)
Remove one or more variables from the model (also remove constraints linked to the variables)

Parameters:
v - variables to remove

addConstraint

@Deprecated
void addConstraint(Constraint... c)
Deprecated. 

Add one or more constraint to the model. Also add variables to the model if necessary.

Parameters:
c - one or more constraint
See Also:
addConstraints(choco.kernel.model.constraints.Constraint[])

addConstraint

void addConstraint(Constraint c)
Add one constraint to the model. Also add variables to the model if necessary.

Parameters:
c - one constraint

addConstraints

void addConstraints(Constraint... c)
Add one or more constraint to the model. Also add variables to the model if necessary.

Parameters:
c - one or more constraint

addConstraint

@Deprecated
void addConstraint(String options,
                              Constraint... c)
Deprecated. 

Add one or more constraint to the model. Also add variables to the model if necessary.

Parameters:
options - defines options of the constraint
c - one or more constraint
See Also:
addConstraints(choco.kernel.model.constraints.Constraint[])

addConstraint

void addConstraint(String options,
                   Constraint c)
Add one constraint to the model. Also add variables to the model if necessary.

Parameters:
options - defines options of the constraint
c - one constraint

addConstraints

void addConstraints(String options,
                    Constraint... c)
Add one or more constraint to the model. Also add variables to the model if necessary.

Parameters:
options - defines options of the constraint
c - one or more constraint

removeConstraint

void removeConstraint(Constraint c)
Remove a constraint from the model. (Also remove variable if not even linked to existant constraints).

Parameters:
c - the constraint to remove

getIntVarIterator

Iterator<IntegerVariable> getIntVarIterator()
Retrieves an iterator over IntegerVariables of the model

Returns:
an iterator over IntegerVariables of the model

getRealVarIterator

Iterator<RealVariable> getRealVarIterator()
Retrieves an iterator over RealVariables of the model

Returns:
an iterator over RealVariables of the model

getSetVarIterator

Iterator<SetVariable> getSetVarIterator()
Retrieves an iterator over SetVariables of the model

Returns:
an iterator over SetVariables of the model

getConstVarIterator

Iterator<Variable> getConstVarIterator()
Retrieves an iterator over constantes variables of the model

Returns:
an iterator over constantes variables of the model

getMultipleVarIterator

Iterator<MultipleVariables> getMultipleVarIterator()
Retrieves an iterator over MultipleVariables of the model (if stored)

Returns:
an iterator over IntegerVariables of the model

getDefaultExpressionDecomposition

Boolean getDefaultExpressionDecomposition()
Return the default expression decomposition

Returns:
the default expression decomposition

setDefaultExpressionDecomposition

void setDefaultExpressionDecomposition(Boolean decomposedExp)
Set the default expression decomposition (BEWARE : it only concerns expression without particular decomposition option) If decomposedExp is set to false: Every expression is then used to check a tuple in a dynamic way just like a nary relation that is defined without listing all the possible tuples. The expression is then propagated using the GAC3rm algorithm. This is very powerful as arc-consistency is obtained on the corresponding constraints. If decomposedExp is set to true, every expression will be decomposed automatically by introducing intermediate variables and eventually the generic reifiedIntConstraint if reified operators are present in the expression. By doing so, the level of pruning will decrease but expressions of larger arity involving large domains can be represented.

Parameters:
decomposedExp - the new default expression decomposition

contains

boolean contains(Constraint c)


Copyright © 2012. All Rights Reserved.