Interface Settings

  • All Known Implementing Classes:
    DefaultSettings

    public interface Settings
    Settings for Model.

    Created by cprudhom on 25/11/14. Project: choco.

    Author:
    Charles Prud'homme
    • Method Detail

      • getWelcomeMessage

        String getWelcomeMessage()
        Returns:
        the welcome message
      • setWelcomeMessage

        Settings setWelcomeMessage​(String welcomeMessage)
        Define the welcome message, printed in the console
        Parameters:
        welcomeMessage - a message
        Returns:
        the current instance
      • checkModel

        boolean checkModel​(Solver solver)
        Parameters:
        solver - the solver
        Returns:
        true if the model is OK wrt the checker, false otherwise
      • setModelChecker

        Settings setModelChecker​(Predicate<Solver> modelChecker)
        Define what to do when a solution is found. By default, it makes a weak check of the model:
             
                 return !ESat.FALSE.equals(solver.isSatisfied());
             
         
        A hard check of the model can be done like this:
             
             return ESat.TRUE.equals(solver.isSatisfied());
             
         
        Parameters:
        modelChecker - a predicate to check the solution
        Returns:
        the current instance
      • enableViews

        boolean enableViews()
        Returns:
        true if views are enabled.
      • setEnableViews

        Settings setEnableViews​(boolean enableViews)
        Set to 'true' to allow the creation of views in the Model. Creates new variables with channeling constraints otherwise.
        Parameters:
        enableViews - true to enable views
        Returns:
        the current instance
      • getMaxDomSizeForEnumerated

        int getMaxDomSizeForEnumerated()
        Returns:
        maximum domain size threshold to force integer variable to be enumerated
      • setMaxDomSizeForEnumerated

        Settings setMaxDomSizeForEnumerated​(int maxDomSizeForEnumerated)
        Define the minimum number of cardinality threshold to a sum/scalar constraint to be decomposed in intermediate sub-sums.
        Parameters:
        maxDomSizeForEnumerated - cardinality threshold
        Returns:
        the current instance
      • getMinCardForSumDecomposition

        int getMinCardForSumDecomposition()
        Returns:
        minimum number of cardinality threshold to a sum constraint to be decomposed
      • setMinCardinalityForSumDecomposition

        Settings setMinCardinalityForSumDecomposition​(int defaultMinCardinalityForSumDecomposition)
        Define the default minimum number of cardinality threshold to a sum/scalar constraint to be decomposed into intermediate sub-sums.
        Parameters:
        defaultMinCardinalityForSumDecomposition - cardinality threshold
        Returns:
        the current instance
      • enableTableSubstitution

        boolean enableTableSubstitution()
        Returns:
        true if some intension constraints can be replaced by extension constraints
      • setEnableTableSubstitution

        Settings setEnableTableSubstitution​(boolean enableTableSubstitution)
        Define whether some intension constraints are replaced by extension constraints
        Parameters:
        enableTableSubstitution - enable table substitution
        Returns:
        the current instance
      • getMaxTupleSizeForSubstitution

        int getMaxTupleSizeForSubstitution()
        Returns:
        maximum domain size threshold to replace intension constraints by extension constraints
      • setMaxTupleSizeForSubstitution

        Settings setMaxTupleSizeForSubstitution​(int maxTupleSizeForSubstitution)
        Define the maximum domain size threshold to replace intension constraints by extension constraints Only checked when enableTableSubstitution() returns true
        Parameters:
        maxTupleSizeForSubstitution - threshold to substitute intension constraint by table one.
        Returns:
        the current instance
      • sortPropagatorActivationWRTPriority

        boolean sortPropagatorActivationWRTPriority()
        Returns:
        true if propagators are sorted wrt their priority on initial activation.
      • setSortPropagatorActivationWRTPriority

        Settings setSortPropagatorActivationWRTPriority​(boolean sortPropagatorActivationWRTPriority)
        Set whether propagators are sorted wrt their priority in PropagationEngine when dealing with propagator activation.
        Parameters:
        sortPropagatorActivationWRTPriority - true to allow sorting static propagators.
        Returns:
        the current instance
      • makeDefaultSearch

        AbstractStrategy makeDefaultSearch​(Model model)
        Creates a default search strategy for the input model
        Parameters:
        model - a model requiring a default search strategy
        Returns:
        a default search strategy for model
        See Also:
        Search.defaultSearch(Model)
      • setDefaultSearch

        Settings setDefaultSearch​(Function<Model,​AbstractStrategy> defaultSearch)
        Define a default search strategy for the input model
        Parameters:
        defaultSearch - what default search strategy should be
        Returns:
        the current instance
      • getEnvironmentHistorySimulationCondition

        ICondition getEnvironmentHistorySimulationCondition()
        Returns:
        the condition to satisfy when rebuilding history of backtrackable objects is needed.
      • setEnvironmentHistorySimulationCondition

        Settings setEnvironmentHistorySimulationCondition​(ICondition environmentHistorySimulationCondition)
        Set the condition to satisfy when rebuilding history of backtrackable objects is needed. Building "fake" history is needed when a backtrackable object is created during the search, in order to restore a correct state upon backtrack. The default condition is "at least one env.worldPush() has been called since the creation of the bck object". The condition can be set to ICondition.FALSE if no backtrackable object is created during the search.
        Parameters:
        environmentHistorySimulationCondition - the condition to satisfy when rebuilding history of backtrackable objects is needed.
        Returns:
        the current instance
      • warnUser

        boolean warnUser()
        Returns:
        true if warnings detected during modeling/solving are output.
      • setWarnUser

        Settings setWarnUser​(boolean warnUser)
        To be informed of warnings detected during modeling/solving
        Parameters:
        warnUser - true to be print warnings on console
        Returns:
        the current instance
      • enableDecompositionOfBooleanSum

        boolean enableDecompositionOfBooleanSum()
        Returns:
        true if boolean sum should be decomposed into an equality constraint and an arithmetic constraint, falseif a single constraint should be used instead.
      • setEnableDecompositionOfBooleanSum

        Settings setEnableDecompositionOfBooleanSum​(boolean enableDecompositionOfBooleanSum)
        Define if boolean sums should be decomposed into an equality constraint + arithmetic constraint
        Parameters:
        enableDecompositionOfBooleanSum - true to enable decomposition
        Returns:
        the current instance
      • enableIncrementalityOnBoolSum

        boolean enableIncrementalityOnBoolSum​(int nbvars)
        Parameters:
        nbvars - number of variables in the constraint
        Returns:
        true if the incrementality is enabled on boolean sum, based on the number of variables involved.
      • setEnableIncrementalityOnBoolSum

        Settings setEnableIncrementalityOnBoolSum​(IntPredicate enableIncrementalityOnBoolSum)
        Define the predicate to choose incremental sum, based on number variables declared
        Parameters:
        enableIncrementalityOnBoolSum - predicate to pick declare sum
        Returns:
        the current instance
      • cloneVariableArrayInPropagator

        boolean cloneVariableArrayInPropagator()
        Returns:
        true if all propagators should clone the input variable array instead of simply referencing it.
      • setCloneVariableArrayInPropagator

        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. This prevents, for instance, wrong behavior when permutations occurred on the input array (e.g., sorting variables). Setting this to false may limit the memory consumption during modelling.
        Parameters:
        cloneVariableArrayInPropagator - true to clone variables array on constructor
        Returns:
        the current instance
      • enableACOnTernarySum

        boolean enableACOnTernarySum()
        Returns:
        true if AC is enabled to filter ternary sums by default.
      • setEnableACOnTernarySum

        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. Note AC brings more filtering when there are holes in variable domains but this comes at a cost.
        Parameters:
        enable - true to enable AC by default
        Returns:
        the current instance
      • defaultPrefix

        String defaultPrefix()
        Define the prefix of internally created variables (through a call to IVariableFactory.generateName()
        Returns:
        the prefix of all internally created variables
      • setDefaultPrefix

        Settings setDefaultPrefix​(String defaultPrefix)
        Define prefix of internally created variables
        Parameters:
        defaultPrefix - prefix of internally created variables' name
        Returns:
        the current instance
      • enableSAT

        boolean enableSAT()
        Returns:
        true when an underlying SAT solver is used to manage clauses declared through ISatFactory, false when clauses are managed with CSP constraints only.
      • setEnableSAT

        Settings setEnableSAT​(boolean enableSAT)
        Indicate if clauses are managed by a unique SAT solver.
        Parameters:
        enableSAT - true to rely on SAT Solver to handle clauses
        Returns:
        the current instance
      • swapOnPassivate

        boolean swapOnPassivate()
        Returns:
        true if, on propagator passivation, the propagator is swapped from active to passive in its variables' propagators list. false if, on propagator passivation, only the propagator's state is set to PASSIVE.
      • setSwapOnPassivate

        Settings setSwapOnPassivate​(boolean swapOnPassivate)
        Define if passivation of propagator swap it in variables' list
        Parameters:
        swapOnPassivate - true to enable swapping
        Returns:
        the current instance
      • checkDeclaredConstraints

        boolean checkDeclaredConstraints()
        Returns:
        true (default value) to check if all declared constraints are not free anymore, that is either posted or reified, before running the resolution. false to skip the control.
      • setCheckDeclaredConstraints

        Settings setCheckDeclaredConstraints​(boolean checkDeclaredConstraints)
        Indicate if the declared constraints are either posted or reified.
        Parameters:
        checkDeclaredConstraints - true to check constraints before resolution
        Returns:
        the current instance
      • printAllUndeclaredConstraints

        boolean printAllUndeclaredConstraints()
        Returns:
        true to list all undeclared constraint, false (default value) otherwise. Only active when checkDeclaredConstraints() is on.
      • setPrintAllUndeclaredConstraints

        Settings setPrintAllUndeclaredConstraints​(boolean printAllUndeclaredConstraints)
        Indicate if all undeclared constraints are listed on console when checkDeclaredConstraints() is on.
        Parameters:
        printAllUndeclaredConstraints - true to list all undeclared constraints
        Returns:
        the current instance
      • setInitSolver

        Settings setInitSolver​(Function<Model,​Solver> initSolver)
        Define the solver initialization
        Parameters:
        initSolver - function to initialize the solver
        Returns:
        the current instance
      • enableHybridizationOfPropagationEngine

        byte enableHybridizationOfPropagationEngine()
        Returns:
        0b00 if constraint-oriented propagation engine, 0b01 if hybridization between variable and constraint oriented and 0b10 if variable-oriented.
      • setHybridizationOfPropagationEngine

        Settings setHybridizationOfPropagationEngine​(byte hybrid)
        Define behavior of the propagation engine.
        Parameters:
        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.
        Returns:
        the current instance
      • getLearntClausesDominancePerimeter

        int getLearntClausesDominancePerimeter()
        When a clause is learnt from a conflict, it may happen that it dominates previously learnt ones. The dominance will be evaluated with the n last learnt clauses. n = 0 means no dominance check, n = Integer.MAX_VALUE means checking all clauses with the last one.
        Returns:
        dominance perimeter
      • setLearntClausesDominancePerimeter

        Settings setLearntClausesDominancePerimeter​(int n)
        When a clause is learnt from a conflict, it may happen that it dominates previously learnt ones. The dominance will be evaluated with the n last learnt clauses. n = 0 means no dominance check, n = Integer.MAX_VALUE means checking all clauses with the last one.
        Returns:
        dominance perimeter
      • explainGlobalFailureInSum

        boolean explainGlobalFailureInSum()
        Returns:
        true if additional clauses can be learned from sum's global failure
      • explainGlobalFailureInSum

        Settings explainGlobalFailureInSum​(boolean b)
        Set to true to allow additional clauses to be learned from sum's global failure