MSPerson::MSPersonStage_Waiting Class Reference

#include <MSPerson.h>

Inheritance diagram for MSPerson::MSPersonStage_Waiting:

MSPerson::MSPersonStage

Detailed Description

A "real" stage performing a waiting over the specified time The time is not being added to the travel time?

Definition at line 190 of file MSPerson.h.


Public Member Functions

const MSEdgegetDestination () const
 returns the destination edge
virtual bool isWaitingFor (const std::string &line) const
 Whether the person waits for a vehicle of the line specified.
 MSPersonStage_Waiting (const MSEdge &destination, SUMOTime duration, SUMOTime until)
 constructor
virtual void proceed (MSNet *net, MSPerson *person, SUMOTime now, const MSEdge &previousEdge)
 proceeds to the next step
void setArrived (SUMOTime now)
 logs end of the step
void setDeparted (SUMOTime now)
 logs end of the step
virtual void tripInfoOutput (OutputDevice &os) const throw (IOError)
 Called on writing tripinfo output.
 ~MSPersonStage_Waiting ()
 destructor

Protected Attributes

SUMOTime myArrived
 the time at which this stage ended
SUMOTime myDeparted
 the time at which this stage started
const MSEdgemyDestination
 the next edge to reach (either by walking or driving)

Private Member Functions

 MSPersonStage_Waiting (const MSPersonStage_Waiting &)
 Invalidated copy constructor.
MSPersonStage_Waitingoperator= (const MSPersonStage_Waiting &)
 Invalidated assignment operator.

Private Attributes

SUMOTime myWaitingDuration
 the time the person is waiting
SUMOTime myWaitingUntil
 the time until the person is waiting

Constructor & Destructor Documentation

MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting ( const MSEdge destination,
SUMOTime  duration,
SUMOTime  until 
)

constructor

Definition at line 165 of file MSPerson.cpp.

00167         : MSPersonStage(destination), myWaitingDuration(duration), myWaitingUntil(until) {}

MSPerson::MSPersonStage_Waiting::~MSPersonStage_Waiting (  ) 

destructor

Definition at line 170 of file MSPerson.cpp.

00170 {}

MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting ( const MSPersonStage_Waiting  )  [private]

Invalidated copy constructor.


Member Function Documentation

const MSEdge & MSPerson::MSPersonStage::getDestination (  )  const [inherited]

returns the destination edge

Definition at line 60 of file MSPerson.cpp.

References MSPerson::MSPersonStage::myDestination.

00060                                             {
00061     return myDestination;
00062 }

bool MSPerson::MSPersonStage::isWaitingFor ( const std::string &  line  )  const [virtual, inherited]

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

Reimplemented in MSPerson::MSPersonStage_Driving.

Definition at line 80 of file MSPerson.cpp.

00080                                                                {
00081     return false;
00082 }

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

Invalidated assignment operator.

void MSPerson::MSPersonStage_Waiting::proceed ( MSNet net,
MSPerson person,
SUMOTime  now,
const MSEdge previousEdge 
) [virtual]

proceeds to the next step

Implements MSPerson::MSPersonStage.

Definition at line 174 of file MSPerson.cpp.

References MSNet::getPersonControl(), MAX3(), myWaitingDuration, myWaitingUntil, and MSPersonControl::setArrival().

00176                                          {
00177     const SUMOTime until = MAX3(now, now + myWaitingDuration, myWaitingUntil);
00178     net->getPersonControl().setArrival(until, person);
00179 }

void MSPerson::MSPersonStage::setArrived ( SUMOTime  now  )  [inherited]

logs end of the step

Definition at line 74 of file MSPerson.cpp.

References MSPerson::MSPersonStage::myArrived.

00074                                               {
00075     myArrived = now;
00076 }

void MSPerson::MSPersonStage::setDeparted ( SUMOTime  now  )  [inherited]

logs end of the step

Definition at line 66 of file MSPerson.cpp.

References MSPerson::MSPersonStage::myDeparted.

00066                                                {
00067     if (myDeparted < 0) {
00068         myDeparted = now;
00069     }
00070 }

void MSPerson::MSPersonStage_Waiting::tripInfoOutput ( OutputDevice os  )  const throw (IOError) [virtual]

Called on writing tripinfo output.

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

Implements MSPerson::MSPersonStage.

Definition at line 183 of file MSPerson.cpp.

References MSPerson::MSPersonStage::myArrived, and time2string().

00183                                                                                    {
00184     (os.openTag("stop") <<
00185      " arrival=\"" << time2string(myArrived) <<
00186      "\"").closeTag(true);
00187 }


Field Documentation

the time at which this stage started

Definition at line 97 of file MSPerson.h.

Referenced by MSPerson::MSPersonStage::setDeparted(), and MSPerson::MSPersonStage_Driving::tripInfoOutput().

const MSEdge& MSPerson::MSPersonStage::myDestination [protected, inherited]

the next edge to reach (either by walking or driving)

Definition at line 94 of file MSPerson.h.

Referenced by MSPerson::MSPersonStage::getDestination().

the time the person is waiting

Definition at line 210 of file MSPerson.h.

Referenced by proceed().

the time until the person is waiting

Definition at line 213 of file MSPerson.h.

Referenced by 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