Warehouses Class Reference
[Example scripts (models)]
Example: Locating warehouses More...
Public Member Functions | |
Warehouses (const Options &) | |
Actual model. | |
virtual IntVar | cost (void) const |
Return solution cost. | |
Warehouses (bool share, Warehouses &s) | |
Constructor for cloning s. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
virtual void | print (std::ostream &os) const |
Print solution. | |
Protected Attributes | |
IntVarArray | supplier |
Which warehouse supplies a store. | |
BoolVarArray | open |
Is a warehouse open (warehouse needed). | |
IntVarArray | c_store |
Cost of a store. | |
IntVar | c_total |
Total cost. |
Detailed Description
Example: Locating warehouses
A 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/.
Note that "Modeling and Programming with Gecode" uses this example as a case study.
Definition at line 99 of file warehouses.cpp.
Constructor & Destructor Documentation
Warehouses::Warehouses | ( | const Options & | ) | [inline] |
Actual model.
Definition at line 111 of file warehouses.cpp.
Warehouses::Warehouses | ( | bool | share, | |
Warehouses & | s | |||
) | [inline] |
Constructor for cloning s.
Definition at line 148 of file warehouses.cpp.
Member Function Documentation
virtual IntVar Warehouses::cost | ( | void | ) | const [inline, virtual] |
Return solution cost.
Definition at line 144 of file warehouses.cpp.
virtual Space* Warehouses::copy | ( | bool | share | ) | [inline, virtual] |
Copy during cloning.
Definition at line 157 of file warehouses.cpp.
virtual void Warehouses::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 162 of file warehouses.cpp.
Member Data Documentation
IntVarArray Warehouses::supplier [protected] |
Which warehouse supplies a store.
Definition at line 102 of file warehouses.cpp.
BoolVarArray Warehouses::open [protected] |
Is a warehouse open (warehouse needed).
Definition at line 104 of file warehouses.cpp.
IntVarArray Warehouses::c_store [protected] |
Cost of a store.
Definition at line 106 of file warehouses.cpp.
IntVar Warehouses::c_total [protected] |
Total cost.
Definition at line 108 of file warehouses.cpp.
The documentation for this class was generated from the following file:
- examples/warehouses.cpp (Revision: 11473)