SUMO - Simulation of Urban MObility
MSLaneChangerSublane.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // Performs sub-lane changing of vehicles
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2002-2016 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSLaneChangerSublane_h
21 #define MSLaneChangerSublane_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
34 #include "MSLaneChanger.h"
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
50 public:
52  MSLaneChangerSublane(const std::vector<MSLane*>* lanes, bool allowChanging);
53 
56 
57 protected:
58 
60  virtual bool change();
61 
63  virtual void updateChanger(bool vehHasChanged);
64 
73  int laneOffset,
74  const std::vector<MSVehicle::LaneQ>& preb,
75  SUMOReal& latDist) const;
76 
78  bool startChangeSublane(MSVehicle* vehicle, ChangerIt& from, SUMOReal latDist);
79 
81  MSLeaderDistanceInfo getLeaders(const ChangerIt& target, const MSVehicle* ego) const;
82 
85  StateAndDist checkChangeHelper(MSVehicle* vehicle, int laneOffset);
86 
87 private:
90 
93 
96 };
97 
98 
99 #endif
100 
101 /****************************************************************************/
102 
StateAndDist checkChangeHelper(MSVehicle *vehicle, int laneOffset)
helper function that calls checkChangeSublane and sets blocker information
saves leader/follower vehicles and their distances relative to an ego vehicle
Definition: MSLeaderInfo.h:127
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:82
bool startChangeSublane(MSVehicle *vehicle, ChangerIt &from, SUMOReal latDist)
change by the specified amount and return whether a new lane was entered
int checkChangeSublane(int laneOffset, const std::vector< MSVehicle::LaneQ > &preb, SUMOReal &latDist) const
check whether sub-lane changing in the given direction is desirable and possible
virtual void updateChanger(bool vehHasChanged)
Performs lane changing of vehicles.
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:55
MSLaneChangerSublane()
Default constructor.
~MSLaneChangerSublane()
Destructor.
MSLaneChangerSublane & operator=(const MSLaneChangerSublane &)
Assignment operator.
MSLeaderDistanceInfo getLeaders(const ChangerIt &target, const MSVehicle *ego) const
get leaders for ego on the given lane
Changer::iterator ChangerIt
the iterator moving over the ChangeElems
MSAbstractLaneChangeModel::StateAndDist StateAndDist
#define SUMOReal
Definition: config.h:213