Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ src/ constraint_solver/

operations_research::Pack Class Reference

Pack Constraint. More...

#include <constraint_solver.h>

Inheritance diagram for operations_research::Pack:

operations_research::Constraint operations_research::PropagationBaseObject operations_research::BaseObject

List of all members.

Public Member Functions

 Pack (Solver *const s, const IntVar *const *vars, int vsize, int64 number_of_bins)
 Pack.
virtual ~Pack ()
void AddWeightedSumLessOrEqualConstantDimension (const std::vector< int64 > &weights, const std::vector< int64 > &bounds)
 Public API.
void AddWeightedSumEqualVarDimension (const std::vector< int64 > &weights, const std::vector< IntVar * > &loads)
 This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is equal to loads[b].
void AddSumVariableWeightsLessOrEqualConstantDimension (const std::vector< IntVar * > &weights, const std::vector< int64 > &capacities)
 This dimension imposes: forall b in bins, sum (i in items: weight[i] * is_assigned(i, b)) <= capacities[b] where is_assigned(i, b) is true if and only if item i is assigned to the bin b.
void AddWeightedSumOfAssignedDimension (const std::vector< int64 > &weights, IntVar *const cost_var)
 This dimension enforces that cost_var == sum of weights[i] for all objects 'i' assigned to a bin.
void AddCountUsedBinDimension (IntVar *const count_var)
 This dimension links 'count_var' to the actual number of bins used in the pack.
void AddCountAssignedItemsDimension (IntVar *const count_var)
 This dimension links 'count_var' to the actual number of items assigned to a bin in the pack.
virtual void Post ()
 Internal API.
void ClearAll ()
void PropagateDelayed ()
virtual void InitialPropagate ()
 namespace
void Propagate ()
void OneDomain (int var_index)
virtual string DebugString () const
 Constraint class.
bool IsUndecided (int64 var_index, int64 bin_index) const
void SetImpossible (int64 var_index, int64 bin_index)
void Assign (int64 var_index, int64 bin_index)
bool IsAssignedStatusKnown (int64 var_index) const
bool IsPossible (int64 var_index, int64 bin_index) const
IntVarAssignVar (int64 var_index, int64 bin_index) const
void SetAssigned (int64 var_index)
void SetUnassigned (int64 var_index)
void RemoveAllPossibleFromBin (int64 bin_index)
void AssignAllPossibleToBin (int64 bin_index)
void AssignFirstPossibleToBin (int64 bin_index)
void AssignAllRemainingItems ()
void UnassignAllRemainingItems ()
virtual void Accept (ModelVisitor *const visitor) const
 Accepts the given visitor.


Detailed Description

Pack Constraint.

Definition at line 4839 of file constraint_solver.h.


Constructor & Destructor Documentation

operations_research::Pack::Pack ( Solver *const   s,
const IntVar *const *  vars,
int  vsize,
int64  number_of_bins 
)

Pack.

Definition at line 121 of file pack.cc.

operations_research::Pack::~Pack (  )  [virtual]

Definition at line 142 of file pack.cc.


Member Function Documentation

void operations_research::Pack::AddWeightedSumLessOrEqualConstantDimension ( const std::vector< int64 > &  weights,
const std::vector< int64 > &  bounds 
)

Public API.

namespace

Dimensions are additional constraints than can restrict what is possible with the pack constraint. It can be used to set capacity limits, to count objects per bin, to compute unassigned penalties... This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is less or equal 'bounds[b]'.

API

Definition at line 1270 of file pack.cc.

void operations_research::Pack::AddWeightedSumEqualVarDimension ( const std::vector< int64 > &  weights,
const std::vector< IntVar * > &  loads 
)

This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is equal to loads[b].

Definition at line 1286 of file pack.cc.

void operations_research::Pack::AddSumVariableWeightsLessOrEqualConstantDimension ( const std::vector< IntVar * > &  weights,
const std::vector< int64 > &  capacities 
)

