Generated on Wed Dec 13 2017 05:47:49 for Gecode by doxygen 1.8.5
BACP Class Reference

Example: The balanced academic curriculum problem More...

Public Types

enum  { BRANCHING_NAIVE, BRANCHING_LOAD, BRANCHING_LOAD_REV }
 Branching variants. More...
 

Public Member Functions

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

Static Public Member Functions

static int load (const Space &home, IntVar x, int)
 Value selection function for load branching. More...
 
static int load_rev (const Space &home, IntVar x, int)
 Value selection function for reverse load branching. More...
 
- 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)
 

Protected Attributes

const Curriculum curr
 The curriculum to be scheduled. More...
 
IntVarArray l
 Academic load for each period. More...
 
IntVar u
 Maximum academic load. More...
 
IntVarArray q
 Number of courses assigned to a period. More...
 
IntVarArray x
 Period to which a course is assigned. More...
 

Related Functions

(Note that these are not member functions.)

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

Parameters for balanced academic curriculum

const Course courses8 []
 Courses for first example. More...
 
const char * prereqs8 []
 Prerequisites for first example. More...
 
const Course courses10 []
 Courses for second example. More...
 
const char * prereqs10 []
 Prerequisites for second example. More...
 
const Course courses12 []
 Courses for third example. More...
 
const char * prereqs12 []
 Prerequisites for third example. More...
 
const Curriculum curriculum []
 The example specifications. More...
 
const unsigned int n_examples = sizeof(curriculum) / sizeof(Curriculum)
 The number of examples. More...
 

Detailed Description

Example: The balanced academic curriculum problem

This is problem 030 from http://www.csplib.org/.

A custom value selection from "A CP Approach to the Balanced Academic Curriculum Problem", J.N. Monette, P. Schaus, S. Zampelli, Y. Deville, and P. Dupont is available.

Definition at line 100 of file bacp.cpp.

Member Enumeration Documentation

anonymous enum

Branching variants.

Enumerator
BRANCHING_NAIVE 

Simple fail-first branching.

BRANCHING_LOAD 

Place based on minimum-load.

BRANCHING_LOAD_REV 

Place based on maximum-load.

Definition at line 116 of file bacp.cpp.

Constructor & Destructor Documentation

BACP::BACP ( const SizeOptions opt)
inline

Actual model.

Definition at line 123 of file bacp.cpp.

BACP::BACP ( bool  share,
BACP bacp 
)
inline

Constructor for copying bacp.

Definition at line 213 of file bacp.cpp.

Member Function Documentation

static int BACP::load ( const Space home,
IntVar  x,
int   
)
inlinestatic

Value selection function for load branching.

Definition at line 181 of file bacp.cpp.

static int BACP::load_rev ( const Space home,
IntVar  x,
int   
)
inlinestatic

Value selection function for reverse load branching.

Definition at line 197 of file bacp.cpp.

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

Copy during cloning.

Definition at line 221 of file bacp.cpp.

virtual IntVar BACP::cost ( void  ) const
inlinevirtual

Return solution cost.

Definition at line 225 of file bacp.cpp.

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

Print solution.

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

Definition at line 230 of file bacp.cpp.

Friends And Related Function Documentation

const Course courses8[]
related
Initial value:
=
{
{"dew100", 1},
{"fis100", 3},
{"hcw310", 1},{"iwg101", 2},{"mat190", 4},{"mat192", 4},{"dew101", 1},
{"fis101", 5},{"iwi131", 3},{"mat191", 4},{"mat193", 4},{"fis102", 5},{"hxwxx1", 1},
{"iei134", 3},{"iei141", 3},{"mat194", 4},
{"dewxx0", 1},{"hcw311", 1},{"iei132", 3},{"iei133", 3},{"iei142", 3},{"iei162", 3},
{"iwn170", 3},{"mat195", 3},{"hxwxx2", 1},{"iei231", 4},{"iei241", 4},{"iei271", 3},{"iei281", 3},{"iwn261", 3},
{"hfw120", 2},{"iei233", 4},{"iei238", 3},{"iei261", 3},{"iei272", 3},{"iei273", 3},{"iei161", 3},{"iei232", 3},
{"iei262", 3},{"iei274", 3},{"iwi365", 3},{"iwn270", 3},{"hrw130", 2},{"iei218", 3},{"iei219", 3},{"iei248", 3},
{0,0}
}

Courses for first example.

Definition at line 279 of file bacp.cpp.

const char* prereqs8[]
related

Prerequisites for first example.

Definition at line 294 of file bacp.cpp.

const Course courses10[]
related

Courses for second example.

Definition at line 338 of file bacp.cpp.

const char* prereqs10[]
related

Prerequisites for second example.

Definition at line 385 of file bacp.cpp.

const Course courses12[]
related

Courses for third example.

Definition at line 424 of file bacp.cpp.

const char* prereqs12[]
related

Prerequisites for third example.

Definition at line 495 of file bacp.cpp.

const Curriculum curriculum[]
related
Initial value:
=
{ { 8, 10, 24, 2, 10,
},
{ 10, 10, 24, 2, 10,
},
{ 12, 10, 24, 2, 10,
}
}

The example specifications.

Definition at line 565 of file bacp.cpp.

const unsigned int n_examples = sizeof(curriculum) / sizeof(Curriculum)
related

The number of examples.

Definition at line 578 of file bacp.cpp.

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

Main-function.

Definition at line 253 of file bacp.cpp.

Member Data Documentation

const Curriculum BACP::curr
protected

The curriculum to be scheduled.

Definition at line 103 of file bacp.cpp.

IntVarArray BACP::l
protected

Academic load for each period.

Definition at line 106 of file bacp.cpp.

IntVar BACP::u
protected

Maximum academic load.

Definition at line 108 of file bacp.cpp.

IntVarArray BACP::q
protected

Number of courses assigned to a period.

Definition at line 110 of file bacp.cpp.

IntVarArray BACP::x
protected

Period to which a course is assigned.

Definition at line 113 of file bacp.cpp.


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