Generated on Thu Apr 11 13:59:33 2019 for Gecode by doxygen 1.6.3

Setting up scripts
[Programming models]

Functions

 Gecode::Space::Space (void)
 Default constructor.
 Gecode::Space::Space (Space &s)
 Constructor for cloning.
virtual Gecode::Space::~Space (void)
 Destructor.
virtual Space * Gecode::Space::copy (void)=0
 Copying member function.
virtual void Gecode::Space::constrain (const Space &best)
 Constrain function for best solution search.
virtual bool Gecode::Space::master (const MetaInfo &mi)
 Master configuration function for meta search engines.
virtual bool Gecode::Space::slave (const MetaInfo &mi)
 Slave configuration function for meta search engines.

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]

Default constructor.

Definition at line 115 of file core.cpp.

Gecode::Space::Space ( Space s  )  [inherited]

Constructor for cloning.

Must copy and update all data structures (such as variables and variable arrays) required by the subclass of Space.

Definition at line 693 of file core.cpp.

Gecode::Space::~Space ( void   )  [virtual, inherited]

Destructor.

Definition at line 186 of file core.cpp.

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::IntLexMinimizeSpace, Gecode::IntLexMaximizeSpace, Gecode::FloatMinimizeSpace, Gecode::FloatMaximizeSpace, Test::Search::FailImmediate, Test::Search::SolveImmediate, and Test::Search::HasSolutions.

Definition at line 841 of file core.cpp.

bool Gecode::Space::master ( const MetaInfo mi  )  [virtual, inherited]

Master configuration function for meta search engines.

This configuration function is used by both restart and portfolio meta search engines.

  • A restart meta search engine calls this function on its master space whenever it finds a solution or exploration restarts. mi contains information about the current restart.

If a solution has been found, then search will continue with a restart id the function returns true, otherwise search will continue.

The default function posts no-goods obtained from mi.

  • A portfolio meta engine calls this function once on the master space. The return value is ignored.

The default function does nothing.

Reimplemented in Test::Search::TestSpace, and Test::Search::HasSolutions.

Definition at line 845 of file core.cpp.

bool Gecode::Space::slave ( const MetaInfo mi  )  [virtual, inherited]

Slave configuration function for meta search engines.

This configuration function is used by both restart and portfolio meta search engines.

  • A restart meta search engine calls this function on its slave space whenever it finds a solution or exploration restarts. mi 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.

  • A portfolio meta engine calls this function once on each asset (that is, on each slave) and passes the number of the asset, starting from zero.

The default function does nothing and returns true.

Reimplemented in Gecode::FlatZinc::FlatZincSpace.

Definition at line 863 of file core.cpp.