]> rtime.felk.cvut.cz Git - hubacji1/psp.git/commitdiff
Add cusps array
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 9 Jan 2020 15:19:42 +0000 (16:19 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 9 Jan 2020 15:19:42 +0000 (16:19 +0100)
api/psp.h
src/psp.cc

index 0028fde0a827fce274b44c1319992d751410716e..94bebf894fbbd47cb2df0d080e124144fccb5063 100644 (file)
--- a/api/psp.h
+++ b/api/psp.h
@@ -20,6 +20,7 @@ class PSPlanner {
                 ParkingSlot ps_;
 
                 unsigned int c_ = 0; // number of cusps
+                std::vector<BicycleCar> cusps_;
 
                 // find entry to slot
                 void fe_parallel();
@@ -98,6 +99,7 @@ class PSPlanner {
                 ParkingSlot &ps() { return this->ps_; }
 
                 unsigned int c() const { return this->c_; }
+                std::vector<BicycleCar> &cusps() { return this->cusps_; }
 
                 PSPlanner();
 };
index cd3aba8f5081ed4afe1bf794d0f8b0fd4fd34f58..3063ff769b5145b338b9c51f8c575171a810d942 100644 (file)
@@ -399,6 +399,7 @@ void PSPlanner::fer_parallel()
         if (!this->ps().right())
                 this->cc().st(this->cc().st() * -1);
         this->cc().sp(0.01);
+        this->cusps_.clear();
         while (!this->left()) {
                 while (!this->collide() && !this->left())
                         this->cc().next();
@@ -409,6 +410,7 @@ void PSPlanner::fer_parallel()
                         this->cc().next();
                         this->cc().st(this->cc().st() * -1);
                         this->c_++;
+                        this->cusps_.push_back(this->cc());
                 }
         }
 }