Gecode::Driver::ScriptBase< BaseSpace > Class Template Reference

Parametric base-class for scripts. More...

`#include <driver.hh>`

## Public Member Functions

| ScriptBase (const Options &opt)
| Constructor.
| ScriptBase (ScriptBase &e)
| Constructor used for cloning.
virtual void | print (std::ostream &os) const
| Print a solution to os.
virtual void | compare (const Space &home, std::ostream &os) const
| Compare with s.

## Static Public Member Functions

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

template<class BaseSpace>
class Gecode::Driver::ScriptBase< BaseSpace >

Parametric base-class for scripts.

All scripts must inherit from this class

- adds printing and comparison for Gist to scripts
- run allows to execute scripts

Definition at line 729 of file driver.hh.

## Constructor & Destructor Documentation

## ScriptBase() [1/2]

template<class BaseSpace>

Gecode::Driver::ScriptBase< BaseSpace >::ScriptBase | ( | const Options & | opt | ) |

inline

Constructor.

Definition at line 229 of file script.hpp.

## ScriptBase() [2/2]

template<class BaseSpace>

Gecode::Driver::ScriptBase< BaseSpace >::ScriptBase | ( | ScriptBase< BaseSpace > & | e | ) |

inline

Constructor used for cloning.

Definition at line 234 of file script.hpp.

## Member Function Documentation

## print()

template<class BaseSpace>

void Gecode::Driver::ScriptBase< BaseSpace >::print | ( | std::ostream & | os | ) | const

virtual

Print a solution to os.

Reimplemented in AllInterval, Alpha, ArchimedeanSpiral, BACP, BIBD, BinPacking, BlackHole, CarSequencing, CartesianHeart, ColoredMatrix, Crew, Crossword, CrowdedChess, DescartesFolium, DominatingQueens, Domino, Donald, EFPA, Eq20, GoldenSpiral, Golf, GolombRuler, GraphColor, Grocery, Hamming, IndSet, JobShopBase, Kakuro, Knights, LangfordNumber, LexCostWarehouses, MagicSequence, MagicSquare, MagicSquare, MineSweeper, Money, MultiBinPacking, Nonogram, OpenShop, OrthoLatinSquare, Partition, Pentominoes, PerfectSquare, Photo, QCP, QueenArmies, Queens, Radiotherapy, Sat, Schur, SportsLeague, SteelMill, Steiner, Sudoku, SudokuInt, SudokuMixed, SudokuSet, SumCostWarehouses, TSP, and WordSquare.

Definition at line 239 of file script.hpp.

## compare()

template<class BaseSpace>

void Gecode::Driver::ScriptBase< BaseSpace >::compare | ( | const Space & | home,
|  | std::ostream & | os ) const

virtual

Compare with s.

Definition at line 243 of file script.hpp.

## select_ostream()

template<class BaseSpace>

std::ostream & Gecode::Driver::ScriptBase< BaseSpace >::select_ostream | ( | const char * | sn,
|  | std::ofstream & | ofs )

static

Choose output stream according to sn.

Definition at line 247 of file script.hpp.

## run()

template<class BaseSpace>
template<class Script, template< class > class Engine, class Options>

void Gecode::Driver::ScriptBase< BaseSpace >::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 290 of file script.hpp.

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

- gecode/driver.hh
- gecode/driver/script.hpp