Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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 (const AGTime &time)
 
 AGTime (int day, int hour, int min)
 
 AGTime (int day, int hour, int min, int sec)
 
 AGTime (int hour, int minutes)
 
 AGTime (int seconds)
 
int getDay ()
 
int getHour ()
 
int getMinute ()
 
int getSecond ()
 
int getSecondsInCurrentDay ()
 
int getSecondsOf (double 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 mySeconds
 

Detailed Description

Definition at line 34 of file AGTime.h.

Constructor & Destructor Documentation

◆ AGTime() [1/5]

AGTime::AGTime ( int  seconds)
inline

Definition at line 36 of file AGTime.h.

◆ AGTime() [2/5]

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

Definition at line 38 of file AGTime.h.

◆ AGTime() [3/5]

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

Definition at line 40 of file AGTime.h.

◆ AGTime() [4/5]

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

Definition at line 42 of file AGTime.h.

◆ AGTime() [5/5]

AGTime::AGTime ( const AGTime time)

Definition at line 33 of file AGTime.cpp.

References mySeconds.

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 164 of file AGTime.cpp.

References mySeconds.

Referenced by AGFreeTime::whenBeginActivityNextDay().

Here is the caller graph for this function:

◆ addHours()

void AGTime::addHours ( int  hours)

addition of hours to the current moment

Parameters
[in]hoursthe number of hours to add

Definition at line 169 of file AGTime.cpp.

References mySeconds.

◆ addMinutes()

void AGTime::addMinutes ( int  min)

addition of minutes to the current moment

Parameters
[in]minthe number of minutes

Definition at line 174 of file AGTime.cpp.

References mySeconds.

Referenced by AGBusLine::getReady().

Here is the caller graph for this function:

◆ addSeconds()

void AGTime::addSeconds ( int  sec)

addition of seconds to the current moment

Parameters
[in]secthe number of seconds

Definition at line 179 of file AGTime.cpp.

References mySeconds.

Referenced by AGBusLine::getReady().

Here is the caller graph for this function:

◆ convert()

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

converts days, hours and minutes to seconds

Definition at line 38 of file AGTime.cpp.

References mySeconds.

◆ getDay()

int AGTime::getDay ( )

Definition at line 97 of file AGTime.cpp.

References mySeconds.

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

Here is the caller graph for this function:

◆ getHour()

int AGTime::getHour ( )

Definition at line 102 of file AGTime.cpp.

References mySeconds.

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

Here is the caller graph for this function:

◆ getMinute()

int AGTime::getMinute ( )

Definition at line 107 of file AGTime.cpp.

References mySeconds.

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

Here is the caller graph for this function:

◆ getSecond()

int AGTime::getSecond ( )

Definition at line 112 of file AGTime.cpp.

References mySeconds.

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

Here is the caller graph for this function:

◆ getSecondsInCurrentDay()

int AGTime::getSecondsInCurrentDay ( )

Definition at line 117 of file AGTime.cpp.

References mySeconds.

Referenced by AGActivityGen::varDepTime().

Here is the caller graph for this function:

◆ 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 44 of file AGTime.cpp.

◆ getTime()

int AGTime::getTime ( )

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

Definition at line 122 of file AGTime.cpp.

References mySeconds.

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

Here is the caller graph for this function:

◆ operator+()

AGTime AGTime::operator+ ( const AGTime time)

Definition at line 91 of file AGTime.cpp.

References mySeconds.

◆ operator+=() [1/2]

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

Definition at line 76 of file AGTime.cpp.

References mySeconds.

◆ operator+=() [2/2]

void AGTime::operator+= ( int  seconds)

Definition at line 81 of file AGTime.cpp.

References mySeconds.

◆ operator-=()

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

Definition at line 86 of file AGTime.cpp.

References mySeconds.

◆ operator<()

bool AGTime::operator< ( const AGTime time)

Definition at line 57 of file AGTime.cpp.

References mySeconds.

◆ operator<=()

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

Definition at line 66 of file AGTime.cpp.

References mySeconds.

◆ operator==()

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

Definition at line 49 of file AGTime.cpp.

References mySeconds.

◆ setDay()

void AGTime::setDay ( int  d)

Definition at line 127 of file AGTime.cpp.

References getDay(), and mySeconds.

Referenced by AGFreeTime::typeFromHomeNight().

Here is the caller graph for this function:

◆ setHour()

void AGTime::setHour ( int  h)

Definition at line 135 of file AGTime.cpp.

References getHour(), and mySeconds.

◆ setMinute()

void AGTime::setMinute ( int  m)

Definition at line 143 of file AGTime.cpp.

References getMinute(), and mySeconds.

◆ setSecond()

void AGTime::setSecond ( int  s)

Definition at line 151 of file AGTime.cpp.

References getSecond(), and mySeconds.

◆ setTime()

void AGTime::setTime ( int  sec)

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

Definition at line 159 of file AGTime.cpp.

References mySeconds.

Referenced by AGFreeTime::whenBeginActivityNextDay().

Here is the caller graph for this function:

Field Documentation

◆ mySeconds


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