Gradient Class Reference

A derived class to represent a gradient on a road. More...

#include <Gradient.h>

Inheritance diagram for Gradient:

Inheritance graph
[legend]
Collaboration diagram for Gradient:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void addVehicle (Vehicle *pVeh)
void removeVehicle (Vehicle *pVeh)
 Gradient (int start, int end, double grad, bool DirPos)
virtual ~Gradient ()

Private Attributes

double m_Gradient


Detailed Description

A derived class to represent a gradient on a road.

Definition at line 17 of file Gradient.h.


Constructor & Destructor Documentation

Gradient::Gradient ( int  start,
int  end,
double  grad,
bool  DirPos 
)

Definition at line 19 of file Gradient.cpp.

References RoadSegment::m_Beginning, RoadSegment::m_DirPos, RoadSegment::m_End, and m_Gradient.

00020 {
00021         m_Beginning = start;
00022         m_End = end;
00023         m_DirPos = DirPos;
00024         m_Gradient = grad;
00025 }

Gradient::~Gradient (  )  [virtual]

Definition at line 27 of file Gradient.cpp.

00028 {
00029 
00030 }


Member Function Documentation

void Gradient::addVehicle ( Vehicle pVeh  )  [virtual]

Reimplemented from RoadSegment.

Definition at line 32 of file Gradient.cpp.

References Vehicle::getDriver(), m_Gradient, and DriverModel::SetGradient().

00033 {
00034         pVeh->getDriver()->SetGradient(m_Gradient);
00035 }

Here is the call graph for this function:

void Gradient::removeVehicle ( Vehicle pVeh  )  [virtual]

Reimplemented from RoadSegment.

Definition at line 37 of file Gradient.cpp.

References DriverModel::ClearGradient(), and Vehicle::getDriver().

00038 {
00039 //      TRACE("Remove vehicle - Direction: %d Position: %f\tVelocity: %f\n",pVeh->getDirection(), pVeh->getPos(), pVeh->getVelocity());
00040         DriverModel* driver = pVeh->getDriver();                // called before add vehicle!!
00041         driver->ClearGradient();                                            // causes vehicle stream to halt
00042 }

Here is the call graph for this function:


Member Data Documentation

double Gradient::m_Gradient [private]

Definition at line 26 of file Gradient.h.

Referenced by addVehicle(), and Gradient().


The documentation for this class was generated from the following files:

Generated on Wed Aug 20 00:48:47 2008 for EvolveTraffic by  doxygen 1.5.6