MSPerson Class Reference

#include <MSPerson.h>


Detailed Description

The class holds a simulated person together with her movement stages

Definition at line 55 of file MSPerson.h.


Public Types

typedef std::vector
< MSPersonStage * > 
MSPersonPlan
 the structure holding the plan of a person

Public Member Functions

SUMOTime getDesiredDepart () const throw ()
 Returns the desired departure time.
const MSEdgegetDestination () const
 Returns the current destination.
const std::string & getID () const throw ()
 returns the person id
bool isWaitingFor (const std::string &line) const
 Whether the person waits for a vehicle of the line specified.
 MSPerson (const SUMOVehicleParameter *pars, MSPersonPlan *plan)
 constructor
void proceed (MSNet *net, SUMOTime time)
 proceeds to the next step of the route
void setDeparted (SUMOTime now)
 logs end of the step
void tripInfoOutput (OutputDevice &os) const throw (IOError)
 Called on writing tripinfo output.
 ~MSPerson ()
 destructor

Private Member Functions

 MSPerson (const MSPerson &)
 Invalidated copy constructor.
MSPersonoperator= (const MSPerson &)
 Invalidated assignment operator.

Private Attributes

const SUMOVehicleParametermyParameter
 the plan of the person
MSPersonPlanmyPlan
 the plan of the person
MSPersonPlan::iterator myStep
 the iterator over the route

Data Structures

class  MSPersonStage
class  MSPersonStage_Driving
class  MSPersonStage_Waiting
class  MSPersonStage_Walking

Member Typedef Documentation

typedef std::vector<MSPersonStage*> MSPerson::MSPersonPlan

the structure holding the plan of a person

Definition at line 226 of file MSPerson.h.


Constructor & Destructor Documentation

MSPerson::MSPerson ( const SUMOVehicleParameter pars,
MSPersonPlan plan 
)

constructor

Definition at line 193 of file MSPerson.cpp.

References myPlan, and myStep.

00194         : myParameter(pars), myPlan(plan) {
00195     myStep = myPlan->begin();
00196 }

MSPerson::~MSPerson (  ) 

destructor

Definition at line 199 of file MSPerson.cpp.

References myPlan.

00199                     {
00200     delete myPlan;
00201 }

MSPerson::MSPerson ( const MSPerson  )  [private]

Invalidated copy constructor.


Member Function Documentation

SUMOTime MSPerson::getDesiredDepart (  )  const throw ()

Returns the desired departure time.

Definition at line 224 of file MSPerson.cpp.

References SUMOVehicleParameter::depart, and myParameter.

Referenced by MSPersonControl::erase().

00224                                          {
00225     return myParameter->depart;
00226 }

const MSEdge & MSPerson::getDestination (  )  const

Returns the current destination.

Definition at line 236 of file MSPerson.cpp.

00236                                {
00237     return (*myStep)->getDestination();
00238 }

const std::string & MSPerson::getID (  )  const throw ()

returns the person id

Definition at line 205 of file MSPerson.cpp.

References SUMOVehicleParameter::id, and myParameter.

Referenced by MSPersonControl::erase().

00205                               {
00206     return myParameter->id;
00207 }

bool MSPerson::isWaitingFor ( const std::string &  line  )  const

Whether the person waits for a vehicle of the line specified.

Definition at line 250 of file MSPerson.cpp.

00250                                                   {
00251     return (*myStep)->isWaitingFor(line);
00252 }

MSPerson& MSPerson::operator= ( const MSPerson  )  [private]

Invalidated assignment operator.

void MSPerson::proceed ( MSNet net,
SUMOTime  time 
)

proceeds to the next step of the route

Definition at line 211 of file MSPerson.cpp.

References MSPersonControl::erase(), MSNet::getPersonControl(), myPlan, and myStep.

00211                                            {
00212     const MSEdge &arrivedAt = (*myStep)->getDestination();
00213     (*myStep)->setArrived(time);
00214     myStep++;
00215     if (myStep != myPlan->end()) {
00216         (*myStep)->proceed(net, this, time, arrivedAt);
00217     } else {
00218         net->getPersonControl().erase(this);
00219     }
00220 }

void MSPerson::setDeparted ( SUMOTime  now  ) 

logs end of the step

Definition at line 230 of file MSPerson.cpp.

00230                                   {
00231     (*myStep)->setDeparted(now);
00232 }

void MSPerson::tripInfoOutput ( OutputDevice os  )  const throw (IOError)

Called on writing tripinfo output.

Parameters:
[in] os The stream to write the information into
Exceptions:
IOError not yet implemented

Definition at line 242 of file MSPerson.cpp.

References myPlan.

Referenced by MSPersonControl::erase().

00242                                                               {
00243     for (MSPersonPlan::const_iterator i=myPlan->begin(); i!=myPlan->end(); ++i) {
00244         (*i)->tripInfoOutput(os);
00245     }
00246 }


Field Documentation

the plan of the person

Definition at line 230 of file MSPerson.h.

Referenced by getDesiredDepart(), and getID().

the plan of the person

Definition at line 233 of file MSPerson.h.

Referenced by MSPerson(), proceed(), tripInfoOutput(), and ~MSPerson().

MSPersonPlan::iterator MSPerson::myStep [private]

the iterator over the route

Definition at line 236 of file MSPerson.h.

Referenced by MSPerson(), and proceed().


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

Generated on Wed May 5 00:06:49 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6