Generated on Wed Nov 1 15:04:52 2006 for Gecode by doxygen 1.4.5

Warehouses Class Reference
[Example scripts (models)]

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.

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

Warehouses::Warehouses const Options opt  )  [inline]
 

Actual model.

Definition at line 83 of file warehouses.cc.

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

Constructor for cloning s.

Definition at line 133 of file warehouses.cc.


Member Function Documentation

void Warehouses::constrain Space s  )  [inline]
 

Add constraint for next better solution.

Definition at line 129 of file warehouses.cc.

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

Copy during cloning.

Implements Gecode::Space.

Definition at line 142 of file warehouses.cc.

virtual void Warehouses::print void   )  [inline, virtual]
 

Print solution.

Reimplemented from Example.

Definition at line 147 of file warehouses.cc.


Member Data Documentation

IntVarArray Warehouses::supplier [protected]
 

Map store to the supplier.

Definition at line 74 of file warehouses.cc.

BoolVarArray Warehouses::open [protected]
 

Is a supplier open (warehouse needed).

Definition at line 76 of file warehouses.cc.

IntVarArray Warehouses::cost [protected]
 

Cost of a store.

Definition at line 78 of file warehouses.cc.

IntVar Warehouses::total [protected]
 

Total cost.

Definition at line 80 of file warehouses.cc.


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