Generated on Fri Jun 2 2017 20:49:43 for Gecode by doxygen 1.8.13
ArchimedeanSpiral Class Reference

Example: Archimedean spiral More...

Public Member Functions

 ArchimedeanSpiral (const Options &opt)
 Actual model. More...
 
 ArchimedeanSpiral (bool share, ArchimedeanSpiral &p)
 Constructor for cloning p. More...
 
virtual Spacecopy (bool share)
 Copy during cloning. More...
 
virtual FloatVar cost (void) const
 Cost function. More...
 
virtual void print (std::ostream &os) const
 Print solution coordinates. 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

FloatVarArray f
 The numbers. 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 *name, std::ofstream &ofs)
 Choose output stream according to name. More...
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

Detailed Description

Example: Archimedean spiral

The Archimedean Spiral is a spiral where all points corresponding to the locations over time of a point moving away from a fixed point with a constant speed along a line which rotates with constant angular velocity. It is defined by the polar equation:

\[ r = a+b\theta \]

To get cartesian coordinates, it can be solved for $x$ and $y$ in terms of $r$ and $\theta$. By setting $a=1$ and $b=1$, it yields to the equation:

\[ r = \theta \]

with

\[ x=r\operatorname{cos}(\theta), \quad y=r\operatorname{sin}(\theta) \]

The tuple $(r,\theta)$ is related to the position for $x$ and $y$ on the curve. $r$ and $\theta$ are positive numbers.

To get reasonable interval starting * sizes, $x$ and $y$ are restricted to $[-20;20]$.

Definition at line 71 of file archimedean-spiral.cpp.

Constructor & Destructor Documentation

◆ ArchimedeanSpiral() [1/2]

ArchimedeanSpiral::ArchimedeanSpiral ( const Options opt)
inline

Actual model.

Definition at line 77 of file archimedean-spiral.cpp.

◆ ArchimedeanSpiral() [2/2]

ArchimedeanSpiral::ArchimedeanSpiral ( bool  share,
ArchimedeanSpiral p 
)
inline

Constructor for cloning p.

Definition at line 95 of file archimedean-spiral.cpp.

Member Function Documentation

◆ copy()

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

Copy during cloning.

Definition at line 100 of file archimedean-spiral.cpp.

◆ cost()

virtual FloatVar ArchimedeanSpiral::cost ( void  ) const
inlinevirtual

Cost function.

Definition at line 104 of file archimedean-spiral.cpp.

◆ print()

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

Print solution coordinates.

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

Definition at line 108 of file archimedean-spiral.cpp.

Friends And Related Function Documentation

◆ main()

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

Main-function.

Definition at line 118 of file archimedean-spiral.cpp.

Member Data Documentation

◆ f

FloatVarArray ArchimedeanSpiral::f
protected

The numbers.

Definition at line 74 of file archimedean-spiral.cpp.


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