OR-Tools  8.2
KnapsackGenericSolver

Detailed Description

Definition at line 605 of file knapsack_solver.h.

Public Member Functions

 KnapsackGenericSolver (const std::string &solver_name)
 
 ~KnapsackGenericSolver () override
 
void Init (const std::vector< int64 > &profits, const std::vector< std::vector< int64 > > &weights, const std::vector< int64 > &capacities) override
 
int GetNumberOfItems () const
 
void GetLowerAndUpperBoundWhenItem (int item_id, bool is_item_in, int64 *lower_bound, int64 *upper_bound) override
 
void set_master_propagator_id (int master_propagator_id)
 
int64 Solve (TimeLimit *time_limit, bool *is_solution_optimal) override
 
bool best_solution (int item_id) const override
 
virtual std::string GetName () const
 

Constructor & Destructor Documentation

◆ KnapsackGenericSolver()

KnapsackGenericSolver ( const std::string &  solver_name)
explicit

Definition at line 336 of file knapsack_solver.cc.

◆ ~KnapsackGenericSolver()

~KnapsackGenericSolver ( )
override

Definition at line 345 of file knapsack_solver.cc.

Member Function Documentation

◆ best_solution()

bool best_solution ( int  item_id) const
inlineoverridevirtual

Implements BaseKnapsackSolver.

Definition at line 629 of file knapsack_solver.h.

◆ GetLowerAndUpperBoundWhenItem()

void GetLowerAndUpperBoundWhenItem ( int  item_id,
bool  is_item_in,
int64 lower_bound,
int64 upper_bound 
)
overridevirtual

Reimplemented from BaseKnapsackSolver.

Definition at line 368 of file knapsack_solver.cc.

◆ GetName()

virtual std::string GetName ( ) const
inlinevirtualinherited

Definition at line 590 of file knapsack_solver.h.

◆ GetNumberOfItems()

int GetNumberOfItems ( ) const
inline

Definition at line 614 of file knapsack_solver.h.

◆ Init()

void Init ( const std::vector< int64 > &  profits,
const std::vector< std::vector< int64 > > &  weights,
const std::vector< int64 > &  capacities 
)
overridevirtual

Implements BaseKnapsackSolver.

Definition at line 347 of file knapsack_solver.cc.

◆ set_master_propagator_id()

void set_master_propagator_id ( int  master_propagator_id)
inline

Definition at line 622 of file knapsack_solver.h.

◆ Solve()

int64 Solve ( TimeLimit time_limit,
bool *  is_solution_optimal 
)
overridevirtual

Implements BaseKnapsackSolver.

Definition at line 394 of file knapsack_solver.cc.


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