From 92c5137bd61e28a10264855a036aa8bfe6e33938 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Wed, 8 Jan 2020 14:39:45 +0100 Subject: [PATCH] Add number of cusps computation --- api/psp.h | 4 ++++ src/psp.cc | 1 + 2 files changed, 5 insertions(+) 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_++; } } } -- 2.39.2