Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0

Example: Steel-mill slab design problem More...

Classes

class  SteelMillBranch
 Custom brancher for steel mill slab design. More...
 

Related Symbols

(Note that these are not member symbols.)

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

Problem variables

enum  { SYMMETRY_NONE , SYMMETRY_BRANCHING , SYMMETRY_LDSB }
 Branching variants. More...
 
IntVarArray slab
 Slab assigned to order i.
 
IntVarArray slabload
 Load of slab j.
 
IntVarArray slabcost
 Cost of slab j.
 
IntVar total_cost
 Total cost.
 
 SteelMill (const SteelMillOptions &opt)
 Actual model.
 
virtual void print (std::ostream &os) const
 Print solution.
 
 SteelMill (SteelMill &s)
 Constructor for cloning s.
 
virtual Spacecopy (void)
 Copy during cloning.
 
virtual IntVar cost (void) const
 Return solution cost.
 

Instance specification

int * capacities
 Capacities.
 
int ncapacities
 Number of capacities.
 
int maxcapacity
 Maximum capacity.
 
int * loss
 Loss for all sizes.
 
int ncolors
 Number of colors.
 
order_t orders
 Orders.
 
unsigned int norders
 Number of orders.
 
unsigned int nslabs
 Number of slabs.
 

Additional Inherited Members

- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (const Options &opt)
 Constructor.
 
 ScriptBase (ScriptBase &e)
 Constructor used for cloning.
 
virtual void compare (const Space &home, std::ostream &os) const
 Compare with s.
 
- Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
static std::ostream & select_ostream (const char *sn, std::ofstream &ofs)
 Choose output stream according to sn.
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

Detailed Description

Example: Steel-mill slab design problem

This model solves the Steel Mill Slab Design Problem (Problem 38 in CSPLib). The model is from Gargani and Refalo, "An efficient model and strategy for the steel mill slab design problem.", CP 2007, except that a decomposition of the packing constraint is used. The symmetry-breaking search is from Van Hentenryck and Michel, "The Steel Mill Slab Design Problem Revisited", CPAIOR 2008.

The program accepts an optional argument for a data-file containing an instance of the problem. The format for the data-file is the following:

"number of slab capacities" "sequence of capacities in increasing order"
"number of colors"
"number of orders"
"size order 1" "color of order 1"
"size order 2" "color of order 2"
...

Hard instances are available from http://becool.info.ucl.ac.be/steelmillslab.

Definition at line 158 of file steel-mill.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Branching variants.

Enumerator
SYMMETRY_NONE 

Simple symmetry.

SYMMETRY_BRANCHING 

Breaking symmetries with symmetry.

SYMMETRY_LDSB 

Use LDSB for symmetry breaking.

Definition at line 184 of file steel-mill.cpp.

Constructor & Destructor Documentation

◆ SteelMill() [1/2]

SteelMill::SteelMill ( const SteelMillOptions & opt)
inline

Actual model.

Definition at line 191 of file steel-mill.cpp.

◆ SteelMill() [2/2]

SteelMill::SteelMill ( SteelMill & s)
inline

Constructor for cloning s.

Definition at line 321 of file steel-mill.cpp.

Member Function Documentation

◆ print()

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

Print solution.

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

Definition at line 297 of file steel-mill.cpp.

◆ copy()

virtual Space * SteelMill::copy ( void )
inlinevirtual

Copy during cloning.

Definition at line 334 of file steel-mill.cpp.

◆ cost()

virtual IntVar SteelMill::cost ( void ) const
inlinevirtual

Return solution cost.

Definition at line 338 of file steel-mill.cpp.

Friends And Related Symbol Documentation

◆ main()

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

Main-function.

Definition at line 469 of file steel-mill.cpp.

Member Data Documentation

◆ capacities

int* SteelMill::capacities
protected

Capacities.

Definition at line 163 of file steel-mill.cpp.

◆ ncapacities

int SteelMill::ncapacities
protected

Number of capacities.

Definition at line 164 of file steel-mill.cpp.

◆ maxcapacity

int SteelMill::maxcapacity
protected

Maximum capacity.

Definition at line 165 of file steel-mill.cpp.

◆ loss

int* SteelMill::loss
protected

Loss for all sizes.

Definition at line 166 of file steel-mill.cpp.

◆ ncolors

int SteelMill::ncolors
protected

Number of colors.

Definition at line 167 of file steel-mill.cpp.

◆ orders

order_t SteelMill::orders
protected

Orders.

Definition at line 168 of file steel-mill.cpp.

◆ norders

unsigned int SteelMill::norders
protected

Number of orders.

Definition at line 169 of file steel-mill.cpp.

◆ nslabs

unsigned int SteelMill::nslabs
protected

Number of slabs.

Definition at line 170 of file steel-mill.cpp.

◆ slab

IntVarArray SteelMill::slab
protected

Slab assigned to order i.

Definition at line 176 of file steel-mill.cpp.

◆ slabload

IntVarArray SteelMill::slabload
protected

Load of slab j.

Definition at line 177 of file steel-mill.cpp.

◆ slabcost

IntVarArray SteelMill::slabcost
protected

Cost of slab j.

Definition at line 178 of file steel-mill.cpp.

◆ total_cost

IntVar SteelMill::total_cost
protected

Total cost.

Definition at line 179 of file steel-mill.cpp.


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