
Example: Archimedean spiral More...
Public Member Functions | |
| ArchimedeanSpiral (const Options &opt) | |
| Actual model. | |
| ArchimedeanSpiral (ArchimedeanSpiral &p) | |
| Constructor for cloning p. | |
| virtual Space * | copy (void) |
| Copy during cloning. | |
| virtual FloatVar | cost (void) const |
| Cost function. | |
| virtual void | print (std::ostream &os) const |
| Print solution coordinates. | |
Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace > | |
| ScriptBase (const Options &opt) | |
| Constructor. | |
| ScriptBase (ScriptBase &e) | |
| Constructor used for cloning. | |
| virtual void | compare (const Space &home, std::ostream &os) const |
| Compare with s. | |
Protected Attributes | |
| FloatVarArray | f |
| The numbers. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| int | main (int argc, char *argv[]) |
| Main-function. | |
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. | |
| template<class Script , template< class > class Engine, class Options > | |
| static void | run (const Options &opt, Script *s=NULL) |
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 \]](form_12.png)
To get cartesian coordinates, it can be solved for 





![\[ r = \theta \]](form_18.png)
with
![\[ x=r\operatorname{cos}(\theta),
\quad y=r\operatorname{sin}(\theta) \]](form_19.png)
The tuple 




To get reasonable interval starting * sizes, 

![$[-20;20]$](form_21.png)
Definition at line 67 of file archimedean-spiral.cpp.
Actual model.
Definition at line 73 of file archimedean-spiral.cpp.
|
inline |
Constructor for cloning p.
Definition at line 91 of file archimedean-spiral.cpp.
Copy during cloning.
Definition at line 96 of file archimedean-spiral.cpp.
Cost function.
Definition at line 100 of file archimedean-spiral.cpp.
Print solution coordinates.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 104 of file archimedean-spiral.cpp.
Main-function.
Definition at line 114 of file archimedean-spiral.cpp.
|
protected |
The numbers.
Definition at line 70 of file archimedean-spiral.cpp.