Warehouses Class Reference
[Example scripts (models)]
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.
Definition at line 71 of file warehouses.cc.
Public Member Functions | |
Warehouses (const Options &opt) | |
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 (void) |
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
|
Actual model.
Definition at line 83 of file warehouses.cc. |
|
Constructor for cloning s.
Definition at line 133 of file warehouses.cc. |
Member Function Documentation
|
Add constraint for next better solution.
Definition at line 129 of file warehouses.cc. |
|
Copy during cloning.
Implements Gecode::Space. Definition at line 142 of file warehouses.cc. |
|
Print solution.
Reimplemented from Example. Definition at line 147 of file warehouses.cc. |
Member Data Documentation
|
Map store to the supplier.
Definition at line 74 of file warehouses.cc. |
|
Is a supplier open (warehouse needed).
Definition at line 76 of file warehouses.cc. |
|
Cost of a store.
Definition at line 78 of file warehouses.cc. |
|
Total cost.
Definition at line 80 of file warehouses.cc. |
The documentation for this class was generated from the following file:
- examples/warehouses.cc (Revision: 3517)