Parametric base-class for scripts. More...
#include <driver.hh>
Public Member Functions | |
ScriptBase (void) | |
Default constructor. | |
ScriptBase (bool share, ScriptBase &e) | |
Constructor used for cloning. | |
virtual void | print (std::ostream &os) const |
Print a solution to os. | |
virtual void | compare (const Space &, std::ostream &os) const |
Compare with s. | |
Static Public Member Functions | |
static std::ostream & | select_ostream (const char *name, std::ofstream &ofs) |
Choose output stream according to name. | |
template<class Script , template< class > class Engine, class Options > | |
static void | run (const Options &opt, Script *s=NULL) |
Parametric base-class for scripts.
All scripts must inherit from this class
Gecode::Driver::ScriptBase< BaseSpace >::ScriptBase | ( | void | ) | [inline] |
Gecode::Driver::ScriptBase< BaseSpace >::ScriptBase | ( | bool | share, |
ScriptBase< BaseSpace > & | e | ||
) | [inline] |
virtual void Gecode::Driver::ScriptBase< BaseSpace >::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print a solution to os.
Reimplemented in Kakuro, BinPacking, Pentominoes, ColoredMatrix, GraphColor, SudokuMixed, CarSequencing, CrowdedChess, SudokuSet, SportsLeague, SteelMill, TSP, PerfectSquare, EFPA, OpenShop, BlackHole, BACP, Knights, Radiotherapy, SudokuInt, Domino, Crossword, Nonogram, LangfordNumber, Warehouses, BIBD, Golf, OrthoLatinSquare, QueenArmies, Sat, Crew, Photo, Steiner, DominatingQueens, WordSquare, Alpha, MineSweeper, GoldenSpiral, IndSet, Schur, Hamming, Queens, GolombRuler, MagicSquare, ArchimedeanSpiral, Donald, Partition, DescartesFolium, AllInterval, Eq20, MagicSequence, CartesianHeart, Money, and Grocery.
virtual void Gecode::Driver::ScriptBase< BaseSpace >::compare | ( | const Space & | , |
std::ostream & | os | ||
) | const [inline, virtual] |
std::ostream & Gecode::Driver::ScriptBase< Space >::select_ostream | ( | const char * | name, |
std::ofstream & | ofs | ||
) | [static] |
Choose output stream according to name.
Definition at line 211 of file script.hpp.
void Gecode::Driver::ScriptBase< Space >::run | ( | const Options & | opt, |
Script * | s = NULL |
||
) | [static] |
Run script with search engine Engine and options opt
In the solution and stat modes, search can be aborted by sending SIGINT to the process (i.e., pressing Ctrl-C on the command line).
In case s is different from NULL, the search engine uses s as root of the search tree.
Definition at line 236 of file script.hpp.