Generated on Fri Jul 13 2018 06:08:35 for Gecode by doxygen 1.8.14
TSP Class Reference

Example: Travelling salesman problem (TSP) More...

Public Member Functions

 TSP (const SizeOptions &opt)
 Actual model. More...
 
virtual IntVar cost (void) const
 Return solution cost. More...
 
 TSP (bool share, TSP &s)
 Constructor for cloning s. More...
 
virtual Spacecopy (bool share)
 Copy during cloning. 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...
 

Protected Attributes

Problem p
 Problem instance to be solved. More...
 
IntVarArray succ
 Successor edges. More...
 
IntVar total
 Total cost of travel. More...
 

Related Functions

(Note that these are not member functions.)

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

Additional Inherited Members

- Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
static std::ostream & select_ostream (const char *sn, std::ofstream &ofs)
 Choose output stream according to sn. More...
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

Detailed Description

Example: Travelling salesman problem (TSP)

Simple travelling salesman problem instances. Just meant as a test for circuit.

Definition at line 231 of file tsp.cpp.

Constructor & Destructor Documentation

◆ TSP() [1/2]

TSP::TSP ( const SizeOptions opt)
inline

Actual model.

Definition at line 241 of file tsp.cpp.

◆ TSP() [2/2]

TSP::TSP ( bool  share,
TSP s 
)
inline

Constructor for cloning s.

Definition at line 281 of file tsp.cpp.

Member Function Documentation

◆ cost()

virtual IntVar TSP::cost ( void  ) const
inlinevirtual

Return solution cost.

Definition at line 277 of file tsp.cpp.

◆ copy()

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

Copy during cloning.

Definition at line 287 of file tsp.cpp.

◆ print()

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

Print solution.

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

Definition at line 292 of file tsp.cpp.

Friends And Related Function Documentation

◆ main()

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

Main-function.

Definition at line 325 of file tsp.cpp.

Member Data Documentation

◆ p

Problem TSP::p
protected

Problem instance to be solved.

Definition at line 234 of file tsp.cpp.

◆ succ

IntVarArray TSP::succ
protected

Successor edges.

Definition at line 236 of file tsp.cpp.

◆ total

IntVar TSP::total
protected

Total cost of travel.

Definition at line 238 of file tsp.cpp.


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