public class DiscreteTimeline extends Timeline
Timeline.Type
Modifier and Type | Field and Description |
---|---|
protected int |
cRound
E.g.
|
hasDeadline, paused
Constructor and Description |
---|
DiscreteTimeline(int totalRounds)
Creates a timeline with a deadline of
totalRounds number of
rounds. |
Modifier and Type | Method and Description |
---|---|
double |
getCurrentTime() |
int |
getOwnRoundsLeft()
The number of rounds left for ourself.
|
int |
getOwnTotalRounds()
The total number of rounds for ourself.
|
int |
getRound()
Starting to count from 1, until the total amount of rounds.
|
int |
getRoundsLeft() |
double |
getTime()
Gets the time, running from t = 0 (start) to t = 1 (deadline).
|
int |
getTotalRounds()
Be careful, this is not equal to the initializing value!
|
double |
getTotalTime()
This a hack because in Agent.java a method sleep requires this
|
Timeline.Type |
getType() |
void |
increment() |
void |
pause()
The DiscreteTimeline does not have to be paused/resumed, as time does not
pass within a round.
|
void |
printRoundElapsed()
Prints time in seconds
|
void |
printTime()
Prints time, running from t = 0 (start) to t = 1 (deadline).
|
void |
resume()
The DiscreteTimeline does not have to be paused/resumed, as time does not
pass within a round.
|
isDeadlineReached, isPaused
protected int cRound
public DiscreteTimeline(int totalRounds)
totalRounds
number of
rounds.public void printRoundElapsed()
public void printTime()
public double getTime()
Agent#wait(double)
for pausing the agent.public void increment()
public void pause()
public void resume()
public double getTotalTime()
getTotalTime
in class Timeline
public int getRound()
public int getRoundsLeft()
public int getTotalRounds()
public int getOwnTotalRounds()
public int getOwnRoundsLeft()
public Timeline.Type getType()
public double getCurrentTime()
getCurrentTime
in class Timeline