118 element(*
this, open, supplier[s], 1);
163 os <<
"\tSupplier: " << supplier << std::endl
164 <<
"\tOpen warehouses: " << open << std::endl
165 <<
"\tStore cost: " << c_store << std::endl
166 <<
"\tTotal cost: " << c_total << std::endl
179 opt.
parse(argc,argv);
180 IntMinimizeScript::run<Warehouses,BAB,Options>(
opt);
const int c_supply[n_stores][n_warehouses]
Cost for supply a store by a warehouse.
IntVarArray supplier
Which warehouse supplies a store.
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Warehouses(const Options &)
Actual model.
void update(Space &home, bool share, VarImpVar< VarImp > &y)
Update this variable to be a clone of variable y.
virtual Space * copy(bool share)
Copy during cloning.
Parametric base-class for scripts.
void iterations(unsigned int i)
Set default number of iterations.
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl)
Select variable with largest min-regret.
int main(int argc, char *argv[])
Main-function.
const int n_warehouses
Number of warehouses.
void update(Space &, bool share, VarArray< Var > &a)
Update array to be a clone of array a.
Gecode::FloatVal c(-8, 8)
IntVarArray c_store
Cost of a store.
Example: Locating warehouses
IntValBranch INT_VAL_MIN(void)
Select smallest value.
virtual void print(std::ostream &os) const
Print solution.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntConLevel)
Post domain consistent propagator for .
Passing integer arguments.
Warehouses(bool share, Warehouses &s)
Constructor for cloning s.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
BoolVar expr(Home home, const BoolExpr &e, IntConLevel icl)
Post Boolean expression and return its value.
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntConLevel)
Post propagator for .
IntVar c_total
Total cost.
void solutions(unsigned int n)
Set default number of solutions to search for.
BoolVarArray open
Is a warehouse open (warehouse needed)
virtual IntVar cost(void) const
Return solution cost.
const int n_stores
Number of stores.
Gecode toplevel namespace
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
const int capacity[n_warehouses]
Capacity of a single warehouse.
BrancherHandle branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
const int c_fixed
Fixed cost for one warehouse.
Domain propagation or consistency.