#include <Direction.h>
Public Member Functions | |
void | setOutputDetector (Detector *OutputDet) |
Sets the direction's output detector. | |
Detector * | getOutputDetector () |
Gets the direction's output detector. | |
Lane & | getLane (int i) |
Gets a specific lane. | |
int | getNoLanes () |
Gets the number of lanes. | |
M2D | getVehiclesM2D () |
Gets all the vehicles on the road. | |
M2D | getGlobalPos () |
Updates all the vehicle positions to take account of direction. | |
void | createLanes (int length, int nLanes, std::vector< Detector * > detectors) |
Creates all the lanes running in a particular direction. | |
void | init (bool DirPos, Detector *OutDet, bool AllowLaneChange) |
Initialises the direction. | |
Direction () | |
Default constructor. | |
virtual | ~Direction () |
Default destructor. | |
bool | update (double step) |
Handles the updating of all the lanes in the direction. | |
Private Attributes | |
bool | m_AllowLaneChanging |
double | flow |
double | len |
bool | m_DirPos |
int | m_NoLanes |
std::vector< Lane > | m_vLanes |
Detector * | m_OutputDetector |
Direction::Direction | ( | ) |
Default constructor.
Direction::~Direction | ( | ) | [virtual] |
Default destructor.
void Direction::setOutputDetector | ( | Detector * | OutputDet | ) |
Sets the direction's output detector.
OutputDet | The direction's output detector |
Detector * Direction::getOutputDetector | ( | ) |
Gets the direction's output detector.
Lane & Direction::getLane | ( | int | i | ) |
Gets a specific lane.
i | The lane to choose |
int Direction::getNoLanes | ( | ) |
Gets the number of lanes.
M2D Direction::getVehiclesM2D | ( | ) |
Gets all the vehicles on the road.
M2D Direction::getGlobalPos | ( | ) |
Updates all the vehicle positions to take account of direction.
void Direction::createLanes | ( | int | RoadLength, | |
int | nLanes, | |||
std::vector< Detector * > | detectors | |||
) |
Creates all the lanes running in a particular direction.
RoadLength | The length of the road | |
nLanes | The number of lanes | |
detectors | The detectors in the direction |
void Direction::init | ( | bool | DirPos, | |
Detector * | OutDet, | |||
bool | AllowLaneChange | |||
) |
Initialises the direction.
DirPos | Whether or not the direction is in a positive direction | |
OutDet | The direction's output detector | |
AllowLaneChange | Whether or not lane changing is allowed |
bool Direction::update | ( | double | step | ) |
Handles the updating of all the lanes in the direction.
step | The timestep |
bool Direction::m_AllowLaneChanging [private] |
double Direction::flow [private] |
double Direction::len [private] |
bool Direction::m_DirPos [private] |
int Direction::m_NoLanes [private] |
std::vector<Lane> Direction::m_vLanes [private] |
Detector* Direction::m_OutputDetector [private] |