1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    MSTransportable.h
11 /// @author  Michael Behrisch
12 /// @date    Tue, 21 Apr 2015
13 /// @version $Id$
14 ///
15 // The common superclass for modelling transportable objects like persons and containers
16 /****************************************************************************/
17 #ifndef MSTransportable_h
18 #define MSTransportable_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <set>
26 #include <cassert>
27 #include <utils/common/SUMOTime.h>
28 #include <utils/common/SUMOVehicleClass.h>
29 #include <utils/geom/Position.h>
30 #include <utils/geom/PositionVector.h>
31 #include <utils/geom/Boundary.h>
32 #include <utils/router/SUMOAbstractRouter.h>
33 #include <utils/vehicle/SUMOTrafficObject.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class MSEdge;
40 class MSLane;
41 class MSNet;
42 class MSStoppingPlace;
43 class MSVehicleType;
44 class OutputDevice;
45 class SUMOVehicleParameter;
46 class SUMOVehicle;
47 class MSTransportableDevice;
48 
49 typedef std::vector<const MSEdge*> ConstMSEdgeVector;
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
54 /**
55   * @class MSTransportable
56   *
57   * The class holds a simulated moveable object
58   */
59 class MSTransportable : public SUMOTrafficObject {
60 public:
61     enum StageType {
62         WAITING_FOR_DEPART = 0,
63         WAITING = 1,
64         MOVING_WITHOUT_VEHICLE = 2, // walking for persons, tranship for containers
65         DRIVING = 3,
66         ACCESS = 4,
67         TRIP = 5
68     };
69 
70     /**
71     * The "abstract" class for a single stage of a movement
72     * Contains the destination of the current movement step
73     */
74     class Stage {
75     public:
76         /// constructor
77         Stage(const MSEdge* destination, MSStoppingPlace* toStop, const double arrivalPos, StageType type);
78 
79         /// destructor
80         virtual ~Stage();
81 
82         /// returns the destination edge
83         const MSEdge* getDestination() const;
84 
85         /// returns the destination stop (if any)
getDestinationStop()86         MSStoppingPlace* getDestinationStop() const {
87             return myDestinationStop;
88         }
89 
90         /// returns the origin stop (if any). only needed for Stage_Trip
getOriginStop()91         virtual const MSStoppingPlace* getOriginStop() const {
92             return nullptr;
93         }
94 
getArrivalPos()95         double getArrivalPos() const {
96             return myArrivalPos;
97         }
98 
99         /// Returns the current edge
100         virtual const MSEdge* getEdge() const;
101         virtual const MSEdge* getFromEdge() const;
102         virtual double getEdgePos(SUMOTime now) const;
103 
104         /// returns the position of the transportable
105         virtual Position getPosition(SUMOTime now) const = 0;
106 
107         /// returns the angle of the transportable
108         virtual double getAngle(SUMOTime now) const = 0;
109 
110         ///
getStageType()111         StageType getStageType() const {
112             return myType;
113         }
114 
115         /// @brief return (brief) string representation of the current stage
116         virtual std::string getStageDescription() const = 0;
117 
118         /// @brief return string summary of the current stage
119         virtual std::string getStageSummary() const = 0;
120 
121         /// proceeds to this stage
122         virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, Stage* previous) = 0;
123 
124         /// abort this stage (TraCI)
abort(MSTransportable *)125         virtual void abort(MSTransportable*) {};
126 
127         /// sets the walking speed (ignored in other stages)
setSpeed(double)128         virtual void setSpeed(double) {};
129 
130         /// get departure time of stage
131         SUMOTime getDeparted() const;
132 
133         /// logs end of the step
134         void setDeparted(SUMOTime now);
135 
136         /// logs end of the step
137         virtual void setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now);
138 
139         /// Whether the transportable waits for the given vehicle
140         virtual bool isWaitingFor(const SUMOVehicle* vehicle) const;
141 
142         /// @brief Whether the transportable waits for a vehicle
isWaiting4Vehicle()143         virtual bool isWaiting4Vehicle() const {
144             return false;
145         }
146 
147         /// @brief Whether the transportable waits for a vehicle
getVehicle()148         virtual SUMOVehicle* getVehicle() const {
149             return nullptr;
150         }
151 
152         /// @brief the time this transportable spent waiting
153         virtual SUMOTime getWaitingTime(SUMOTime now) const;
154 
155         /// @brief the speed of the transportable
156         virtual double getSpeed() const;
157 
158         /// @brief the edges of the current stage
159         virtual ConstMSEdgeVector getEdges() const;
160 
161         /// @brief get position on edge e at length at with orthogonal offset
162         Position getEdgePosition(const MSEdge* e, double at, double offset) const;
163 
164         /// @brief get position on lane at length at with orthogonal offset
165         Position getLanePosition(const MSLane* lane, double at, double offset) const;
166 
167         /// @brief get angle of the edge at a certain position
168         double getEdgeAngle(const MSEdge* e, double at) const;
169 
170         void setDestination(const MSEdge* newDestination, MSStoppingPlace* newDestStop);
171 
172 
173         /** @brief Called on writing tripinfo output
174          * @param[in] os The stream to write the information into
175          * @exception IOError not yet implemented
176          */
177         virtual void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const = 0;
178 
179         /** @brief Called on writing vehroute output
180          * @param[in] os The stream to write the information into
181          * @param[in] withRouteLength whether route length shall be written
182          * @exception IOError not yet implemented
183          */
184         virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const = 0;
185 
186         /** @brief Called for writing the events output (begin of an action)
187          * @param[in] os The stream to write the information into
188          * @exception IOError not yet implemented
189          */
190         virtual void beginEventOutput(const MSTransportable& transportable, SUMOTime t, OutputDevice& os) const = 0;
191 
192         /** @brief Called for writing the events output (end of an action)
193          * @param[in] os The stream to write the information into
194          * @exception IOError not yet implemented
195          */
196         virtual void endEventOutput(const MSTransportable& transportable, SUMOTime t, OutputDevice& os) const = 0;
197 
198         virtual Stage* clone() const = 0;
199 
200     protected:
201         /// the next edge to reach by getting transported
202         const MSEdge* myDestination;
203 
204         /// the stop to reach by getting transported (if any)
205         MSStoppingPlace* myDestinationStop;
206 
207         /// the position at which we want to arrive
208         double myArrivalPos;
209 
210         /// the time at which this stage started
211         SUMOTime myDeparted;
212 
213         /// the time at which this stage ended
214         SUMOTime myArrived;
215 
216         /// The type of this stage
217         StageType myType;
218 
219     private:
220         /// @brief Invalidated copy constructor.
221         Stage(const Stage&);
222 
223         /// @brief Invalidated assignment operator.
224         Stage& operator=(const Stage&);
225 
226     };
227 
228     /**
229     * A "placeholder" stage storing routing info which will result in real stages when routed
230     */
231     class Stage_Trip : public Stage {
232     public:
233         /// constructor
234         Stage_Trip(const MSEdge* origin, MSStoppingPlace* fromStop,
235                    const MSEdge* destination, MSStoppingPlace* toStop,
236                    const SUMOTime duration, const SVCPermissions modeSet,
237                    const std::string& vTypes, const double speed, const double walkFactor,
238                    const double departPosLat, const bool hasArrivalPos, const double arrivalPos);
239 
240         /// destructor
241         virtual ~Stage_Trip();
242 
243         Stage* clone() const;
244 
245         const MSEdge* getEdge() const;
246 
getOriginStop()247         const MSStoppingPlace* getOriginStop() const {
248             return myOriginStop;
249         }
250 
251         double getEdgePos(SUMOTime now) const;
252 
253         Position getPosition(SUMOTime now) const;
254 
255         double getAngle(SUMOTime now) const;
256 
getStageDescription()257         std::string getStageDescription() const {
258             return "trip";
259         }
260 
261         std::string getStageSummary() const;
262 
263         /// logs end of the step
264         virtual void setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now);
265 
266         /// change origin for parking area rerouting
setOrigin(const MSEdge * origin)267         void setOrigin(const MSEdge* origin) {
268             myOrigin = origin;
269         }
270 
271         /// proceeds to the next step
272         virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, Stage* previous);
273 
274         /** @brief Called on writing tripinfo output
275         *
276         * @param[in] os The stream to write the information into
277         * @exception IOError not yet implemented
278         */
279         virtual void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const;
280 
281         /** @brief Called on writing vehroute output
282         *
283         * @param[in] os The stream to write the information into
284         * @exception IOError not yet implemented
285         */
286         virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const;
287 
288         /** @brief Called for writing the events output
289         * @param[in] os The stream to write the information into
290         * @exception IOError not yet implemented
291         */
292         virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
293 
294         /** @brief Called for writing the events output (end of an action)
295         * @param[in] os The stream to write the information into
296         * @exception IOError not yet implemented
297         */
298         virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
299 
300     private:
301         /// the origin edge
302         const MSEdge* myOrigin;
303 
304         /// the origin edge
305         const MSStoppingPlace* myOriginStop;
306 
307         /// the time the trip should take (applies to only walking)
308         SUMOTime myDuration;
309 
310         /// @brief The allowed modes of transportation
311         const SVCPermissions myModeSet;
312 
313         /// @brief The possible vehicles to use
314         const std::string myVTypes;
315 
316         /// @brief The walking speed
317         const double mySpeed;
318 
319         /// @brief The factor to apply to walking durations
320         const double myWalkFactor;
321 
322         /// @brief The depart position
323         double myDepartPos;
324 
325         /// @brief The lateral depart position
326         const double myDepartPosLat;
327 
328         /// @brief whether an arrivalPos was in the input
329         const bool myHaveArrivalPos;
330 
331     private:
332         /// @brief Invalidated copy constructor.
333         Stage_Trip(const Stage_Trip&);
334 
335         /// @brief Invalidated assignment operator.
336         Stage_Trip& operator=(const Stage_Trip&);
337 
338     };
339 
340     /**
341     * A "real" stage performing a waiting over the specified time
342     */
343     class Stage_Waiting : public Stage {
344     public:
345         /// constructor
346         Stage_Waiting(const MSEdge* destination, MSStoppingPlace* toStop, SUMOTime duration, SUMOTime until,
347                       double pos, const std::string& actType, const bool initial);
348 
349         /// destructor
350         virtual ~Stage_Waiting();
351 
352         Stage* clone() const;
353 
354         /// abort this stage (TraCI)
355         void abort(MSTransportable*);
356 
357         SUMOTime getUntil() const;
358 
359         ///
360         Position getPosition(SUMOTime now) const;
361 
362         double getAngle(SUMOTime now) const;
363 
364         SUMOTime getWaitingTime(SUMOTime now) const;
365 
getStageDescription()366         std::string getStageDescription() const {
367             return "waiting (" + myActType + ")";
368         }
369 
370         std::string getStageSummary() const;
371 
372         /// proceeds to the next step
373         virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, Stage* previous);
374 
375         /** @brief Called on writing tripinfo output
376         *
377         * @param[in] os The stream to write the information into
378         * @exception IOError not yet implemented
379         */
380         virtual void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const;
381 
382         /** @brief Called on writing vehroute output
383         *
384         * @param[in] os The stream to write the information into
385         * @exception IOError not yet implemented
386         */
387         virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const;
388 
389         /** @brief Called for writing the events output
390         * @param[in] os The stream to write the information into
391         * @exception IOError not yet implemented
392         */
393         virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
394 
395         /** @brief Called for writing the events output (end of an action)
396         * @param[in] os The stream to write the information into
397         * @exception IOError not yet implemented
398         */
399         virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
400 
401     private:
402         /// the time the person is waiting
403         SUMOTime myWaitingDuration;
404 
405         /// the time until the person is waiting
406         SUMOTime myWaitingUntil;
407 
408         /// @brief The type of activity
409         std::string myActType;
410 
411     private:
412         /// @brief Invalidated copy constructor.
413         Stage_Waiting(const Stage_Waiting&);
414 
415         /// @brief Invalidated assignment operator.
416         Stage_Waiting& operator=(const Stage_Waiting&);
417 
418     };
419 
420     /**
421     * A "real" stage performing the travelling by a transport system
422     * The given route will be chosen. The travel time is computed by the simulation
423     */
424     class Stage_Driving : public Stage {
425     public:
426         /// constructor
427         Stage_Driving(const MSEdge* destination, MSStoppingPlace* toStop,
428                       const double arrivalPos, const std::vector<std::string>& lines,
429                       const std::string& intendedVeh = "", SUMOTime intendedDepart = -1);
430 
431         /// destructor
432         virtual ~Stage_Driving();
433 
434         /// abort this stage (TraCI)
435         void abort(MSTransportable*);
436 
437         /// Returns the current edge
438         const MSEdge* getEdge() const;
439         const MSEdge* getFromEdge() const;
440         double getEdgePos(SUMOTime now) const;
441 
442         ///
443         Position getPosition(SUMOTime now) const;
444 
445         double getAngle(SUMOTime now) const;
446 
447         /// Whether the person waits for the given vehicle
448         bool isWaitingFor(const SUMOVehicle* vehicle) const;
449 
450         /// @brief Whether the person waits for a vehicle
451         bool isWaiting4Vehicle() const;
452 
453         /// @brief Return where the person waits and for what
454         std::string getWaitingDescription() const;
455 
getVehicle()456         SUMOVehicle* getVehicle() const {
457             return myVehicle;
458         }
459 
460         /// @brief time spent waiting for a ride
461         SUMOTime getWaitingTime(SUMOTime now) const;
462 
463         double getSpeed() const;
464 
465         ConstMSEdgeVector getEdges() const;
466 
467         void setVehicle(SUMOVehicle* v);
468 
469         /// @brief marks arrival time and records driven distance
470         void setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now);
471 
472         /** @brief Called for writing the events output
473         * @param[in] os The stream to write the information into
474         * @exception IOError not yet implemented
475         */
476         virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
477 
478         /** @brief Called for writing the events output (end of an action)
479         * @param[in] os The stream to write the information into
480         * @exception IOError not yet implemented
481         */
482         virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
483 
getLines()484         const std::set<std::string>& getLines() const {
485             return myLines;
486         }
487 
488     protected:
489         /// the lines  to choose from
490         const std::set<std::string> myLines;
491 
492         /// @brief The taken vehicle
493         SUMOVehicle* myVehicle;
494         /// @brief cached vehicle data for output after the vehicle has been removed
495         std::string myVehicleID;
496         std::string myVehicleLine;
497 
498         SUMOVehicleClass myVehicleVClass;
499         double myVehicleDistance;
500 
501         double myWaitingPos;
502         /// @brief The time since which this person is waiting for a ride
503         SUMOTime myWaitingSince;
504         const MSEdge* myWaitingEdge;
505         Position myStopWaitPos;
506 
507         std::string myIntendedVehicleID;
508         SUMOTime myIntendedDepart;
509 
510     private:
511         /// @brief Invalidated copy constructor.
512         Stage_Driving(const Stage_Driving&);
513 
514         /// @brief Invalidated assignment operator.
515         Stage_Driving& operator=(const Stage_Driving&);
516 
517     };
518 
519     /// @name inherited from SUMOTrafficObject
520     /// @{
isVehicle()521     bool isVehicle() const {
522         return false;
523     }
524 
isStopped()525     bool isStopped() const {
526         return getCurrentStageType() == WAITING;
527     }
528 
529     double getSlope() const;
530 
getChosenSpeedFactor()531     double getChosenSpeedFactor() const {
532         return 1.0;
533     }
534 
535     SUMOVehicleClass getVClass() const;
536 
537     double getMaxSpeed() const;
538 
539     SUMOTime getWaitingTime() const;
540 
getPreviousSpeed()541     double getPreviousSpeed() const {
542         return getSpeed();
543     }
544 
getAcceleration()545     double getAcceleration() const {
546         return 0.0;
547     }
548 
getPositionOnLane()549     double getPositionOnLane() const {
550         return getEdgePos();
551     }
552 
getBackPositionOnLane(const MSLane *)553     double getBackPositionOnLane(const MSLane* /*lane*/) const {
554         return getEdgePos();
555     }
556 
getPosition(const double)557     Position getPosition(const double /*offset*/) const {
558         return getPosition();
559     }
560     /// @}
561 
562     /// the structure holding the plan of a transportable
563     typedef std::vector<MSTransportable::Stage*> MSTransportablePlan;
564 
565     /// constructor
566     MSTransportable(const SUMOVehicleParameter* pars, MSVehicleType* vtype, MSTransportablePlan* plan);
567 
568     /// destructor
569     virtual ~MSTransportable();
570 
571     /* @brief proceeds to the next step of the route,
572      * @return Whether the transportables plan continues  */
573     virtual bool proceed(MSNet* net, SUMOTime time) = 0;
574 
575     /// returns the id of the transportable
576     const std::string& getID() const;
577 
getParameter()578     inline const SUMOVehicleParameter& getParameter() const {
579         return *myParameter;
580     }
581 
getVehicleType()582     inline const MSVehicleType& getVehicleType() const {
583         return *myVType;
584     }
585 
586     /// Returns the desired departure time.
587     SUMOTime getDesiredDepart() const;
588 
589     /// logs depart time of the current stage
590     void setDeparted(SUMOTime now);
591 
592     /// Returns the current destination.
getDestination()593     const MSEdge* getDestination() const {
594         return (*myStep)->getDestination();
595     }
596 
597     /// Returns the destination after the current destination.
getNextDestination()598     const MSEdge* getNextDestination() const {
599         return (*(myStep + 1))->getDestination();
600     }
601 
602     /// @brief Returns the current edge
getEdge()603     const MSEdge* getEdge() const {
604         return (*myStep)->getEdge();
605     }
606 
607     /// @brief Returns the departure edge
getFromEdge()608     const MSEdge* getFromEdge() const {
609         return (*myStep)->getFromEdge();
610     }
611 
612     /// @brief Return the position on the edge
613     virtual double getEdgePos() const;
614 
615     /// @brief Return the Network coordinate of the transportable
616     virtual Position getPosition() const;
617 
618     /// @brief return the current angle of the transportable
619     virtual double getAngle() const;
620 
621     /// @brief the time this transportable spent waiting in seconds
622     virtual double getWaitingSeconds() const;
623 
624     /// @brief the current speed of the transportable
625     virtual double getSpeed() const;
626 
627     /// @brief the current speed factor of the transportable (where applicable)
getSpeedFactor()628     virtual double getSpeedFactor() const {
629         return 1;
630     }
631 
632     /// @brief the current stage type of the transportable
getCurrentStageType()633     StageType getCurrentStageType() const {
634         return (*myStep)->getStageType();
635     }
636 
637     /// @brief the stage type for the nth next stage
getStageType(int next)638     StageType getStageType(int next) const {
639         assert(myStep + next < myPlan->end());
640         assert(myStep + next >= myPlan->begin());
641         return (*(myStep + next))->getStageType();
642     }
643 
644     /// @brief return textual summary for the given stage
645     std::string getStageSummary(int stageIndex) const;
646 
647     /// Returns the current stage description as a string
getCurrentStageDescription()648     std::string getCurrentStageDescription() const {
649         return (*myStep)->getStageDescription();
650     }
651 
652     /// @brief Return the current stage
getCurrentStage()653     MSTransportable::Stage* getCurrentStage() const {
654         return *myStep;
655     }
656 
657     /// @brief Return the current stage
getNextStage(int next)658     MSTransportable::Stage* getNextStage(int next) const {
659         assert(myStep + next >= myPlan->begin());
660         assert(myStep + next < myPlan->end());
661         return *(myStep + next);
662     }
663 
664     /// @brief Return the edges of the nth next stage
getEdges(int next)665     ConstMSEdgeVector getEdges(int next) const {
666         assert(myStep + next < myPlan->end());
667         assert(myStep + next >= myPlan->begin());
668         return (*(myStep + next))->getEdges();
669     }
670 
671     /// @brief Return the number of remaining stages (including the current)
672     int getNumRemainingStages() const;
673 
674     /// @brief Return the total number stages in this persons plan
675     int getNumStages() const;
676 
677     /** @brief Called on writing tripinfo output
678      *
679      * @param[in] os The stream to write the information into
680      * @exception IOError not yet implemented
681      */
682     virtual void tripInfoOutput(OutputDevice& os) const = 0;
683 
684     /** @brief Called on writing vehroute output
685      *
686      * @param[in] os The stream to write the information into
687      * @exception IOError not yet implemented
688      */
689     virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const = 0;
690 
691     /// Whether the transportable waits for the given vehicle in the current step
isWaitingFor(const SUMOVehicle * vehicle)692     bool isWaitingFor(const SUMOVehicle* vehicle) const {
693         return (*myStep)->isWaitingFor(vehicle);
694     }
695 
696     /// @brief Whether the transportable waits for a vehicle
isWaiting4Vehicle()697     bool isWaiting4Vehicle() const {
698         return (*myStep)->isWaiting4Vehicle();
699     }
700 
701     /// @brief The vehicle associated with this transportable
getVehicle()702     SUMOVehicle* getVehicle() const {
703         return (*myStep)->getVehicle();
704     }
705 
706     /// @brief Appends the given stage to the current plan
707     void appendStage(Stage* stage, int next = -1);
708 
709     /// @brief removes the nth next stage
710     void removeStage(int next);
711 
712     /// sets the walking speed (ignored in other stages)
713     void setSpeed(double speed);
714 
715     /// @brief returns the final arrival pos
getArrivalPos()716     double getArrivalPos() const {
717         return myPlan->back()->getArrivalPos();
718     }
719 
720     /// @brief returns the final arrival edge
getArrivalEdge()721     const MSEdge* getArrivalEdge() const {
722         return myPlan->back()->getEdges().back();
723     }
724 
725     /** @brief Replaces the current vehicle type by the one given
726     *
727     * If the currently used vehicle type is marked as being used by this vehicle
728     *  only, it is deleted, first. The new, given type is then assigned to
729     *  "myVType".
730     * @param[in] type The new vehicle type
731     * @see MSTransportable::myVType
732     */
733     void replaceVehicleType(MSVehicleType* type);
734 
735 
736     /** @brief Replaces the current vehicle type with a new one used by this vehicle only
737     *
738     * If the currently used vehicle type is already marked as being used by this vehicle
739     *  only, no new type is created.
740     * @return The new modifiable vehicle type
741     * @see MSTransportable::myVType
742     */
743     MSVehicleType& getSingularType();
744 
745 
746     /// @brief return the bounding box of the person
747     PositionVector getBoundingBox() const;
748 
749     /// @brief return whether the person has reached the end of its plan
750     bool hasArrived() const;
751 
752     /// @brief return whether the transportable has started it's plan
753     bool hasDeparted() const;
754 
755     /// @brief adapt plan when the vehicle reroutes and now stops at replacement instead of orig
756     void rerouteParkingArea(MSStoppingPlace* orig, MSStoppingPlace* replacement);
757 
758     /// @brief Returns a device of the given type if it exists or 0
759     MSTransportableDevice* getDevice(const std::type_info& type) const;
760 
761     /** @brief Returns this vehicle's devices
762      * @return This vehicle's devices
763      */
getDevices()764     inline const std::vector<MSTransportableDevice*>& getDevices() const {
765         return myDevices;
766     }
767 
768 protected:
769     /// @brief the offset for computing positions when standing at an edge
770     static const double ROADSIDE_OFFSET;
771 
772     /// the plan of the transportable
773     const SUMOVehicleParameter* myParameter;
774 
775     /// @brief This transportable's type. (mainly used for drawing related information
776     /// Note sure if it is really necessary
777     MSVehicleType* myVType;
778 
779     /// @brief Whether events shall be written
780     bool myWriteEvents;
781 
782     /// the plan of the transportable
783     MSTransportablePlan* myPlan;
784 
785     /// the iterator over the route
786     MSTransportablePlan::iterator myStep;
787 
788     /// @brief The devices this transportable has
789     std::vector<MSTransportableDevice*> myDevices;
790 
791 private:
792     /// @brief Invalidated copy constructor.
793     MSTransportable(const MSTransportable&);
794 
795     /// @brief Invalidated assignment operator.
796     MSTransportable& operator=(const MSTransportable&);
797 
798 };
799 
800 
801 #endif
802 
803 /****************************************************************************/
804