Generated on Sat Feb 7 2015 02:01:39 for Gecode by doxygen 1.8.9.1
Warehouses Class Reference

Example: Locating warehouses More...

Public Member Functions

 Warehouses (const Options &)
 Actual model. More...
 
virtual IntVar cost (void) const
 Return solution cost. More...
 
 Warehouses (bool share, Warehouses &s)
 Constructor for cloning s. More...
 
virtual Spacecopy (bool share)
 Copy during cloning. More...
 
virtual void print (std::ostream &os) const
 Print solution. More...
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (void)
 Default constructor. More...
 
 ScriptBase (bool share, ScriptBase &e)
 Constructor used for cloning. More...
 
virtual void compare (const Space &, std::ostream &os) const
 Compare with s. More...
 

Protected Attributes

IntVarArray supplier
 Which warehouse supplies a store. More...
 
BoolVarArray open
 Is a warehouse open (warehouse needed) More...
 
IntVarArray c_store
 Cost of a store. More...
 
IntVar c_total
 Total cost. More...
 

Related Functions

(Note that these are not member functions.)

int main (int argc, char *argv[])
 Main-function. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
static std::ostream & select_ostream (const char *name, std::ofstream &ofs)
 Choose output stream according to name. More...
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

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
inlinevirtual

Return solution cost.

Definition at line 144 of file warehouses.cpp.

virtual Space* Warehouses::copy ( bool  share)
inlinevirtual

Copy during cloning.

Definition at line 157 of file warehouses.cpp.

virtual void Warehouses::print ( std::ostream &  os) const
inlinevirtual

Print solution.

Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.

Definition at line 162 of file warehouses.cpp.

Friends And Related Function Documentation

int main ( int  argc,
char *  argv[] 
)
related

Main-function.

Definition at line 175 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: