Setting up scripts
[Programming models]
Functions | |
Gecode::Space::Space (void) | |
Default constructor. | |
virtual | Gecode::Space::~Space (void) |
Destructor. | |
Gecode::Space::Space (bool share, Space &s) | |
Constructor for cloning. | |
virtual Space * | Gecode::Space::copy (bool share)=0 |
Copying member function. | |
virtual void | Gecode::Space::constrain (const Space &best) |
Constrain function for best solution search. | |
virtual bool | Gecode::Space::master (const CRI &cri) |
Master configuration function for restart meta search engine. | |
virtual bool | Gecode::Space::slave (const CRI &cri) |
Slave configuration function for restart meta search engine. | |
static void * | Gecode::Space::operator new (size_t) |
Allocate memory from heap for new space. | |
static void | Gecode::Space::operator delete (void *) |
Free memory allocated from heap. |
Detailed Description
Scripts (or models) are programmed by inheriting from the class Gecode::Space. For many examples see Example scripts (models).
Function Documentation
Gecode::Space::Space | ( | void | ) | [inherited] |
Gecode::Space::~Space | ( | void | ) | [virtual, inherited] |
Gecode::Space::Space | ( | bool | share, | |
Space & | s | |||
) | [inherited] |
virtual Space* Gecode::Space::copy | ( | bool | share | ) | [pure virtual, inherited] |
Copying member function.
Must create a new object using the constructor for cloning.
Implemented in Gecode::FlatZinc::FlatZincSpace, Test::AFC::TestSpace, Test::Array::TestSpace, Test::Assign::IntTestSpace, Test::Assign::BoolTestSpace, Test::Assign::SetTestSpace, Test::Assign::FloatTestSpace, Test::Branch::IntTestSpace, Test::Branch::BoolTestSpace, Test::Branch::SetTestSpace, Test::Branch::FloatTestSpace, Test::BrancherHandle::TestSpace, Test::Float::TestSpace, Test::Int::BinPacking::CliqueMBPT::TestSpace, Test::Int::Cumulatives::Ass, Test::Int::Distinct::Pathological::TestSpace, Test::Int::TestSpace, Test::LDSB::OneArray, Test::LDSB::OneArraySet, Test::LDSB::LDSBLatin::Latin, Test::NoGoods::Queens, Test::NoGoods::Hamming, Test::Search::FailImmediate, Test::Search::SolveImmediate, Test::Search::HasSolutions, Test::Set::FakeSpace, and Test::Set::SetTestSpace.
void Gecode::Space::constrain | ( | const Space & | best | ) | [virtual, inherited] |
Constrain function for best solution search.
Must constrain this space to be better than the so far best solution best.
The default function does nothing.
Reimplemented in Gecode::FlatZinc::FlatZincSpace, Gecode::IntMinimizeSpace, Gecode::IntMaximizeSpace, Gecode::FloatMinimizeSpace, Gecode::FloatMaximizeSpace, Test::Search::FailImmediate, Test::Search::SolveImmediate, and Test::Search::HasSolutions.
bool Gecode::Space::master | ( | const CRI & | cri | ) | [virtual, inherited] |
Master configuration function for restart meta search engine.
A restart meta search engine calls this function on its master space whenever it finds a solution or exploration restarts. cri contains information about the current restart.
If a solution has been found, then search will continue with a restart when the function returns true, otherwise search will continue.
The default function posts no-goods obtained from cri.
Reimplemented in Test::Search::TestSpace.
bool Gecode::Space::slave | ( | const CRI & | cri | ) | [virtual, inherited] |
Slave configuration function for restart meta search engine.
A restart meta search engine calls this function on its slave space whenever it finds a solution or exploration restarts. cri contains information about the current restart.
If the function returns true, the search on the slave space is considered complete, i.e., if it fails or exhaustively explores the entire search space, the meta search engine finishes. If the function returns false, the search on the slave space is considered incomplete, and the meta engine will restart the search regardless of whether the search on the slave space finishes or times out.
The default function does nothing and returns true.
Reimplemented in Gecode::FlatZinc::FlatZincSpace.
void * Gecode::Space::operator new | ( | size_t | s | ) | [inline, static, inherited] |