]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - incl/pslot.hh
Add compute entries ut, impl
[hubacji1/bcar.git] / incl / pslot.hh
index 843d9f920cb47a5b2d701da78d3bfae03a216629..51fd7c83ee38dfefaeb307c22b3aabc2e23ea86e 100644 (file)
@@ -32,7 +32,8 @@ private:
        Line _curb;
        Line _front;
 public:
-       std::vector<std::vector<BicycleCar>> _entries;
+       std::vector<std::vector<BicycleCar>> _ispaths;
+       std::vector<BicycleCar> _entries;
        /*! \brief Set parking slot.
 
        \param p Point with `x`, `y` coordinates of entry side's corner.
@@ -126,6 +127,12 @@ public:
        /*! Return `true` if `c`'s car frame collide with `this` border. */
        bool collide(BicycleCar const& c) const;
 
+       /*! \brief Set car `c` to the start position.
+        *
+        * \param c Bicycle car.
+        */
+       void set_to_start(BicycleCar& c);
+
        /*! \brief Drive car `c` into the parking slot `this`.
         *
         * \param c Starting bicycle car.
@@ -153,6 +160,19 @@ public:
         */
        PoseRange fe(BicycleCar c);
 
+       /*! \brief Compute entries from `this->_ispaths`.
+        *
+        * The problem with in-slot paths is that car can't leave the parking
+        * slot with full rate to the right (for right sided parking slot.)
+        *
+        * The idea is to move the first cars of in-slot paths (the one that is
+        * computed as entry to the parking slot) with the full rate to the left
+        * until they can leave the parking slot with full rate to the right.
+        *
+        * The computed cars are stored in `this->_entries`.
+        */
+       void compute_entries();
+
        /*! \brief Recompute zero slot's `PoseRange` entry for `this`.
         *
         * The _zero slot_ is the `ParkingSlot(Point(0.0, 0.0), 0.0, W, L);`.
@@ -161,6 +181,9 @@ public:
         */
        PoseRange recompute_entry(PoseRange p);
 
+       /*! Generate output for plotting with gnuplot. */
+       void gen_gnuplot_to(std::ostream& out);
+
        friend std::ostream& operator<<(std::ostream& o, ParkingSlot const& s);
 };