Example: Archimedean spiral More...
Public Member Functions | |
ArchimedeanSpiral (const Options &) | |
Actual model. | |
ArchimedeanSpiral (bool share, ArchimedeanSpiral &p) | |
Constructor for cloning p. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
virtual void | constrain (const Space &_b) |
Add constraint to current model to get next solution (not too close) | |
virtual void | print (std::ostream &os) const |
Print solution coordinates. | |
Protected Attributes | |
FloatVarArray | f |
The numbers. | |
FloatNum | step |
Minimum distance between two solutions. | |
Related Functions | |
(Note that these are not member functions.) | |
int | main (int argc, char *argv[]) |
Main-function. |
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:
To get cartesian coordinates, it can be solved for and
in terms of
and
. By setting
and
, it yields to the equation:
with
The tuple is related to the position for
and
on the curve.
and
are positive numbers.
To get reasonable interval starting * sizes, and
are restricted to
.
Definition at line 71 of file archimedean-spiral.cpp.
ArchimedeanSpiral::ArchimedeanSpiral | ( | const Options & | ) | [inline] |
Actual model.
Definition at line 79 of file archimedean-spiral.cpp.
ArchimedeanSpiral::ArchimedeanSpiral | ( | bool | share, |
ArchimedeanSpiral & | p | ||
) | [inline] |
Constructor for cloning p.
Definition at line 97 of file archimedean-spiral.cpp.
virtual Space* ArchimedeanSpiral::copy | ( | bool | share | ) | [inline, virtual] |
Copy during cloning.
Definition at line 102 of file archimedean-spiral.cpp.
virtual void ArchimedeanSpiral::constrain | ( | const Space & | _b | ) | [inline, virtual] |
Add constraint to current model to get next solution (not too close)
Definition at line 106 of file archimedean-spiral.cpp.
virtual void ArchimedeanSpiral::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print solution coordinates.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 111 of file archimedean-spiral.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) | [related] |
Main-function.
Definition at line 121 of file archimedean-spiral.cpp.
FloatVarArray ArchimedeanSpiral::f [protected] |
The numbers.
Definition at line 74 of file archimedean-spiral.cpp.
FloatNum ArchimedeanSpiral::step [protected] |
Minimum distance between two solutions.
Definition at line 76 of file archimedean-spiral.cpp.