MCPcopy Create free account
hub / github.com/akeranen/the-one / addUpdate

Method addUpdate

input/ScheduledUpdatesQueue.java:59–72  ·  view source on GitHub ↗

Add a new update request for the given time @param simTime The time when the update should happen

(double simTime)

Source from the content-addressed store, hash-verified

57 * @param simTime The time when the update should happen
58 */
59 public void addUpdate(double simTime) {
60 ExternalEvent ee = new ExternalEvent(simTime);
61
62 if (ee.compareTo(nextEvent) == 0) { // this event is already next
63 return;
64 }
65 else if (this.nextEvent.getTime() > simTime) { // new nextEvent
66 putToQueue(this.nextEvent); // put the old nextEvent back to q
67 this.nextEvent = ee;
68 }
69 else { // given event happens later..
70 putToQueue(ee);
71 }
72 }
73
74 /**
75 * Puts a event to the queue in the right place

Callers 5

scheduleUpdateMethod · 0.80
testUpdatesMethod · 0.80
testDuplicateValuesMethod · 0.80

Calls 3

compareToMethod · 0.95
putToQueueMethod · 0.95
getTimeMethod · 0.45

Tested by 4

testUpdatesMethod · 0.64
testDuplicateValuesMethod · 0.64