This dimension imposes: forall b in bins, sum (i in items: weight[i] * is_assigned(i, b)) <= capacities[b] where is_assigned(i, b) is true if and only if item i is assigned to the bin b.

This can be used to model shapes of items by linking variables of the same item on parallel dimensions with an allowed assignment constraint.

Definition at line 1315 of file pack.cc.

void operations_research::Pack::AddWeightedSumOfAssignedDimension ( const std::vector< int64 > &  weights,
IntVar *const   cost_var 
)

This dimension enforces that cost_var == sum of weights[i] for all objects 'i' assigned to a bin.

Definition at line 1301 of file pack.cc.

void operations_research::Pack::AddCountUsedBinDimension ( IntVar *const   count_var  ) 

This dimension links 'count_var' to the actual number of bins used in the pack.

Definition at line 1330 of file pack.cc.

void operations_research::Pack::AddCountAssignedItemsDimension ( IntVar *const   count_var  ) 

This dimension links 'count_var' to the actual number of items assigned to a bin in the pack.

Definition at line 1337 of file pack.cc.

void operations_research::Pack::Post (  )  [virtual]

Internal API.

Implements operations_research::Constraint.

Definition at line 144 of file pack.cc.

void operations_research::Pack::ClearAll (  ) 

Definition at line 166 of file pack.cc.

void operations_research::Pack::PropagateDelayed (  ) 

Definition at line 177 of file pack.cc.

void operations_research::Pack::InitialPropagate (  )  [virtual]

namespace

Implements operations_research::Constraint.

Definition at line 209 of file pack.cc.

void operations_research::Pack::Propagate (  ) 

Definition at line 298 of file pack.cc.

void operations_research::Pack::OneDomain ( int  var_index  ) 

Definition at line 363 of file pack.cc.

string operations_research::Pack::DebugString (  )  const [virtual]

Constraint class.

Reimplemented from operations_research::Constraint.

Definition at line 412 of file pack.cc.

bool operations_research::Pack::IsUndecided ( int64  var_index,
int64  bin_index 
) const

Definition at line 437 of file pack.cc.

void operations_research::Pack::SetImpossible ( int64  var_index,
int64  bin_index 
)

Definition at line 441 of file pack.cc.

void operations_research::Pack::Assign ( int64  var_index,
int64  bin_index 
)

Definition at line 449 of file pack.cc.

bool operations_research::Pack::IsAssignedStatusKnown ( int64  var_index  )  const

Definition at line 457 of file pack.cc.

bool operations_research::Pack::IsPossible ( int64  var_index,
int64  bin_index 
) const

Definition at line 461 of file pack.cc.

IntVar * operations_research::Pack::AssignVar ( int64  var_index,
int64  bin_index 
) const

Definition at line 465 of file pack.cc.

void operations_research::Pack::SetAssigned ( int64  var_index  ) 

Definition at line 469 of file pack.cc.

void operations_research::Pack::SetUnassigned ( int64  var_index  ) 

Definition at line 477 of file pack.cc.

void operations_research::Pack::RemoveAllPossibleFromBin ( int64  bin_index  ) 

Definition at line 489 of file pack.cc.

void operations_research::Pack::AssignAllPossibleToBin ( int64  bin_index  ) 

Definition at line 499 of file pack.cc.

void operations_research::Pack::AssignFirstPossibleToBin ( int64  bin_index  ) 

Definition at line 509 of file pack.cc.

void operations_research::Pack::AssignAllRemainingItems (  ) 

Definition at line 516 of file pack.cc.

void operations_research::Pack::UnassignAllRemainingItems (  ) 

Definition at line 526 of file pack.cc.

void operations_research::Pack::Accept ( ModelVisitor *const   visitor  )  const [virtual]

Accepts the given visitor.

Reimplemented from operations_research::Constraint.

Definition at line 425 of file pack.cc.


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