Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <work_assignment.h>
Public Member Functions | |
void | PushLevel (const ProtoLiteral &decision, IntegerValue objective_lb, int node_id) |
Adds a new assigned level to the trail. | |
void | SetLevelImplied (int level) |
Asserts that the decision at level is implied by earlier decisions. | |
void | Clear () |
Clear the trail, removing all levels. | |
void | SetObjectiveLb (int level, IntegerValue objective_lb) |
Set a lower bound on the objective at level. | |
int | MaxLevel () const |
Returns the maximum decision level stored in the trail. | |
ProtoLiteral | Decision (int level) const |
Returns the decision assigned at level . | |
absl::Span< const int > | NodeIds (int level) const |
Returns the node ids for decisions and implications at level . | |
absl::Span< const ProtoLiteral > | Implications (int level) const |
void | AddImplication (int level, ProtoLiteral implication) |
IntegerValue | ObjectiveLb (int level) const |
absl::Span< const ProtoLiteral > | Literals () const |
const std::vector< ProtoLiteral > & | TargetPhase () const |
void | SetPhase (absl::Span< const ProtoLiteral > phase) |
ProtoTrail acts as an intermediate datastructure that can be synced with the shared tree and the local Trail as appropriate. It's intended that you sync a ProtoTrail with the tree on restart or when a subtree is closed, and with the local trail after propagation. Specifically it stores objective lower bounds, and literals that have been branched on and later proven to be implied by the prior decisions (i.e. they can be enqueued at this level).
Definition at line 93 of file work_assignment.h.
|
inline |
Definition at line 124 of file work_assignment.h.
void operations_research::sat::ProtoTrail::Clear | ( | ) |
Clear the trail, removing all levels.
Definition at line 179 of file work_assignment.cc.
|
inline |
Returns the decision assigned at level
.
Definition at line 112 of file work_assignment.h.
absl::Span< const ProtoLiteral > operations_research::sat::ProtoTrail::Implications | ( | int | level | ) | const |
Returns literals which may be propagated at level
, this does not include the decision.
Definition at line 203 of file work_assignment.cc.
|
inline |
Definition at line 136 of file work_assignment.h.
|
inline |
Returns the maximum decision level stored in the trail.
Definition at line 109 of file work_assignment.h.
absl::Span< const int > operations_research::sat::ProtoTrail::NodeIds | ( | int | level | ) | const |
Returns the node ids for decisions and implications at level
.
Definition at line 195 of file work_assignment.cc.
|
inline |
Definition at line 131 of file work_assignment.h.
void operations_research::sat::ProtoTrail::PushLevel | ( | const ProtoLiteral & | decision, |
IntegerValue | objective_lb, | ||
int | node_id ) |
Adds a new assigned level to the trail.
Definition at line 141 of file work_assignment.cc.
void operations_research::sat::ProtoTrail::SetLevelImplied | ( | int | level | ) |
Asserts that the decision at level
is implied by earlier decisions.
We don't store implications for level 0, so only move implications up to the parent if we are removing level 2 or greater.
implications_[level-1] stores the implications for level, which are now stored in the parent's implications, so we can delete them.
Definition at line 154 of file work_assignment.cc.
void operations_research::sat::ProtoTrail::SetObjectiveLb | ( | int | level, |
IntegerValue | objective_lb ) |
Set a lower bound on the objective at level.
Definition at line 189 of file work_assignment.cc.
|
inline |
Definition at line 139 of file work_assignment.h.
|
inline |
Definition at line 138 of file work_assignment.h.