public interface Settings
Model
.
Created by cprudhom on 25/11/14. Project: choco.
Modifier and Type | Method and Description |
---|---|
boolean |
checkDeclaredConstraints() |
boolean |
checkModel(Solver solver) |
boolean |
cloneVariableArrayInPropagator() |
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() |
boolean |
explainGlobalFailureInSum() |
Settings |
explainGlobalFailureInSum(boolean b)
Set to true to allow additional clauses to be learned from sum's global failure
|
ICondition |
getEnvironmentHistorySimulationCondition() |
int |
getLearntClausesDominancePerimeter()
When a clause is learnt from a conflict, it may happen that it dominates previously learnt ones.
|
int |
getMaxDomSizeForEnumerated() |
int |
getMaxLearntClauseCardinality() |
int |
getMaxTupleSizeForSubstitution() |
double |
getMCRDecimalPrecision() |
int |
getMinCardForSumDecomposition() |
int |
getNbMaxLearntClauses() |
float |
getRatioForClauseStoreReduction()
when clauses store need to be reduced, 'ratio' of them are kept (between 0.1 and .99)
|
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. |
default Settings |
load(InputStream inStream)
Load some settings from a property file.
|
default Settings |
load(Properties properties)
Load some settings from a property file.
|
AbstractStrategy |
makeDefaultSearch(Model model)
Creates a default search strategy for the input model
|
Settings |
setCheckDeclaredConstraints(boolean checkDeclaredConstraints)
Indicate if the declared constraints are either posted or reified.
|
Settings |
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.
|
Settings |
setDefaultPrefix(String defaultPrefix)
Define prefix of internally created variables
|
Settings |
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.
|
Settings |
setEnableDecompositionOfBooleanSum(boolean enableDecompositionOfBooleanSum)
Define if boolean sums should be decomposed into an equality constraint + arithmetic constraint
|
Settings |
setEnableIncrementalityOnBoolSum(IntPredicate enableIncrementalityOnBoolSum)
Define the predicate to choose incremental sum, based on number variables declared
|
Settings |
setEnableSAT(boolean enableSAT)
Indicate if clauses are managed by a unique SAT solver.
|
Settings |
setEnableTableSubstitution(boolean enableTableSubstitution)
Define whether some intension constraints are replaced by extension constraints
|
Settings |
setEnableViews(boolean enableViews)
Set to 'true' to allow the creation of views in the
Model . |
Settings |
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.
|
Settings |
setInitSolver(Function<Model,Solver> initSolver)
Define the solver initialization
|
Settings |
setLearntClausesDominancePerimeter(int n)
When a clause is learnt from a conflict, it may happen that it dominates previously learnt ones.
|
Settings |
setMaxDomSizeForEnumerated(int maxDomSizeForEnumerated)
Define the minimum number of cardinality threshold to a sum/scalar constraint to be decomposed in intermediate
sub-sums.
|
Settings |
setMaxLearntClauseCardinality(int n)
Set the maximum learnt clause cardinality, clauses beyond this value are ignored.
|
Settings |
setMaxTupleSizeForSubstitution(int maxTupleSizeForSubstitution)
Define the maximum domain size threshold to replace intension constraints by extension constraints
Only checked when
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.
|
Settings |
setModelChecker(Predicate<Solver> modelChecker)
Define what to do when a solution is found.
|
Settings |
setNbMaxLearntClauses(int n)
Set the maximum of number of learnt clauses to store before running a reduction of the store.
|
Settings |
setRatioForClauseStoreReduction(float f)
when clauses store need to be reduced, 'ratio' of them are kept (between 0.1 and .99).
|
Settings |
setSortPropagatorActivationWRTPriority(boolean sortPropagatorActivationWRTPriority)
Set whether propagators are sorted wrt their priority in
PropagationEngine when
dealing with propagator activation. |
Settings |
setSwapOnPassivate(boolean swapOnPassivate)
Define if passivation of propagator swap it in variables' list
|
Settings |
setWarnUser(boolean warnUser)
To be informed of warnings detected during modeling/solving
|
Settings |
setWelcomeMessage(String welcomeMessage)
Define the welcome message, printed in the console
|
boolean |
sortPropagatorActivationWRTPriority() |
default Properties |
store()
Store some settings into a property file.
|
default void |
store(OutputStream out,
String comments)
Store some settings into a property file.
|
boolean |
swapOnPassivate() |
boolean |
warnUser() |
default Settings load(Properties properties)
properties
- a property file to load setting from.default Settings load(InputStream inStream) throws IOException
inStream
- the input stream.IOException
- if an error occurred when reading from the
input stream.IllegalArgumentException
- if the input stream contains a
malformed Unicode escape sequence.default Properties store()
IOException
- if writing this property list to the specified
output stream throws an IOException.default void store(OutputStream out, String comments) throws IOException
out
- an output stream.comments
- a description of the property list.IOException
- if writing this property list to the specified
output stream throws an IOException.String getWelcomeMessage()
Settings setWelcomeMessage(String welcomeMessage)
welcomeMessage
- a messageboolean checkModel(Solver solver)
solver
- the solverSettings setModelChecker(Predicate<Solver> modelChecker)
return !ESat.FALSE.equals(solver.isSatisfied());
A hard check of the model can be done like this:
return ESat.TRUE.equals(solver.isSatisfied());
modelChecker
- a predicate to check the solutionboolean enableViews()
Settings setEnableViews(boolean enableViews)
Model
.
Creates new variables with channeling constraints otherwise.enableViews
- true
to enable viewsint getMaxDomSizeForEnumerated()
Settings setMaxDomSizeForEnumerated(int maxDomSizeForEnumerated)
maxDomSizeForEnumerated
- cardinality thresholdint getMinCardForSumDecomposition()
Settings setMinCardinalityForSumDecomposition(int defaultMinCardinalityForSumDecomposition)
defaultMinCardinalityForSumDecomposition
- cardinality thresholdboolean enableTableSubstitution()
Settings setEnableTableSubstitution(boolean enableTableSubstitution)
enableTableSubstitution
- enable table substitutionint getMaxTupleSizeForSubstitution()
double getMCRDecimalPrecision()
IIntConstraintFactory.multiCostRegular(IntVar[], IntVar[], ICostAutomaton)
algorithmSettings setMCRDecimalPrecision(double precision)
IIntConstraintFactory.multiCostRegular(IntVar[], IntVar[], ICostAutomaton)
algorithmprecision
- default precision for MCRSettings setMaxTupleSizeForSubstitution(int maxTupleSizeForSubstitution)
enableTableSubstitution()
returns true
maxTupleSizeForSubstitution
- threshold to substitute intension constraint by table one.boolean sortPropagatorActivationWRTPriority()
true
if propagators are sorted wrt their priority on initial activation.Settings setSortPropagatorActivationWRTPriority(boolean sortPropagatorActivationWRTPriority)
PropagationEngine
when
dealing with propagator activation.sortPropagatorActivationWRTPriority
- true
to allow sorting static propagators.AbstractStrategy makeDefaultSearch(Model model)
model
- a model requiring a default search strategySearch.defaultSearch(Model)
Settings setDefaultSearch(Function<Model,AbstractStrategy> defaultSearch)
defaultSearch
- what default search strategy should beICondition getEnvironmentHistorySimulationCondition()
Settings setEnvironmentHistorySimulationCondition(ICondition environmentHistorySimulationCondition)
ICondition.FALSE
if no backtrackable object is created during the search.environmentHistorySimulationCondition
- the condition to satisfy when rebuilding history of backtrackable objects is needed.boolean warnUser()
Settings setWarnUser(boolean warnUser)
warnUser
- true
to be print warnings on consoleboolean enableDecompositionOfBooleanSum()
true
if boolean sum should be decomposed into an equality constraint and an arithmetic constraint,
false
if a single constraint should be used instead.Settings setEnableDecompositionOfBooleanSum(boolean enableDecompositionOfBooleanSum)
enableDecompositionOfBooleanSum
- true
to enable decompositionboolean enableIncrementalityOnBoolSum(int nbvars)
nbvars
- number of variables in the constrainttrue
if the incrementality is enabled on boolean sum, based on the number of variables involved.Settings setEnableIncrementalityOnBoolSum(IntPredicate enableIncrementalityOnBoolSum)
enableIncrementalityOnBoolSum
- predicate to pick declare sumboolean cloneVariableArrayInPropagator()
Settings setCloneVariableArrayInPropagator(boolean cloneVariableArrayInPropagator)
cloneVariableArrayInPropagator
- true
to clone variables array on constructorboolean enableACOnTernarySum()
Settings setEnableACOnTernarySum(boolean enable)
enable
- true
to enable AC by defaultString defaultPrefix()
IVariableFactory.generateName()
Settings setDefaultPrefix(String defaultPrefix)
defaultPrefix
- prefix of internally created variables' nameboolean enableSAT()
ISatFactory
,
false when clauses are managed with CSP constraints only.Settings setEnableSAT(boolean enableSAT)
enableSAT
- true
to rely on SAT Solver to handle clausesboolean swapOnPassivate()
Settings setSwapOnPassivate(boolean swapOnPassivate)
swapOnPassivate
- true
to enable swappingboolean checkDeclaredConstraints()
Settings setCheckDeclaredConstraints(boolean checkDeclaredConstraints)
checkDeclaredConstraints
- true
to check constraints before resolutionSolver initSolver(Model model)
Model.Model(IEnvironment, String, Settings)
to create the
solver to associate with a model.model
- a model to initialize with a solverSettings setInitSolver(Function<Model,Solver> initSolver)
initSolver
- function to initialize the solverbyte enableHybridizationOfPropagationEngine()
Settings setHybridizationOfPropagationEngine(byte hybrid)
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.int getNbMaxLearntClauses()
setNbMaxLearntClauses(int)
,
setRatioForClauseStoreReduction(float)
,
getRatioForClauseStoreReduction()
,
setMaxLearntClauseCardinality(int)
,
getMaxLearntClauseCardinality()
Settings setNbMaxLearntClauses(int n)
n
- maximum number of learnt clauses before reducing the store.getNbMaxLearntClauses()
,
setRatioForClauseStoreReduction(float)
,
getRatioForClauseStoreReduction()
,
setMaxLearntClauseCardinality(int)
,
getMaxLearntClauseCardinality()
float getRatioForClauseStoreReduction()
Settings setRatioForClauseStoreReduction(float f)
f
- ratio for clause store reductiongetRatioForClauseStoreReduction()
,
setNbMaxLearntClauses(int)
,
getNbMaxLearntClauses()
,
setMaxLearntClauseCardinality(int)
,
getMaxLearntClauseCardinality()
int getMaxLearntClauseCardinality()
setMaxLearntClauseCardinality(int)
,
setNbMaxLearntClauses(int)
,
setRatioForClauseStoreReduction(float)
,
getRatioForClauseStoreReduction()
,
setRatioForClauseStoreReduction(float)
Settings setMaxLearntClauseCardinality(int n)
n
- maximum learnt clause cardinality.getMaxLearntClauseCardinality()
,
getNbMaxLearntClauses()
,
setRatioForClauseStoreReduction(float)
,
getRatioForClauseStoreReduction()
,
setRatioForClauseStoreReduction(float)
int getLearntClausesDominancePerimeter()
Integer.MAX_VALUE
means checking all clauses with the last one.Settings setLearntClausesDominancePerimeter(int n)
Integer.MAX_VALUE
means checking all clauses with the last one.boolean explainGlobalFailureInSum()
Settings explainGlobalFailureInSum(boolean b)
Copyright © 2018. All rights reserved.