From: Jiri Vlasak Date: Wed, 8 Jan 2020 13:39:45 +0000 (+0100) Subject: Add number of cusps computation X-Git-Tag: v0.3.0~2^2~1 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/hubacji1/psp.git/commitdiff_plain/92c5137bd61e28a10264855a036aa8bfe6e33938 Add number of cusps computation --- diff --git a/api/psp.h b/api/psp.h index 91e0b9c..0028fde 100644 --- a/api/psp.h +++ b/api/psp.h @@ -19,6 +19,8 @@ class PSPlanner { BicycleCar gc_; ParkingSlot ps_; + unsigned int c_ = 0; // number of cusps + // find entry to slot void fe_parallel(); void fe_perpendicular(); @@ -95,6 +97,8 @@ class PSPlanner { BicycleCar &gc() { return this->gc_; } ParkingSlot &ps() { return this->ps_; } + unsigned int c() const { return this->c_; } + PSPlanner(); }; diff --git a/src/psp.cc b/src/psp.cc index d4471fb..cd3aba8 100644 --- a/src/psp.cc +++ b/src/psp.cc @@ -408,6 +408,7 @@ void PSPlanner::fer_parallel() this->cc().sp(this->cc().sp() * -1); this->cc().next(); this->cc().st(this->cc().st() * -1); + this->c_++; } } }