Generated on Tue Apr 18 10:23:03 2017 for Gecode by doxygen 1.6.3

Warehouses Class Reference
[Example scripts (models)]

Example: Locating warehouses More...

List of all members.

Public Member Functions

 Warehouses (const Options &opt)
 Actual model.
virtual IntVar cost (void) const
 Return solution cost.
 Warehouses (bool share, Warehouses &s)
 Constructor for cloning s.
virtual Spacecopy (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

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 opt  )  [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 149 of file warehouses.cpp.

Member Function Documentation

virtual IntVar Warehouses::cost ( void   )  const [inline, virtual]

Return solution cost.

Definition at line 145 of file warehouses.cpp.

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

Copy during cloning.

Definition at line 158 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 163 of file warehouses.cpp.

Member Data Documentation

Which warehouse supplies a store.

Definition at line 102 of file warehouses.cpp.

Is a warehouse open (warehouse needed).

Definition at line 104 of file warehouses.cpp.

Cost of a store.

Definition at line 106 of file warehouses.cpp.

Total cost.

Definition at line 108 of file warehouses.cpp.

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