Constructor and Description |
---|
DefaultSettings() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkDeclaredConstraints() |
boolean |
checkModel(Solver solver) |
boolean |
cloneVariableArrayInPropagator() |
boolean |
debugPropagation()
Deprecated.
|
String |
defaultPrefix()
Define the prefix of internally created variables (through a call to
IVariableFactory.generateName() |
boolean |
enableACOnTernarySum() |
boolean |
enableDecompositionOfBooleanSum() |
byte |
enableHybridizationOfPropagationEngine() |
boolean |
enableIncrementalityOnBoolSum(int nbvars) |
boolean |
enableSAT() |
boolean |
enableTableSubstitution() |
boolean |
enableViews() |
ICondition |
getEnvironmentHistorySimulationCondition() |
int |
getMaxDomSizeForEnumerated() |
int |
getMaxTupleSizeForSubstitution() |
double |
getMCRDecimalPrecision() |
int |
getMinCardForSumDecomposition() |
String |
getWelcomeMessage() |
Solver |
initSolver(Model model)
This method is called in
Model.Model(IEnvironment, String, Settings) to create the
solver to associate with a model. |
AbstractStrategy |
makeDefaultSearch(Model model)
Creates a default search strategy for the input model
|
DefaultSettings |
setCheckDeclaredConstraints(boolean checkDeclaredConstraints)
Indicate if the declared constraints are either posted or reified.
|
DefaultSettings |
setCloneVariableArrayInPropagator(boolean cloneVariableArrayInPropagator)
If this setting is set to true (default value), a clone of the input variable array is made in any propagator constructors.
|
DefaultSettings |
setDebugPropagation(boolean debugPropagation)
When this setting returns
true , a complete trace of the events is output. |
DefaultSettings |
setDefaultPrefix(String defaultPrefix)
Define prefix of internally created variables
|
DefaultSettings |
setDefaultSearch(Function<Model,AbstractStrategy> defaultSearch)
Define a default search strategy for the input model
|
Settings |
setEnableACOnTernarySum(boolean enable)
If this is set to true then AC algorithm is used to filter ternary sum by default,
otherwise, BC is used.
|
DefaultSettings |
setEnableDecompositionOfBooleanSum(boolean enableDecompositionOfBooleanSum)
Define if boolean sums should be decomposed into an equality constraint + arithmetic constraint
|
DefaultSettings |
setEnableIncrementalityOnBoolSum(IntPredicate enableIncrementalityOnBoolSum)
Define the predicate to choose incremental sum, based on number variables declared
|
DefaultSettings |
setEnableSAT(boolean enableSAT)
Indicate if clauses are managed by a unique SAT solver.
|
DefaultSettings |
setEnableTableSubstitution(boolean enableTableSubstitution)
Define whether some intension constraints are replaced by extension constraints
|
DefaultSettings |
setEnableViews(boolean enableViews)
Set to 'true' to allow the creation of views in the
Model . |
DefaultSettings |
setEnvironmentHistorySimulationCondition(ICondition environmentHistorySimulationCondition)
Set the condition to satisfy when rebuilding history of backtrackable objects is needed.
|
Settings |
setHybridizationOfPropagationEngine(byte hybrid)
Define behavior of the propagation engine.
|
DefaultSettings |
setInitSolver(Function<Model,Solver> initSolver)
Define the solver initialization
|
DefaultSettings |
setMaxDomSizeForEnumerated(int maxDomSizeForEnumerated)
Define the minimum number of cardinality threshold to a sum/scalar constraint to be decomposed in intermediate
sub-sums.
|
DefaultSettings |
setMaxTupleSizeForSubstitution(int maxTupleSizeForSubstitution)
Define the maximum domain size threshold to replace intension constraints by extension constraints
Only checked when
Settings.enableTableSubstitution() returns true |
Settings |
setMCRDecimalPrecision(double precision)
Defines the default smallest used double for
IIntConstraintFactory.multiCostRegular(IntVar[], IntVar[], ICostAutomaton) algorithm |
Settings |
setMinCardinalityForSumDecomposition(int defaultMinCardinalityForSumDecomposition)
Define the default minimum number of cardinality threshold to a sum/scalar constraint to be
decomposed into intermediate sub-sums.
|
DefaultSettings |
setModelChecker(Predicate<Solver> modelChecker)
Define what to do when a solution is found.
|
DefaultSettings |
setSortPropagatorActivationWRTPriority(boolean sortPropagatorActivationWRTPriority)
Set whether propagators are sorted wrt their priority in
org.chocosolver.solver.propagation.PropagationTrigger when
dealing with propagator activation. |
DefaultSettings |
setSwapOnPassivate(boolean swapOnPassivate)
Define if passivation of propagator swap it in variables' list
|
DefaultSettings |
setWarnUser(boolean warnUser)
To be informed of warnings detected during modeling/solving
|
DefaultSettings |
setWelcomeMessage(String welcomeMessage)
Define the welcome message, printed in the console
|
boolean |
sortPropagatorActivationWRTPriority() |
boolean |
swapOnPassivate() |
boolean |
warnUser() |
public String getWelcomeMessage()
getWelcomeMessage
in interface Settings
public DefaultSettings setWelcomeMessage(String welcomeMessage)
Settings
setWelcomeMessage
in interface Settings
welcomeMessage
- a messagepublic boolean checkModel(Solver solver)
checkModel
in interface Settings
solver
- the solverpublic DefaultSettings setModelChecker(Predicate<Solver> modelChecker)
Settings
return !ESat.FALSE.equals(solver.isSatisfied());
A hard check of the model can be done like this:
return ESat.TRUE.equals(solver.isSatisfied());
setModelChecker
in interface Settings
modelChecker
- a predicate to check the solutionpublic boolean enableViews()
enableViews
in interface Settings
public DefaultSettings setEnableViews(boolean enableViews)
Settings
Model
.
Creates new variables with channeling constraints otherwise.setEnableViews
in interface Settings
enableViews
- true
to enable viewspublic int getMaxDomSizeForEnumerated()
getMaxDomSizeForEnumerated
in interface Settings
public DefaultSettings setMaxDomSizeForEnumerated(int maxDomSizeForEnumerated)
Settings
setMaxDomSizeForEnumerated
in interface Settings
maxDomSizeForEnumerated
- cardinality thresholdpublic int getMinCardForSumDecomposition()
getMinCardForSumDecomposition
in interface Settings
public Settings setMinCardinalityForSumDecomposition(int defaultMinCardinalityForSumDecomposition)
Settings
setMinCardinalityForSumDecomposition
in interface Settings
defaultMinCardinalityForSumDecomposition
- cardinality thresholdpublic boolean enableTableSubstitution()
enableTableSubstitution
in interface Settings
public DefaultSettings setEnableTableSubstitution(boolean enableTableSubstitution)
Settings
setEnableTableSubstitution
in interface Settings
enableTableSubstitution
- enable table substitutionpublic int getMaxTupleSizeForSubstitution()
getMaxTupleSizeForSubstitution
in interface Settings
public double getMCRDecimalPrecision()
getMCRDecimalPrecision
in interface Settings
IIntConstraintFactory.multiCostRegular(IntVar[], IntVar[], ICostAutomaton)
algorithmpublic Settings setMCRDecimalPrecision(double precision)
Settings
IIntConstraintFactory.multiCostRegular(IntVar[], IntVar[], ICostAutomaton)
algorithmsetMCRDecimalPrecision
in interface Settings
precision
- default precision for MCRpublic DefaultSettings setMaxTupleSizeForSubstitution(int maxTupleSizeForSubstitution)
Settings
Settings.enableTableSubstitution()
returns true
setMaxTupleSizeForSubstitution
in interface Settings
maxTupleSizeForSubstitution
- threshold to substitute intension constraint by table one.public boolean sortPropagatorActivationWRTPriority()
sortPropagatorActivationWRTPriority
in interface Settings
true
if propagators are sorted wrt their priority on initial activation.public DefaultSettings setSortPropagatorActivationWRTPriority(boolean sortPropagatorActivationWRTPriority)
Settings
org.chocosolver.solver.propagation.PropagationTrigger
when
dealing with propagator activation.setSortPropagatorActivationWRTPriority
in interface Settings
sortPropagatorActivationWRTPriority
- true
to allow sorting static propagators.public AbstractStrategy makeDefaultSearch(Model model)
Settings
makeDefaultSearch
in interface Settings
model
- a model requiring a default search strategySearch.defaultSearch(Model)
public DefaultSettings setDefaultSearch(Function<Model,AbstractStrategy> defaultSearch)
Settings
setDefaultSearch
in interface Settings
defaultSearch
- what default search strategy should bepublic ICondition getEnvironmentHistorySimulationCondition()
getEnvironmentHistorySimulationCondition
in interface Settings
public DefaultSettings setEnvironmentHistorySimulationCondition(ICondition environmentHistorySimulationCondition)
Settings
ICondition.FALSE
if no backtrackable object is created during the search.setEnvironmentHistorySimulationCondition
in interface Settings
environmentHistorySimulationCondition
- the condition to satisfy when rebuilding history of backtrackable objects is needed.public boolean warnUser()
public DefaultSettings setWarnUser(boolean warnUser)
Settings
setWarnUser
in interface Settings
warnUser
- true
to be print warnings on console@Deprecated public boolean debugPropagation()
debugPropagation
in interface Settings
public DefaultSettings setDebugPropagation(boolean debugPropagation)
Settings
true
, a complete trace of the events is output.
This can be quite big, though, and it slows down the overall process.
Note that this parameter is read once at propagation engine creation and set in a final variable.setDebugPropagation
in interface Settings
debugPropagation
- true
to output a complete trace of the propagated events.public boolean enableDecompositionOfBooleanSum()
enableDecompositionOfBooleanSum
in interface Settings
true
if boolean sum should be decomposed into an equality constraint and an arithmetic constraint,
false
if a single constraint should be used instead.public DefaultSettings setEnableDecompositionOfBooleanSum(boolean enableDecompositionOfBooleanSum)
Settings
setEnableDecompositionOfBooleanSum
in interface Settings
enableDecompositionOfBooleanSum
- true
to enable decompositionpublic boolean enableIncrementalityOnBoolSum(int nbvars)
enableIncrementalityOnBoolSum
in interface Settings
nbvars
- number of variables in the constrainttrue
if the incrementality is enabled on boolean sum, based on the number of variables involved.public DefaultSettings setEnableIncrementalityOnBoolSum(IntPredicate enableIncrementalityOnBoolSum)
Settings
setEnableIncrementalityOnBoolSum
in interface Settings
enableIncrementalityOnBoolSum
- predicate to pick declare sumpublic boolean cloneVariableArrayInPropagator()
cloneVariableArrayInPropagator
in interface Settings
public DefaultSettings setCloneVariableArrayInPropagator(boolean cloneVariableArrayInPropagator)
Settings
setCloneVariableArrayInPropagator
in interface Settings
cloneVariableArrayInPropagator
- true
to clone variables array on constructorpublic boolean enableACOnTernarySum()
enableACOnTernarySum
in interface Settings
public Settings setEnableACOnTernarySum(boolean enable)
Settings
setEnableACOnTernarySum
in interface Settings
enable
- true
to enable AC by defaultpublic String defaultPrefix()
Settings
IVariableFactory.generateName()
defaultPrefix
in interface Settings
public DefaultSettings setDefaultPrefix(String defaultPrefix)
Settings
setDefaultPrefix
in interface Settings
defaultPrefix
- prefix of internally created variables' namepublic boolean enableSAT()
enableSAT
in interface Settings
ISatFactory
,
false when clauses are managed with CSP constraints only.public DefaultSettings setEnableSAT(boolean enableSAT)
Settings
setEnableSAT
in interface Settings
enableSAT
- true
to rely on SAT Solver to handle clausespublic boolean swapOnPassivate()
swapOnPassivate
in interface Settings
public DefaultSettings setSwapOnPassivate(boolean swapOnPassivate)
Settings
setSwapOnPassivate
in interface Settings
swapOnPassivate
- true
to enable swappingpublic boolean checkDeclaredConstraints()
checkDeclaredConstraints
in interface Settings
public DefaultSettings setCheckDeclaredConstraints(boolean checkDeclaredConstraints)
Settings
setCheckDeclaredConstraints
in interface Settings
checkDeclaredConstraints
- true
to check constraints before resolutionpublic Solver initSolver(Model model)
Settings
Model.Model(IEnvironment, String, Settings)
to create the
solver to associate with a model.initSolver
in interface Settings
model
- a model to initialize with a solverpublic DefaultSettings setInitSolver(Function<Model,Solver> initSolver)
Settings
setInitSolver
in interface Settings
initSolver
- function to initialize the solverpublic byte enableHybridizationOfPropagationEngine()
enableHybridizationOfPropagationEngine
in interface Settings
public Settings setHybridizationOfPropagationEngine(byte hybrid)
Settings
setHybridizationOfPropagationEngine
in interface Settings
hybrid
- When set to '0b00', this works as a constraint-oriented propagation engine;
when set to '0b01', this workds as an hybridization between variable and constraint oriented
propagation engine.
when set to '0b10', this workds as a variable- oriented propagation engine.Copyright © 2018. All rights reserved.