MATSIM
core
mobsim
framework
MobsimTimer.java
Go to the documentation of this file.
1
/* *********************************************************************** *
2
* project: org.matsim.*
3
* QSimTimer
4
* *
5
* *********************************************************************** *
6
* *
7
* copyright : (C) 2010 by the members listed in the COPYING, *
8
* LICENSE and WARRANTY file. *
9
* email : info at matsim dot org *
10
* *
11
* *********************************************************************** *
12
* *
13
* This program is free software; you can redistribute it and/or modify *
14
* it under the terms of the GNU General Public License as published by *
15
* the Free Software Foundation; either version 2 of the License, or *
16
* (at your option) any later version. *
17
* See also COPYING, LICENSE and WARRANTY file *
18
* *
19
* *********************************************************************** */
20
package
org.matsim.core.mobsim.framework;
21
22
23
27
public
class
MobsimTimer
{
28
private
double
simStartTime
= 24*3600;
// initialized to 24h so as that the time can be successively
29
// set down when an agent starts earlier until the earliest point of time an agent starts
30
private
double
time
= 0.0;
31
private
double
stepSize
= 1.0;
32
33
public
MobsimTimer
(){
34
this
(1.0);
35
}
36
37
38
public
MobsimTimer
(
final
double
stepSize){
39
this.simStartTime = 24*3600;
40
this.time = 0;
41
this.stepSize =
stepSize
;
42
}
43
44
public
final
double
getSimStartTime
() {
45
return
this.
simStartTime
;
46
}
47
48
public
double
getTimeOfDay
() {
49
return
this.
time
;
50
}
51
52
public
double
incrementTime
(){
53
this.time +=
stepSize
;
54
return
this.
time
;
55
}
56
57
public
final
double
getSimTimestepSize
() {
58
return
this.
stepSize
;
59
}
60
61
public
void
setSimStartTime
(
double
startTimeSec) {
62
this.simStartTime = startTimeSec;
63
}
64
65
public
void
setTime
(
double
timeSec) {
66
this.time = timeSec;
67
}
68
69
}
org.matsim.core.mobsim.framework.MobsimTimer.getSimStartTime
final double getSimStartTime()
Definition:
MobsimTimer.java:44
org.matsim.core.mobsim.framework.MobsimTimer
Definition:
MobsimTimer.java:27
org.matsim.core.mobsim.framework.MobsimTimer.MobsimTimer
MobsimTimer(final double stepSize)
Definition:
MobsimTimer.java:38
org.matsim.core.mobsim.framework.MobsimTimer.stepSize
double stepSize
Definition:
MobsimTimer.java:31
org.matsim.core.mobsim.framework.MobsimTimer.incrementTime
double incrementTime()
Definition:
MobsimTimer.java:52
org.matsim.core.mobsim.framework.MobsimTimer.MobsimTimer
MobsimTimer()
Definition:
MobsimTimer.java:33
org.matsim.core.mobsim.framework.MobsimTimer.getTimeOfDay
double getTimeOfDay()
Definition:
MobsimTimer.java:48
org.matsim.core.mobsim.framework.MobsimTimer.time
double time
Definition:
MobsimTimer.java:30
org.matsim.core.mobsim.framework.MobsimTimer.setSimStartTime
void setSimStartTime(double startTimeSec)
Definition:
MobsimTimer.java:61
org.matsim.core.mobsim.framework.MobsimTimer.getSimTimestepSize
final double getSimTimestepSize()
Definition:
MobsimTimer.java:57
org.matsim.core.mobsim.framework.MobsimTimer.simStartTime
double simStartTime
Definition:
MobsimTimer.java:28
org.matsim.core.mobsim.framework.MobsimTimer.setTime
void setTime(double timeSec)
Definition:
MobsimTimer.java:65
Generated by
1.8.13