Heuristic that uses the results of lookahead. More...
#include <lookahead.h>
Public Member Functions | |
Literal | doSelect (Solver &s) |
Implements the actual selection process. | |
void | endInit (Solver &s) |
virtual bool | notify (Solver &) |
UnitHeuristic (const Lookahead::Params &p) | |
void | updateVar (const Solver &s, Var v, uint32 n) |
Static Public Member Functions | |
static UnitHeuristic * | restricted (const Lookahead::Params &p, uint32 numOps, DecisionHeuristic *other) |
Decorates the heuristic given in other with temporary lookahead of type t. | |
Protected Types | |
typedef SingleOwnerPtr< Lookahead > | LookPtr |
Protected Attributes | |
LookPtr | look_ |
Heuristic that uses the results of lookahead.
The heuristic creates and installs a Lookahead post propagator. It then selects the literal with the highest score, where the score is determined by counting assignments made during failed-literal detection. hybrid_lookahead simply selects the literal that derived the most literals. uniform_lookahead behaves similar to the smodels lookahead heuristic (the literal that maximizes the minimum is selected).
Definition at line 226 of file lookahead.h.
typedef SingleOwnerPtr<Lookahead> Clasp::UnitHeuristic::LookPtr [protected] |
Definition at line 239 of file lookahead.h.
Clasp::UnitHeuristic::UnitHeuristic | ( | const Lookahead::Params & | p | ) | [explicit] |
p | Lookahead parameters to apply during lookahead. |
Definition at line 342 of file lookahead.cpp.
Literal Clasp::UnitHeuristic::doSelect | ( | Solver & | ) | [virtual] |
Implements the actual selection process.
Implements Clasp::DecisionHeuristic.
Reimplemented in Clasp::Restricted.
Definition at line 353 of file lookahead.cpp.
void Clasp::UnitHeuristic::endInit | ( | Solver & | ) | [virtual] |
Called once after all problem constraints are known to the solver and the problem was simplified. The default-implementation is a noop.
s | The solver in which this heuristic is used. |
Reimplemented from Clasp::DecisionHeuristic.
Reimplemented in Clasp::Restricted.
Definition at line 346 of file lookahead.cpp.
virtual bool Clasp::UnitHeuristic::notify | ( | Solver & | ) | [inline, virtual] |
Reimplemented in Clasp::Restricted.
Definition at line 237 of file lookahead.h.
UnitHeuristic * Clasp::UnitHeuristic::restricted | ( | const Lookahead::Params & | p, |
uint32 | numOps, | ||
DecisionHeuristic * | other | ||
) | [static] |
Decorates the heuristic given in other with temporary lookahead of type t.
Definition at line 434 of file lookahead.cpp.
void Clasp::UnitHeuristic::updateVar | ( | const Solver & | , |
Var | , | ||
uint32 | |||
) | [virtual] |
Called if the state of one or more variables changed. A state change is one of:
s | Solver in which the state change occurred. |
v | The first variable affected by the change. |
n | The range of variables affected, i.e. [v, v+n). |
Implements Clasp::DecisionHeuristic.
Reimplemented in Clasp::Restricted.
Definition at line 376 of file lookahead.cpp.
LookPtr Clasp::UnitHeuristic::look_ [protected] |
Definition at line 240 of file lookahead.h.