]> rtime.felk.cvut.cz Git - hubacji1/psp.git/commitdiff
Add number of cusps computation
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 8 Jan 2020 13:39:45 +0000 (14:39 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 8 Jan 2020 13:39:45 +0000 (14:39 +0100)
api/psp.h
src/psp.cc

index 91e0b9c07a35e3fe3ce638f71832298c45fdbbbd..0028fde0a827fce274b44c1319992d751410716e 100644 (file)
--- 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();
 };
 
index d4471fb2647c02de242c37275dfc06a5cec5e432..cd3aba8f5081ed4afe1bf794d0f8b0fd4fd34f58 100644 (file)
@@ -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_++;
                 }
         }
 }