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-2017 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 initChanger();
64 
66  virtual void updateChanger(bool vehHasChanged);
67 
76  int laneOffset,
77  LaneChangeAction alternatives,
78  const std::vector<MSVehicle::LaneQ>& preb,
79  double& latDist) const;
80 
82  bool startChangeSublane(MSVehicle* vehicle, ChangerIt& from, double latDist);
83 
85  MSLeaderDistanceInfo getLeaders(const ChangerIt& target, const MSVehicle* ego) const;
86 
89  StateAndDist checkChangeHelper(MSVehicle* vehicle, int laneOffset, LaneChangeAction alternatives);
90 
91 private:
94 
97 
100 };
101 
102 
103 #endif
104 
105 /****************************************************************************/
106 
saves leader/follower vehicles and their distances relative to an ego vehicle
Definition: MSLeaderInfo.h:136
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
StateAndDist checkChangeHelper(MSVehicle *vehicle, int laneOffset, LaneChangeAction alternatives)
helper function that calls checkChangeSublane and sets blocker information
virtual void updateChanger(bool vehHasChanged)
Performs lane changing of vehicles.
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:55
MSLaneChangerSublane()
Default constructor.
MSLeaderDistanceInfo getLeaders(const ChangerIt &target, const MSVehicle *ego) const
get leaders for ego on the given lane
bool startChangeSublane(MSVehicle *vehicle, ChangerIt &from, double latDist)
change by the specified amount and return whether a new lane was entered
virtual void initChanger()
Initialize the changer before looping over all vehicles.
~MSLaneChangerSublane()
Destructor.
MSLaneChangerSublane & operator=(const MSLaneChangerSublane &)
Assignment operator.
LaneChangeAction
The state of a vehicle&#39;s lane-change behavior.
Changer::iterator ChangerIt
the iterator moving over the ChangeElems
MSAbstractLaneChangeModel::StateAndDist StateAndDist
int checkChangeSublane(int laneOffset, LaneChangeAction alternatives, const std::vector< MSVehicle::LaneQ > &preb, double &latDist) const
check whether sub-lane changing in the given direction is desirable and possible