Composer API
Class

Composer\DependencyResolver\RuleWatchNode

class RuleWatchNode

Wrapper around a Rule which keeps track of the two literals it watches

Used by RuleWatchGraph to store rules in two RuleWatchChains.

Properties

$watch1
$watch2

Methods

__construct(Rule $rule)

Creates a new node watching the first and second literals of the rule.

watch2OnHighest(Decisions $decisions)

Places the second watch on the rule's literal, decided at the highest level

Rule getRule()

Returns the rule this node wraps

int getOtherWatch(int $literal)

Given one watched literal, this method returns the other watched literal

moveWatch(int $from, int $to)

Moves a watch from one literal to another

Details

at line 34
public __construct(Rule $rule)

Creates a new node watching the first and second literals of the rule.

Parameters

Rule $rule The rule to wrap

at line 52
public watch2OnHighest(Decisions $decisions)

Places the second watch on the rule's literal, decided at the highest level

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

at line 78
public Rule getRule()

Returns the rule this node wraps

Return Value

Rule

at line 89
public int getOtherWatch(int $literal)

Given one watched literal, this method returns the other watched literal

Parameters

int $literal The watched literal that should not be returned

Return Value

int A literal

at line 104
public moveWatch(int $from, int $to)

Moves a watch from one literal to another

Parameters

int $from The previously watched literal
int $to The literal to be watched now