RuleWatchNode
in package
Wrapper around a Rule which keeps track of the two literals it watches
Used by RuleWatchGraph to store rules in two RuleWatchChains.
Tags
Table of Contents
- $watch1 : mixed
- $watch2 : mixed
- $rule : mixed
- __construct() : mixed
- Creates a new node watching the first and second literals of the rule.
- getOtherWatch() : int
- Given one watched literal, this method returns the other watched literal
- getRule() : Rule
- Returns the rule this node wraps
- moveWatch() : mixed
- Moves a watch from one literal to another
- watch2OnHighest() : mixed
- Places the second watch on the rule's literal, decided at the highest level
Properties
$watch1
public
mixed
$watch1
$watch2
public
mixed
$watch2
$rule
protected
mixed
$rule
Methods
__construct()
Creates a new node watching the first and second literals of the rule.
public
__construct(Rule $rule) : mixed
Parameters
- $rule : Rule
-
The rule to wrap
Return values
mixed —getOtherWatch()
Given one watched literal, this method returns the other watched literal
public
getOtherWatch(int $literal) : int
Parameters
- $literal : int
-
The watched literal that should not be returned
Return values
int —A literal
getRule()
Returns the rule this node wraps
public
getRule() : Rule
Return values
Rule —moveWatch()
Moves a watch from one literal to another
public
moveWatch(int $from, int $to) : mixed
Parameters
- $from : int
-
The previously watched literal
- $to : int
-
The literal to be watched now
Return values
mixed —watch2OnHighest()
Places the second watch on the rule's literal, decided at the highest level
public
watch2OnHighest(Decisions $decisions) : mixed
Useful for learned rules where the literal for the highest rule is most likely to quickly lead to further decisions.
Parameters
- $decisions : Decisions
-
The decisions made so far by the solver