Warehouses Class Reference
[Scripts for problems]
Inherits Example.
Detailed Description
Example: Locating warehousesA company needs to construct warehouses to supply stores with goods. Each warehouse possibly to be constructed has a certain capacity defining how many stores it can supply. Constructing a warehouse incurs a fixed cost. Costs for transportation from warehouses to stores depend on the locations of warehouses and stores.
Determine which warehouses should be constructed and which warehouse should supply which store such that overall cost (transportation cost plus construction cost) is smallest.
Taken from: Pascal Van Hentenryck, The OPL Optmization Programming Language, The MIT Press, 1999.
See also problem 34 at http://www.csplib.org/.
Definition at line 93 of file warehouses.cc.
Public Member Functions | |
Warehouses (const Options &) | |
Actual model. | |
void | constrain (Space *s) |
Add constraint for next better solution. | |
Warehouses (bool share, Warehouses &s) | |
Constructor for cloning s. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
virtual void | print (std::ostream &os) |
Print solution. | |
Protected Attributes | |
IntVarArray | supplier |
Map store to the supplier. | |
BoolVarArray | open |
Is a supplier open (warehouse needed). | |
IntVarArray | cost |
Cost of a store. | |
IntVar | total |
Total cost. |
Constructor & Destructor Documentation
Warehouses::Warehouses | ( | const Options & | ) | [inline] |
Warehouses::Warehouses | ( | bool | share, | |
Warehouses & | s | |||
) | [inline] |
Member Function Documentation
void Warehouses::constrain | ( | Space * | s | ) | [inline] |
virtual Space* Warehouses::copy | ( | bool | share | ) | [inline, virtual] |
virtual void Warehouses::print | ( | std::ostream & | os | ) | [inline, virtual] |
Member Data Documentation
IntVarArray Warehouses::supplier [protected] |
BoolVarArray Warehouses::open [protected] |
IntVarArray Warehouses::cost [protected] |
IntVar Warehouses::total [protected] |
The documentation for this class was generated from the following file:
- examples/warehouses.cc (Revision: 6102)