Generated on Mon Aug 25 11:35:48 2008 for Gecode by doxygen 1.5.6

Warehouses Class Reference
[Scripts for problems]

Inherits Example.

List of all members.


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/.

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 Spacecopy (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]

Actual model.

Definition at line 105 of file warehouses.cc.

Warehouses::Warehouses ( bool  share,
Warehouses s 
) [inline]

Constructor for cloning s.

Definition at line 155 of file warehouses.cc.


Member Function Documentation

void Warehouses::constrain ( Space s  )  [inline]

Add constraint for next better solution.

Definition at line 151 of file warehouses.cc.

virtual Space* Warehouses::copy ( bool  share  )  [inline, virtual]

Copy during cloning.

Implements Gecode::Space.

Definition at line 164 of file warehouses.cc.

virtual void Warehouses::print ( std::ostream &  os  )  [inline, virtual]

Print solution.

Reimplemented from Example.

Definition at line 169 of file warehouses.cc.


Member Data Documentation

Map store to the supplier.

Definition at line 96 of file warehouses.cc.

Is a supplier open (warehouse needed).

Definition at line 98 of file warehouses.cc.

Cost of a store.

Definition at line 100 of file warehouses.cc.

Total cost.

Definition at line 102 of file warehouses.cc.


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