OR-Tools  9.6
KnapsackCapacityPropagator

Detailed Description

Definition at line 532 of file knapsack_solver.h.

Public Member Functions

 KnapsackCapacityPropagator (const KnapsackState &state, int64_t capacity)
 
 ~KnapsackCapacityPropagator () override
 
void ComputeProfitBounds () override
 
int GetNextItemId () const override
 
void Init (const std::vector< int64_t > &profits, const std::vector< int64_t > &weights)
 
bool Update (bool revert, const KnapsackAssignment &assignment)
 
int64_t current_profit () const
 
int64_t profit_lower_bound () const
 
int64_t profit_upper_bound () const
 
void CopyCurrentStateToSolution (bool has_one_propagator, std::vector< bool > *solution) const
 

Protected Member Functions

void InitPropagator () override
 
bool UpdatePropagator (bool revert, const KnapsackAssignment &assignment) override
 
void CopyCurrentStateToSolutionPropagator (std::vector< bool > *solution) const override
 
const KnapsackStatestate () const
 
const std::vector< KnapsackItemPtr > & items () const
 
void set_profit_lower_bound (int64_t profit)
 
void set_profit_upper_bound (int64_t profit)
 

Constructor & Destructor Documentation

◆ KnapsackCapacityPropagator()

KnapsackCapacityPropagator ( const KnapsackState state,
int64_t  capacity 
)

Definition at line 211 of file knapsack_solver.cc.

◆ ~KnapsackCapacityPropagator()

Definition at line 220 of file knapsack_solver.cc.

Member Function Documentation

◆ ComputeProfitBounds()

void ComputeProfitBounds ( )
overridevirtual

Implements KnapsackPropagator.

Definition at line 224 of file knapsack_solver.cc.

◆ CopyCurrentStateToSolution()

void CopyCurrentStateToSolution ( bool  has_one_propagator,
std::vector< bool > *  solution 
) const
inherited

Definition at line 198 of file knapsack_solver.cc.

◆ CopyCurrentStateToSolutionPropagator()

void CopyCurrentStateToSolutionPropagator ( std::vector< bool > *  solution) const
overrideprotectedvirtual

Implements KnapsackPropagator.

Definition at line 284 of file knapsack_solver.cc.

◆ current_profit()

int64_t current_profit ( ) const
inlineinherited

Definition at line 465 of file knapsack_solver.h.

◆ GetNextItemId()

int GetNextItemId ( ) const
inlineoverridevirtual

Implements KnapsackPropagator.

Definition at line 537 of file knapsack_solver.h.

◆ Init()

void Init ( const std::vector< int64_t > &  profits,
const std::vector< int64_t > &  weights 
)
inherited

Definition at line 173 of file knapsack_solver.cc.

◆ InitPropagator()

void InitPropagator ( )
overrideprotectedvirtual

Implements KnapsackPropagator.

Definition at line 255 of file knapsack_solver.cc.

◆ items()

const std::vector<KnapsackItemPtr>& items ( ) const
inlineprotectedinherited

Definition at line 497 of file knapsack_solver.h.

◆ profit_lower_bound()

int64_t profit_lower_bound ( ) const
inlineinherited

Definition at line 466 of file knapsack_solver.h.

◆ profit_upper_bound()

int64_t profit_upper_bound ( ) const
inlineinherited

Definition at line 467 of file knapsack_solver.h.

◆ set_profit_lower_bound()

void set_profit_lower_bound ( int64_t  profit)
inlineprotectedinherited

Definition at line 499 of file knapsack_solver.h.

◆ set_profit_upper_bound()

void set_profit_upper_bound ( int64_t  profit)
inlineprotectedinherited

Definition at line 500 of file knapsack_solver.h.

◆ state()

const KnapsackState& state ( ) const
inlineprotectedinherited

Definition at line 496 of file knapsack_solver.h.

◆ Update()

bool Update ( bool  revert,
const KnapsackAssignment assignment 
)
inherited

Definition at line 186 of file knapsack_solver.cc.

◆ UpdatePropagator()

bool UpdatePropagator ( bool  revert,
const KnapsackAssignment assignment 
)
overrideprotectedvirtual

Implements KnapsackPropagator.

Definition at line 269 of file knapsack_solver.cc.


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