public class DiscreteTimeline extends Timeline
getOwnRoundsLeft()
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()
In a time-based protocol, time passes within a round.
|
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.
|
void |
setcRound(int cRound) |
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.getTime
in interface TimeLineInfo
getTime
in class Timeline
public void increment()
public void setcRound(int cRound)
public void pause()
public void resume()
public double getTotalTime()
getTotalTime
in interface TimeLineInfo
getTotalTime
in class Timeline
public int getRound()
public int getRoundsLeft()
public int getTotalRounds()
public int getOwnTotalRounds()
public int getOwnRoundsLeft()
public Timeline.Type getType()
TimeLineInfo
getType
in interface TimeLineInfo
getType
in class Timeline
public double getCurrentTime()
getCurrentTime
in interface TimeLineInfo
getCurrentTime
in class Timeline