SUMO - Simulation of Urban MObility
AGTime Class Reference

#include <AGTime.h>

Public Member Functions

void addDays (int days)
 addition of days to the current moment
void addHours (int hours)
 addition of hours to the current moment
void addMinutes (int min)
 addition of minutes to the current moment
void addSeconds (int sec)
 addition of seconds to the current moment
 AGTime ()
 AGTime (int seconds)
 AGTime (int hour, int minutes)
 AGTime (int day, int hour, int min)
 AGTime (int day, int hour, int min, int sec)
 AGTime (const AGTime &time)
int getDay ()
int getHour ()
int getMinute ()
int getSecond ()
int getSecondsInCurrentDay ()
int getSecondsOf (SUMOReal minutes)
 computes the number of seconds in the given minutes
int getTime ()
 : returns the number of seconds from the beginning of the first day of simulation this includes
AGTime operator+ (const AGTime &time)
void operator+= (const AGTime &time)
void operator+= (int seconds)
void operator-= (const AGTime &time)
bool operator< (const AGTime &time)
bool operator<= (const AGTime &time)
bool operator== (const AGTime &time)
void setDay (int d)
void setHour (int h)
void setMinute (int m)
void setSecond (int s)
void setTime (int sec)
 : sets the time from the beginning of the first day of simulation in seconds

Private Member Functions

int convert (int days, int hours, int minutes, int seconds)
 converts days, hours and minutes to seconds

Private Attributes

int sec

Detailed Description

Definition at line 44 of file AGTime.h.


Constructor & Destructor Documentation

AGTime::AGTime ( ) [inline]

Definition at line 46 of file AGTime.h.

AGTime::AGTime ( int  seconds) [inline]

Definition at line 47 of file AGTime.h.

AGTime::AGTime ( int  hour,
int  minutes 
) [inline]

Definition at line 49 of file AGTime.h.

AGTime::AGTime ( int  day,
int  hour,
int  min 
) [inline]

Definition at line 51 of file AGTime.h.

AGTime::AGTime ( int  day,
int  hour,
int  min,
int  sec 
) [inline]

Definition at line 53 of file AGTime.h.

AGTime::AGTime ( const AGTime time)

Definition at line 42 of file AGTime.cpp.

References sec.


Member Function Documentation

void AGTime::addDays ( int  days)

addition of days to the current moment

Parameters:
[in]daysthe number of days to add

Definition at line 173 of file AGTime.cpp.

References sec.

Referenced by AGFreeTime::whenBeginActivityNextDay().

void AGTime::addHours ( int  hours)

addition of hours to the current moment

Parameters:
[in]hoursthe number of hours to add

Definition at line 178 of file AGTime.cpp.

References sec.

void AGTime::addMinutes ( int  min)

addition of minutes to the current moment

Parameters:
[in]minthe number of minutes

Definition at line 183 of file AGTime.cpp.

References sec.

Referenced by AGBusLine::getReady().

void AGTime::addSeconds ( int  sec)

addition of seconds to the current moment

Parameters:
[in]secthe number of seconds

Definition at line 188 of file AGTime.cpp.

References sec.

Referenced by AGBusLine::getReady(), and main().

int AGTime::convert ( int  days,
int  hours,
int  minutes,
int  seconds 
) [private]

converts days, hours and minutes to seconds

Definition at line 47 of file AGTime.cpp.

References sec.

Definition at line 106 of file AGTime.cpp.

References sec.

Referenced by AGActivityGen::generateOutputFile(), main(), setDay(), and AGFreeTime::typeFromHomeNight().

Definition at line 111 of file AGTime.cpp.

References sec.

Referenced by AGActivityGen::generateOutputFile(), and setHour().

Definition at line 116 of file AGTime.cpp.

References sec.

Referenced by AGActivityGen::generateOutputFile(), and setMinute().

Definition at line 121 of file AGTime.cpp.

References sec.

Referenced by AGActivityGen::generateOutputFile(), and setSecond().

Definition at line 126 of file AGTime.cpp.

References sec.

computes the number of seconds in the given minutes

Parameters:
[in]minutes,canbe fraction of minutes
Returns:
number of seconds

Definition at line 53 of file AGTime.cpp.

: returns the number of seconds from the beginning of the first day of simulation this includes

Definition at line 131 of file AGTime.cpp.

References sec.

Referenced by AGBusLine::getReady(), main(), AGFreeTime::typeFromHomeNight(), and AGFreeTime::whenBeginActivityNextDay().

AGTime AGTime::operator+ ( const AGTime time)

Definition at line 100 of file AGTime.cpp.

References sec.

void AGTime::operator+= ( const AGTime time)

Definition at line 85 of file AGTime.cpp.

References sec.

void AGTime::operator+= ( int  seconds)

Definition at line 90 of file AGTime.cpp.

References sec.

void AGTime::operator-= ( const AGTime time)

Definition at line 95 of file AGTime.cpp.

References sec.

bool AGTime::operator< ( const AGTime time)

Definition at line 67 of file AGTime.cpp.

References sec.

bool AGTime::operator<= ( const AGTime time)

Definition at line 76 of file AGTime.cpp.

References sec.

bool AGTime::operator== ( const AGTime time)

Definition at line 58 of file AGTime.cpp.

References sec.

void AGTime::setDay ( int  d)

Definition at line 136 of file AGTime.cpp.

References getDay(), and sec.

Referenced by main(), and AGFreeTime::typeFromHomeNight().

void AGTime::setHour ( int  h)

Definition at line 144 of file AGTime.cpp.

References getHour(), and sec.

void AGTime::setMinute ( int  m)

Definition at line 152 of file AGTime.cpp.

References getMinute(), and sec.

void AGTime::setSecond ( int  s)

Definition at line 160 of file AGTime.cpp.

References getSecond(), and sec.

void AGTime::setTime ( int  sec)

: sets the time from the beginning of the first day of simulation in seconds

Definition at line 168 of file AGTime.cpp.

References sec.

Referenced by AGFreeTime::whenBeginActivityNextDay().


Field Documentation


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines