SUMO - Simulation of Urban MObility
AGTime Class Reference

#include <AGTime.h>

Collaboration diagram for AGTime:
Collaboration graph

Public Member Functions

void addDays (int days)
 addition of days to the current moment More...
 
void addHours (int hours)
 addition of hours to the current moment More...
 
void addMinutes (int min)
 addition of minutes to the current moment More...
 
void addSeconds (int sec)
 addition of seconds to the current moment More...
 
 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 (double minutes)
 computes the number of seconds in the given minutes More...
 
int getTime ()
 : returns the number of seconds from the beginning of the first day of simulation this includes More...
 
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 More...
 

Private Member Functions

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

Private Attributes

int sec
 

Detailed Description

Definition at line 43 of file AGTime.h.

Constructor & Destructor Documentation

◆ AGTime() [1/6]

AGTime::AGTime ( )
inline

Definition at line 45 of file AGTime.h.

Referenced by AGTime().

◆ AGTime() [2/6]

AGTime::AGTime ( int  seconds)
inline

Definition at line 46 of file AGTime.h.

◆ AGTime() [3/6]

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

Definition at line 48 of file AGTime.h.

◆ AGTime() [4/6]

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

Definition at line 50 of file AGTime.h.

◆ AGTime() [5/6]

◆ AGTime() [6/6]

AGTime::AGTime ( const AGTime time)

Definition at line 41 of file AGTime.cpp.

References sec.

Member Function Documentation

◆ addDays()

void AGTime::addDays ( int  days)

addition of days to the current moment

Parameters
[in]daysthe number of days to add

Definition at line 172 of file AGTime.cpp.

References sec.

Referenced by AGTime(), and AGFreeTime::whenBeginActivityNextDay().

◆ addHours()

void AGTime::addHours ( int  hours)

addition of hours to the current moment

Parameters
[in]hoursthe number of hours to add

Definition at line 177 of file AGTime.cpp.

References sec.

Referenced by AGTime().

◆ addMinutes()

void AGTime::addMinutes ( int  min)

addition of minutes to the current moment

Parameters
[in]minthe number of minutes

Definition at line 182 of file AGTime.cpp.

References sec.

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

◆ addSeconds()

void AGTime::addSeconds ( int  sec)

addition of seconds to the current moment

Parameters
[in]secthe number of seconds

Definition at line 187 of file AGTime.cpp.

References sec.

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

◆ convert()

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

converts days, hours and minutes to seconds

Definition at line 46 of file AGTime.cpp.

References sec.

Referenced by AGTime().

◆ getDay()

int AGTime::getDay ( )

Definition at line 105 of file AGTime.cpp.

References sec.

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

◆ getHour()

int AGTime::getHour ( )

Definition at line 110 of file AGTime.cpp.

References sec.

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

◆ getMinute()

int AGTime::getMinute ( )

Definition at line 115 of file AGTime.cpp.

References sec.

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

◆ getSecond()

int AGTime::getSecond ( )

Definition at line 120 of file AGTime.cpp.

References sec.

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

◆ getSecondsInCurrentDay()

int AGTime::getSecondsInCurrentDay ( )

Definition at line 125 of file AGTime.cpp.

References sec.

Referenced by AGTime().

◆ getSecondsOf()

int AGTime::getSecondsOf ( double  minutes)

computes the number of seconds in the given minutes

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

Definition at line 52 of file AGTime.cpp.

Referenced by AGTime().

◆ getTime()

int AGTime::getTime ( )

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

Definition at line 130 of file AGTime.cpp.

References sec.

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

◆ operator+()

AGTime AGTime::operator+ ( const AGTime time)

Definition at line 99 of file AGTime.cpp.

References sec.

Referenced by AGTime().

◆ operator+=() [1/2]

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

Definition at line 84 of file AGTime.cpp.

References sec.

Referenced by AGTime().

◆ operator+=() [2/2]

void AGTime::operator+= ( int  seconds)

Definition at line 89 of file AGTime.cpp.

References sec.

◆ operator-=()

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

Definition at line 94 of file AGTime.cpp.

References sec.

Referenced by AGTime().

◆ operator<()

bool AGTime::operator< ( const AGTime time)

Definition at line 66 of file AGTime.cpp.

References sec.

Referenced by AGTime().

◆ operator<=()

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

Definition at line 75 of file AGTime.cpp.

References sec.

Referenced by AGTime().

◆ operator==()

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

Definition at line 57 of file AGTime.cpp.

References sec.

Referenced by AGTime().

◆ setDay()

void AGTime::setDay ( int  d)

Definition at line 135 of file AGTime.cpp.

References getDay(), and sec.

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

◆ setHour()

void AGTime::setHour ( int  h)

Definition at line 143 of file AGTime.cpp.

References getHour(), and sec.

Referenced by AGTime().

◆ setMinute()

void AGTime::setMinute ( int  m)

Definition at line 151 of file AGTime.cpp.

References getMinute(), and sec.

Referenced by AGTime().

◆ setSecond()

void AGTime::setSecond ( int  s)

Definition at line 159 of file AGTime.cpp.

References getSecond(), and sec.

Referenced by AGTime().

◆ setTime()

void AGTime::setTime ( int  sec)

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

Definition at line 167 of file AGTime.cpp.

References sec.

Referenced by AGTime(), and AGFreeTime::whenBeginActivityNextDay().

Field Documentation

◆ sec


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