#include <Decomposition.h>
Inheritance diagram for Decomposition:

Public Types | |
| typedef bool(* | SolutionCallback )(Decomposition &, bool &) |
| The type of the solution callback functions. | |
| typedef bool(* | EvaluationCallback )(Decomposition &, bool &) |
| The type of the evaluation callback functions. | |
| typedef bool(* | RefutationCallback )(Decomposition &, bool &) |
| The type of the refutation callback functions. | |
| typedef hash_set< Variable * > | ActiveVariablesSet |
| The type used to pass sets of active variables around. | |
| typedef hash_set< Constraint * > | ActiveConstraintsSet |
| The type used to pass sets of active constraints around. | |
| enum | Statistics { NoStatistics = 0, AverageUninstantiatedVariables = 1, AverageModifiedVariables = 2, AverageDomainSize = 4, AverageActiveConstraints = 8, AverageVariableDegree = 16, AverageConstrainedness = 32, AverageConstraintDensity = 64, AverageConstraintTightness = 128, AverageLooseConstraints = 256, AverageLeafDepth = 512, Nodes = 1024, Leaves = 2048, ExtraPropagationStatistics = 4096, VariableSelectionCounters = 8192, LastPathSelections = 16384, Backdoor = 32768, BranchingAssignments = 65536, AllStatistics = UINT_MAX } |
| enum | Features { NoFeatures = 0, StaticOptimismBucketing = 1, DynamicOptimismBucketing = 2, GreedyVariableProcessing = 8, LooseConstraintsDeactivation = 16, FailFirstnessAnalysis = 32, AggregateScoreValueSelection = 64, AllFeatures = UINT_MAX } |
Public Member Functions | |
| virtual | ~Decomposition () |
| Destructor. It deallocates the list of uninstantiated variables. | |
| const wstring | name () const |
| Return the name of the decomposition algorithm. | |
| const wstring & | fullName () const |
| Return the full name of the decomposition algorithm. | |
| const wstring & | shortName () const |
| Return the short name of the decomposition algorithm. | |
| const Problem & | problem () const |
| Return the problem to solve. | |
| Problem & | problem () |
| Return the problem to solve. | |
| const Filter & | filter () const |
| Return the filter used. | |
| Filter & | filter () |
| Return the filter used. | |
| const Retraction & | retraction () const |
| Return the retraction method used when backtracking. | |
| Retraction & | retraction () |
| Return the retraction used when backtracking. | |
| int | depth () const |
| Return the current depth of the search. | |
| void | keepBestValues (double percentage) |
| double | percentageOfInstantiatedVariables () const |
| void | getModifiedVariables (int depth, vector< Variable * > &modifiedVariables) const |
| ulonglong | solutions () const |
| bool | registerHeuristic (VariableOH &heuristic, bool back=true) |
| bool | unregisterHeuristic (VariableOH &heuristic) |
| size_t | variableOrderingHeuristics () const |
| Return the number of variable ordering heuristics registered. | |
| VariableOH & | variableOrderingHeuristic (size_t n) const |
| bool | registerHeuristic (ValueOH &heuristic, bool back=true) |
| bool | unregisterHeuristic (ValueOH &heuristic) |
| size_t | valueOrderingHeuristics () const |
| Return the number of value ordering heuristics registered. | |
| ValueOH & | valueOrderingHeuristic (size_t n) const |
| const vlist_type & | uninstantiatedVariables () const |
| void | getInstantiatedVariables (hash_set< const Variable * > &c) const |
| const shash_type & | solutionsLeft () const |
| Return the list of known solutions that have not been found yet. | |
| void | getKnownSolutions (const hash_set< const Variable * > &instantiatedVariables, const shash_type &solutionsLeft, shash_type &goodSolutions, shash_type &badSolutions) const |
| void | getPerfectValues (const Variable &variable, hash_set< const Value * > &values, const shash_type &solutions) const |
| void | setSolutionCallback (SolutionCallback solutionCallback) |
| SolutionCallback | solutionCallback () const |
| void | setEvaluationCallback (EvaluationCallback evaluationCallback) |
| EvaluationCallback | evaluationCallback () const |
| void | setRefutationCallback (RefutationCallback refutationCallback) |
| RefutationCallback | refutationCallback () const |
| ulonglong | search (const bool yield=false, const vlist_type &instantiables=s_all) |
| void | buildActiveSets (const vlist_type &variables, ActiveVariablesSet &avs, ActiveConstraintsSet &acs) const |
| int | depthOfDeepestModifiedVariable (const hash_set< id_t > &wanted) const |
| size_t | branching (Variable &variable, hash_map< const Value *, size_t > &costs, int level, bool minimum=true) |
| void | postPropagationDomainSizes (Variable &variable, hash_map< const Value *, size_t > &domainSizes, bool minimum=true) |
| ulonglong | totalNodes () const |
| Return the total number of nodes so far. | |
| double | staticOptimismPercentage () const |
| void | setStaticOptimismPercentage (double percentage) |
| double | dynamicOptimismPercentage () const |
| void | setDynamicOptimismPercentage (double percentage) |
| const BitFlags & | statistics () const |
| bool | setStatistics (const BitFlags::Flags flags) |
| const BitFlags & | features () const |
| bool | setFeatures (const BitFlags::Flags flags) |
| const PropagationStatistics & | propagationStatistics () const |
| Return the object storing propagation-related statistics. | |
| const Resources & | resources () const |
| Return the resources used up by this decomposition. | |
| Resources & | resources () |
| Return the resources used up by this decomposition. | |
| const vector< long double > & | averageUninstantiatedVariables () const |
| const vector< long double > & | averageModifiedVariables () const |
| const vector< long double > & | averageDomainSize () const |
| Return an object containing the average domain size per depth. | |
| const vector< long double > & | averageMinimumDomainSize () const |
| Return an object containing the average minimum domain size per depth. | |
| const vector< long double > & | averageMaximumDomainSize () const |
| Return an object containing the average maximum domain size per depth. | |
| const vector< long double > & | averageActiveConstraints () const |
| const vector< long double > & | averageVariableDegree () const |
| const vector< long double > & | averageConstrainedness () const |
| const vector< long double > & | averageConstraintDensity () const |
| const vector< long double > & | averageConstraintTightness () const |
| const vector< long double > & | averageLooseConstraints () const |
| const vector< hash_map< Variable *, ulonglong > > & | variableSelectionCounters () const |
|
const vector< vector< pair< Variable *, Domain * > > > & | lastPathSelections () const |
| Return the selections made on the last path. | |
| const vector< pair< Variable *, Domain * > > & | backdoor () const |
| const vector< vector< pair< Variable *, Domain * > > > & | branchingAssignments () const |
| Driver * | driver () |
| Return the decomposition's driver, if any. | |
| const Driver * | driver () const |
| Return the decomposition's driver, if any. | |
| const timeval & | timeLimit () const |
| bool | timeLimitEnabled () const |
| Return `true' if a time limit has been set, `false' otherwise. | |
| timeval | setTimeLimit (const timeval &timeLimit) |
| bool | timeLimitExceeded () |
| const ulonglong | nodeLimit () const |
| bool | nodeLimitEnabled () const |
| Return `true' if a node limit has been set, `false' otherwise. | |
| ulonglong | setNodeLimit (const ulonglong nodeLimit) |
| bool | nodeLimitExceeded () |
| ulonglong | setRefutationsLimit (ulonglong refutationsLimit) |
| void | setRefutationNodesUpperBound (ulonglong nodes) |
| Set the upper bound on the number of nodes for a refutation. | |
| void | recordRefutationParameters (const ulonglong ccks, const ulonglong nodes, const Resources &resources, const int depth) |
| void | currentRefutation (vector< vector< id_t > > &variables, vector< vector< id_t > > &values) |
| bool | shortestRefutation (Refutation &refutation) const |
| ulonglong | shortestRefutationNodes () const |
| void | setRefutationDepthUpperBound (int depthUpperBound) |
| void | setIterativeDeepening (bool iterativeDeepening) |
| void | setLookAheadLevel (int lookAheadLevel) |
| void | setOptimalRefutationCaching (bool caching) |
| void | setConsistencyBeforeSearch (bool consistencyBeforeSearch) |
| size_t | ffaDynamicUpperBoundThreshold () const |
| void | setFFADynamicUpperBoundThreshold (size_t nVariables) |
| int | ffaProgressReportingDepthLimit () const |
| Return the depth past which progress is not reported (FFA). | |
| void | setFFAProgressReportingDepthLimit (int limit) |
| Set the depth past which progress is not reported (FFA). | |
| size_t | ffaLowerBoundLookAheadLevel () const |
| void | setFFALowerBoundLookAheadLevel (size_t level) |
| double | setFFAOptimismPercentage () const |
| void | setFFAOptimismPercentage (double percentage) |
| int | maximumSearchDepth () const |
| long double | constrainedness (const ActiveVariablesSet &avs, const ActiveConstraintsSet &acs) const |
| ulonglong | nodes (int depth) const |
| ulonglong | leaves (int depth) const |
| const vector< vector< ulonglong > > & | mistakePointNodes (int depth) const |
| const vector< vector< ulonglong > > & | mistakePointLeaves (int depth) const |
| ulonglong | backtracks (int depth) const |
| int | solutionDepth () const |
| const vector< ulonglong > & | solutionHeuristicMistakes () const |
| const vector< ulonglong > & | globalHeuristicMistakes () const |
| ulonglong | refutationSizeLowerBound (int lookAheadLevel) |
| ulonglong | initialRefutationSizeLowerBound () const |
| Return the initial refutation size lower bound. | |
| void | generateProblemGraph (wostream &wos) const |
| void | generateProblemGraph (const wstring &stem) const |
| bool | scheduleProblemGraphGeneration (const wstring &stem, int depth) |
| bool | scheduleSearchTreeGeneration (const wstring &stem, int depth) |
Static Public Attributes | |
| const timeval | NoTimeLimit = { LONG_MAX, LONG_MAX } |
| Value used to disable the search time limit. | |
| const ulonglong | NoNodeLimit = ULONGLONG_MAX |
| Value used to disable the node limit during search. | |
| const bool | KeepChanges = true |
| const bool | DiscardChanges = false |
| const bool | ReselectAllowed = true |
| const bool | ReselectProhibited = false |
Protected Member Functions | |
| virtual bool | init () |
| virtual void | done () |
| void | eureka () |
| bool | hideBadValues (Variable &variable) const |
| ulonglong | totalValues (vlist_type &variables) const |
| virtual void | decompose ()=0 |
| bool | propagate (const bool keepChanges=KeepChanges, const vlist_type &instantiables=s_all) |
| bool | propagateAndSearch (const vlist_type &instantiable=s_all) |
| bool | canYield () const |
| Variable * | selectVariable (const bool reselectOk=ReselectAllowed, const vlist_type &undesirables=s_empty) |
| Variable & | selectVariable (Variable &variable) |
| size_t | selectAllVariables (vlist_type *selection=0) |
| void | unselectVariable (Variable &variable) |
| Value * | selectValue (Variable &variable, Domain &domain) |
| void | unselectValue (Domain &domain, Value *value) |
| void | saveState () |
| Save the state of all current and future variables. | |
| void | restoreState () |
| Restore the state of all current and future variables. | |
| bool | moreWork () |
| bool | moreSolutionsNeeded () const |
| bool | discardableSubtree () |
| bool | atJumpDepth () const |
| void | restrict (const vlist_type &variables) |
| void | unrestrict () |
| void | printStack () |
| Decomposition (const wstring &fullName, const wstring &shortName, Problem &problem, Filter &filter, Retraction &retraction, Randomizer &randomizer, bool consistencyBeforeSearch=true) | |
Protected Attributes | |
| Problem & | m_problem |
| The problem to be solved. | |
| vector< SolutionCallback > | m_solutionCallbacks |
| vector< EvaluationCallback > | m_evaluationCallbacks |
| vector< RefutationCallback > | m_refutationCallbacks |
| bool | m_consistencyBeforeSearch |
| `true' if consistency should be restored before search. | |
Friends | |
| class | Driver |
|
|
|
|
|
||||||||||||||||||||||||||||||||
|
Constructor for various decomposition algorithms.
|
|
|
If the installed retraction considers this depth as a return target, then this function returns true.
|
|
|
Return an object containing the average number of active constraints per depth. |
|
|
Return an object containing the average constrainedness per depth. |
|
|
Return an object containing the average constraint density per depth. |
|
|
Return an object containing the average constraint tightness per depth. |
|
|
Return an object containing the average number of loose constraints per depth. |
|
|
Return an object containing the average number of modified variables per depth. |
|
|
Return an object containing the average number of uninstantiated variables per depth. |
|
|
Return an object containing the average variable degree per depth. |
|
|
Return the backdoor computed for the most recent solution. Note that the returned object is valid only for the duration of the call to the solution callback. |
|
|
Return the number of backtracks at a given depth.
|
|
||||||||||||||||||||
|
Compute branching for a given variable.
|
|
|
Return the branching assignments computed for the most recent solution. Note that the returned object is valid only for the duration of the call to the solution callback. |
|
||||||||||||||||
|
Build the set of the active constraints and variables starting from a set of uninstantiated variables.
|
|
|
Ask the driver (if any) if there is a registered decomposition algorithm to yield to. Depending on whether or not we can yield control to another decomposition algorithm, the implementation can choose to decompose the problem into subproblems in a different way.
|
|
||||||||||||
|
Compute the problem's constrainedness.
|
|
||||||||||||
|
Return the assignments making up the current, not verified refutation. This will be used from the refutation callback to evaluate the refutation.
|
|
|
The actual search engine. It implements the decomposition. Note that this method is not supposed to be called directly, therefore it should be made "private" in the derived classes. |
|
|
Given a set of variables, search for the one that has been modified most recently (i.e. can be found closer to the top of the stack in the decomposition's history of selected and unselectable variables), and return its depth.
|
|
|
If an evaluation callback is installed at this depth, this function will tell whether the remaingin search subtree can be discarded or not. The tree can be discarded if the evaluation callback decides that no solution can be found in it.
|
|
|
Finalize a search. Derived classes overwriting this should always call it! |
|
|
Return the percentage of dynamic optimism. See setDynamicOptimismPercentage() for details. |
|
|
This method gets called when all the variables are instantiated (and thus we have a solution). |
|
|
Return the current evaluation callback.
|
|
|
Return the object containing the decomposition's features-related flags. See the Features enum for details. |
|
|
Return the number of variables a (sub)problem must contain for the search for optimal refutations to attempt to obtain tighter upper bounds dynamically by running a search in that subtree. |
|
|
Return the look-ahead level for the algorithm estimating the refutation size lower bound (FFA). |
|
|
Generate a graph of the current (sub)problem in AT&T's Graphviz DOT format.
|
|
|
Generate a graph of the current (sub)problem in AT&T's Graphviz DOT format.
|
|
|
Create a list containing all the instantiated variables, including those that have been permanently selected at each depth.
|
|
||||||||||||||||||||
|
Compute the list of possible solutions based on the set of variables that have just been instantiated and the list of previously known good solutions.
|
|
||||||||||||
|
Return the set of variables modified at the given depth. The depth should be less than or equal to the current depth.
|
|
||||||||||||||||
|
Compute the set of values that can be assigned to the given variable and would extend the current set of instantiated variables towards a solution.
|
|
|
Return the sum, over all the solutions found so far, of the number of value ordering heuristic mistakes at each depth.
|
|
|
Hide bad values for the current variable if dynamic optimism is on.
|
|
|
Prepare the decomposition for a new search. Derived classes overwriting this should always call it!
|
|
|
Keep the best values in the domain of each variable. Best values are determined based on the order in which they are sorted by the first value ordering heuristic installed. If no value ordering heuristics are installed, this function will not do anything.
|
|
|
Return the number of leaves touched at a given depth.
|
|
|
Return the maximum depth reached so far by this decomposition algorithm during search. |
|
|
Return a vector of vectors containing the number of leaves per depth in each subtree rooted at a mistake point located at the given depth.
|
|
|
Return a vector of vectors containing the number of nodes per depth in each subtree rooted at a mistake point located at the given depth.
|
|
|
Return `true' if more solutions are needed at the current depth in the search. This is based on the solution callback's return value.
|
|
|
Check whether or not the decomposition should continue at the current depth. Currently, moreWork() returns `false' only if one of the following 4 conditions is true: 1. According to the solution callback no more solutions are needed. 2. According to the evaluation callback, no solution can be found in the remaining search subtree. 3. All the variables have been instantiated. 4. We're not at a depth that is considered a backjumping target by the retraction. This is not a one-size-fits-all solution to terminating a decomposition. It is suitable for most decompositions, but not all. Some decompositions are more complex, requiring a much closer monitoring of their termination condition. See Local Changes (LC) for an example.
|
|
|
Return the number of nodes the algorithm is allowed to create from the moment it has been started.
|
|
|
Check whether or not the node limit has been exceeded.
|
|
|
Return the number of nodes touched at a given depth.
|
|
|
Return the percentage of instantiated variables. Note that since the uninstantiated variables are kept in a list, this function is not constant time. |
|
||||||||||||||||
|
Compute the minimum/maximum post-propagation domain sizes among future variables for a given variable's values.
|
|
|
Print the stack of all the calls to decompose() and their arguments. To be used for debugging purposes only! |
|
||||||||||||
|
Call the filter to make sure the problem is consistent (or arc consistent), depending on the type of the filter used. Depending on how this function has been called, the changes caused to the domains of the variables filtered will be restored or postponed. If this has been a permanent filtration at the current depth, then the only way to restore those changes is to return to the previous depth in the decomposition. Upon successful return from a non-preview call, all variables selected at the current depth will be unselected.
|
|
|
This function implements the usual sequence, used in most decomposition algorithms, that saves the state of all the uninstantiated variables, filters the problem (and does a recursive `search()' if succesful), then restores the state of the uninstantiated variables. Note that variables considered selected will continue to be so upon return from this function.
|
|
||||||||||||||||||||
|
Record the parameters of a new refutation when performing fail-firstness analysis. The refutation callback is called to verify whether or not a newly found refutation is shorter than the previous shortest. If it is, then those refutation parameters that are only accessible in the callback are gonna be made available to this Decomposition object through this function.
|
|
|
Return the current refutation callback.
|
|
|
Return a lower bound on the number of nodes in any refutation. Look ahead the given number of levels. If the look-ahead level is 0, then this only takes into consideration the current depth limit (if iterative deepening is on) and the extra cost (if computed previously).
|
|
||||||||||||
|
Register a value ordering heuristic.
|
|
||||||||||||
|
Register a variable ordering heuristic.
|
|
|
Restrict subsequent recursive searches in this decomposition to a subset of the uninstantiated variables. All uninstantiated variables that are not part of the given subset are marked as hidden, and so are all their active constraints. A new solution counter is gonna be used, and it is initialized to 0. The solution callback is reset, but it can be set upon return from restrict(), if that is useful. Unless that's done, the search for a solution in the subproblem will stop once the first solution is found. Finally, the evaluation callback is set to 0 as well, which means that unless it is set to something else before the next recursive call, restricted subproblems will always evaluate as if there is still potential for a (sub)solution.
|
|
||||||||||||
|
Generate two graphs of the current (sub)problem by calling generateProblemGraph() the next time the search reaches the given depth (once going down and another time when backtracking).
|
|
||||||||||||
|
Generate a graph of the current (sub)tree using AT&T's Graphviz DOT format.
|
|
||||||||||||
|
This method will invoke the search engine to look for solutions. `search()' will use `decompose()' internally to keep looking for solutions as long as the current solution callback - which is called every time a solution is found - returns `true'. The actual number of solutions found until the search was stopped (by the current solution callback returning `false' or by the lack of more solutions) is returned. The value returned by the solution callback is stored in `m_moreSolutionsNeeded'.
|
|
|
Sometimes it may be necessary to select all the variables that remain unselected at a certain level. This function does that quickly, without applying any heuristics, as the order in which they are selected is not important.
|
|
||||||||||||
|
Apply the value ordering heuristics. Select a value from the given domain using the heuristic objects registered. `domain' must be subset of the variable's domain containing only those values that are to be considered eligible by this selection. The variable's actual domain object is not changed by this function.
|
|
|
Similar to selectVariable(), but using a given non-instantiated variable from `m_uninstantiatedVariables' rather than computing one using the variable ordering heuristics. Reselection is allowed implicitly.
|
|
||||||||||||
|
Apply the variable order heuristics. Select a variable from `m_uninstantiatedVariables' using the heuristic objects registered. A decomposition algorithm should not change the domain of a variable unless that variable has been selected (and not unselected) prior to the change. The purpose of the selection mechanism is two-fold. One reason is that we want to be able to select variables based on variable ordering heuristics, and selectVariable() calls each such heuristic in the order in which they were registered, successively reducing the list of preferred variables until only one variable is left or there are no more heuristics to try (in which case the first preferred variable is selected). The second purpose of the variable selection mechanism is that the library needs to keep track of the changes made to the domains of uninstantiated variables by filters and decompositions. By forcing decompositions to select variables using selectVariable(), the library can pass to each filter a list of variables whose domains have been (potentially) modified, saving the filter some unnecessary work. Inside decompose() (which is where variables are normally selected), depending on the decomposition algorithm, either propagateAndSearch() or propagate() will be called. In the first case, upon return from propagateAndSearch(), selected variables will continue to be selected, as all changes and filtrations that had happened during that recursive call have been undone. In the second case however, if propagate(true) succeeds in further filtering the problem, it will perform changes that are considered permanent at the current depth, and so all selected variables will be unselected. Some variables will even become instantiated (as a result of filtration reducing their domain to one value) and will be marked as unselectable. Upon a successful return from propagate(true), all selected variables that the decomposition still wants to work on will have to be re-selected. The MC.cc code is a good example of what needs to be done when calling both propagateAndSearch() and propagate(). Note that once a variable has been selected, the decomposition algorithm can change its domain in any way it sees fit, as long as it never adds to it values that weren't in its domain at the current depth.
|
|
|
Activate/deactivate the enforcement of consistency at the beginning of the search. This has no effect when filters that restore arc-consistency are in use. |
|
|
Set the dynamic optimism percentage. If the decomposition's optimism percentage is greater than 0, then each variable's domain of values is sorted according to the first value ordering heuristic, then the given percentage of values is removed from the end of the sorted domain. A decomposition that implements this should return `true' in `supportsOptimism()'.
|
|
|
Set the function to be called to evaluate the possibility that a solution will be found in the current subtree. If the function returns `false' the subtree is skipped. System resources used by the refutation callback are by default included when computing the resources used by search(). If a callback changes the order of the values in the domain of a variable and the library is in "predictable" mode, the callback must restore the order by calling Variable::sortDomain().
|
|
|
Set the decomposition's features-related flags. See the Features enum for details. Note that flags cannot be set during search (i.e. on callbacks).
|
|
|
Set the number of variables a (sub)problem must contain for the search for optimal refutations to attempt to obtain tighter upper bounds dynamically by running a search in that subtree. |
|
|
Set the look-ahead level for the algorithm estimating the refutation size lower bound (FFA). |
|
|
Set the percentage of optimism ((1-optimism)*100 = the percentage of work to complete at each depth in the search for optimal refutations. |
|
|
Return the percentage of optimism ((1-optimism)*100 = the percentage of work to complete at each depth in the search for optimal refutations. |
|
|
Activate/deactivate iterative deepening in the fail-firstness analysis. Default is on. |
|
|
The level of look-ahead in the fail-firstness analysis. Only levels 0 to 2 (default) have been implemented so far. |
|
|
Control the number of nodes that the search is allowed to create. A value of `NoNodeLimit' disables the node limit.
|
|
|
Activate/deactivate the caching of optimal refutations in the fail-firstness analysis. Default is off. |
|
|
Set the function to be called to validate a refutation found during the fail-firstness analysis. If the function returns `true' the refutation is considered better than the current one. System resources used by the refutation callback are _not_ included by default when computing the resources used by search(). If a callback changes the order of the values in the domain of a variable and the library is in "predictable" mode, the callback must restore the order by calling Variable::sortDomain().
|
|
|
Set the depth limit for refutations found during the search for optimal refutations. No refutation tree depth can exceed the depth configured here. |
|
|
Control the number of "better" refutations to search for. The default is unlimited (or ULONGLONG_MAX).
|
|
|
Set the function to be called when a solution is found. That function should return `true' or `false' depending on whether the search should be continued or not. If no solution callback is provided, the search will stop after the first solution is found. The callback takes as arguments a Decomposition object and a boolean reference. The boolean is `true' by default, but can be set to `false' to prevent the decomposition from taking into account the time spent in the callback in its statistics and timeout (i.e. the Decomposition's timeout will be extended with the appropriate amount of time). System resources used by the refutation callback are by default included when computing the resources used by search(). If a callback changes the order of the values in the domain of a variable and the library is in "predictable" mode, the callback must restore the order by calling Variable::sortDomain().
|
|
|
Set the static optimism percentage. If the decomposition's optimism percentage is greater than 0, then each variable's domain of values is sorted according to the first value ordering heuristic, then the given percentage of values is removed from the end of the sorted domain. The search will proceed on the resulting problem, with the expectation that at least one solution will still be found in the smaller problem, potentiall much faster.
|
|
|
Set the decomposition's statistics-related flags. See the Statistics enum for details. Note that flags cannot be set during search (i.e. on callbacks).
|
|
|
Control the amount of time that the search is allowed to run. A value of `NoTimeLimit' disables the time limit.
|
|
|
If fail-firstness is turned on for this decomposition, this function will return the shortest refutation found so far. That consists of a predefined ordering for variables and values, but also includes (to avoid re-computation) the number of nodes in that refutation and its maximum depth, among other things.
|
|
|
Return the number of nodes in the shortest refutation found so far. |
|
|
Return the current solution callback.
|
|
|
Return the maximum search depth that was reached in the search for the most recent solution. |
|
|
Return the number of value ordering heuristic mistakes at each depth for the most recent solution.
|
|
|
Return the number of solutions found so far. Note that the number of solutions is counted separately for each restriction of the problem. See `restrict()' and `unrestrict()' for details.
|
|
|
Return the percentage of static optimism. See setStaticOptimismPercentage() for details. |
|
|
Return the object containing the decomposition's statistics-related flags. See the Statistics enum for details. |
|
|
Return the amount of time the algorithm is allowed to run from the moment it has been started.
|
|
|
Check whether or not the time limit has been exceeded. If it has been, set `m_moreSolutionsNeeded' to false and return true. Setting `m_moreSolutionsNeeded' here is ugly, but it decreases the amount of code people have to write in decompose() in order to deal with timeouts. Note that we do not try to be extremely accurate here - it is quite difficult to do so without increased support from decompose(), something that we want to avoid. The only guarantees are that the algorithm will be allowed to run for at least m_timeLimit time and that it will eventually stop some time after that (depending on the time required to return from all the nested calls). Also, for short timeouts, you might have to wait until the initialization procedures complete (i.e. when using AC-X). |
|
|
Compute the sum of the number of values found in the domains of all the variables in the given list.
|
|
|
Return the list of uninstantiated variables. |
|
|
Unregister a previously registered value ordering heuristic.
|
|
|
Unregister a previously registered variable ordering heuristic.
|
|
|
Reverse the action of the latest `restrict()' call. Hidden variables are reinserted into the list of uninstantiated variables, and their constraints become active again. The solution counter and callback are restored to the values they had before `restrict()' was called. So is the evaluation callback. |
|
||||||||||||
|
Place `value' back into `domain'.
|
|
|
Unselect a variable whose domain has been restored so that it contains all the values it contained when was first selected at the current depth.
|
|
|
Return the nth value ordering heuristic registered.
|
|
|
Return the nth variable ordering heuristic registered.
|
|
|
Return an object containing the number of times a variable has been selected for instantiation at each depth. |
|
|
The driver class needs access to some of the Decomposition's private fields. |
|
|
The constant passed to `propagate()' to make it discard the filtration changes. |
|
|
The constant passed to `propagate()' to make it keep the filtration changes. |
|
|
The user-supplied function called during the search to evaluate whether or not (acceptable) solutions do exist in the current subtree. |
|
|
The user-supplied function called during the search to determine whether or not the current refutation found during the fail-firstness analysis is better than the previous one. If it is, this callback must call setRefutationUpperBounds() to update the upper bounds. |
|
|
The user-supplied function called during the search when solutions are found. |
|
|
The constant passed to selectVariable() to specify that selecting variables that have already been selected is allowed. |
|
|
The constant passed to selectVariable() to specify that selecting variables that have already been selected is not allowed. |
1.3.9.1