Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::CompoundMoveBuilder Class Reference

#include <feasibility_jump.h>

Public Member Functions

 CompoundMoveBuilder (int num_variables)
 
void Push (int var, int64_t prev_value, double score)
 
bool Backtrack (int *var, int64_t *value, double *score)
 
void Clear ()
 Removes all moves on the stack.
 
int Size () const
 Returns the number of variables in the move.
 
bool OnStack (int var) const
 Returns true if this var has been set in this move already,.
 
double Score () const
 Returns the sum of scores of atomic moved pushed to this compound move.
 
double BestChildScore () const
 
int Discrepancy () const
 Returns the number of backtracks to any ancestor of the current leaf.
 
bool StackValuesInDomains (absl::Span< const Domain > var_domains) const
 Returns true if all prev_values on the stack are in the appropriate domain.
 

Detailed Description

This class helps keep track of moves that change more than one variable. Mainly this class keeps track of how to backtrack back to the local minimum as you make a sequence of exploratory moves, so in order to commit a compound move, you just need to call Clear instead of Backtracking over the changes.

Definition at line 629 of file feasibility_jump.h.

Constructor & Destructor Documentation

◆ CompoundMoveBuilder()

operations_research::sat::CompoundMoveBuilder::CompoundMoveBuilder ( int num_variables)
inlineexplicit

Definition at line 631 of file feasibility_jump.h.

Member Function Documentation

◆ Backtrack()

bool operations_research::sat::CompoundMoveBuilder::Backtrack ( int * var,
int64_t * value,
double * score )

Sets var, val and score to a move that will revert the most recent atomic move on the stack, and pops this move from the stack. Returns false if the stack is empty.

Definition at line 1149 of file feasibility_jump.cc.

◆ BestChildScore()

double operations_research::sat::CompoundMoveBuilder::BestChildScore ( ) const
inline

Definition at line 657 of file feasibility_jump.h.

◆ Clear()

void operations_research::sat::CompoundMoveBuilder::Clear ( )

Removes all moves on the stack.

Definition at line 1138 of file feasibility_jump.cc.

◆ Discrepancy()

int operations_research::sat::CompoundMoveBuilder::Discrepancy ( ) const
inline

Returns the number of backtracks to any ancestor of the current leaf.

Definition at line 662 of file feasibility_jump.h.

◆ OnStack()

bool operations_research::sat::CompoundMoveBuilder::OnStack ( int var) const

Returns true if this var has been set in this move already,.

Definition at line 1145 of file feasibility_jump.cc.

◆ Push()

void operations_research::sat::CompoundMoveBuilder::Push ( int var,
int64_t prev_value,
double score )

Adds an atomic move to the stack. var must not be on the stack (this is DCHECKed).

Definition at line 1162 of file feasibility_jump.cc.

◆ Score()

double operations_research::sat::CompoundMoveBuilder::Score ( ) const
inline

Returns the sum of scores of atomic moved pushed to this compound move.

Definition at line 653 of file feasibility_jump.h.

◆ Size()

int operations_research::sat::CompoundMoveBuilder::Size ( ) const
inline

Returns the number of variables in the move.

Definition at line 647 of file feasibility_jump.h.

◆ StackValuesInDomains()

bool operations_research::sat::CompoundMoveBuilder::StackValuesInDomains ( absl::Span< const Domain > var_domains) const

Returns true if all prev_values on the stack are in the appropriate domain.

Definition at line 1178 of file feasibility_jump.cc.


The documentation for this class was generated from the following files: