Skip to content

Commit f94ac68

Browse files
committed
improve function/variable naming
1 parent 4664a6c commit f94ac68

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/context.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ int Context::time() {
315315
return ti_->time();
316316
}
317317

318-
int Context::timeshift(int year, int month) {
319-
return ti_->timeshift(year, month);
318+
int Context::CalcTimeDiff(int year, int month) {
319+
return ti_->CalcTimeDiff(year, month);
320320
}
321321

322322
int Context::random() {

src/context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class Context {
253253
virtual int time();
254254

255255
/// Returns a time shift between the simulation start time and another time stamp
256-
int timeshift(int year, int month);
256+
int CalcTimeDiff(int year, int month);
257257

258258
/// Adds a package type to a simulation-wide accessible list.
259259
/// Agents should NOT add their own packages.

src/timer.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,18 +281,18 @@ int Timer::dur() {
281281
return si_.duration;
282282
}
283283

284-
int Timer::timeshift(int year, int month) {
284+
int Timer::CalcTimeDiff(int year, int month) {
285285

286-
int timeshift_ = 0;
286+
int timediff_ = 0;
287287
if (year >= 0) {
288-
timeshift_ += (year - si_.y0) * kMonthsPerYear;
288+
timediff_ += (year - si_.y0) * kMonthsPerYear;
289289
}
290290

291291
if (month >= 0) {
292-
timeshift_ += si_.m0 - month;
292+
timediff_ += si_.m0 - month;
293293
}
294294

295-
return timeshift_;
295+
return timediff_;
296296

297297
}
298298

src/timer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ class Timer {
7575
/// @param year of alternate time stamp
7676
/// @param month of alternate time stamp
7777
///
78-
/// @return the timeshift between two times, in months
78+
/// @return the difference between the simulation start time and another time
7979
/// @warning Only valid for times that occur after the simulation start time.
80-
int timeshift(int year, int month);
80+
int CalcTimeDiff(int year, int month);
8181

8282
private:
8383
/// builds all agents queued for the current timestep.

0 commit comments

Comments
 (0)