Add a new update request for the given time @param simTime The time when the update should happen
(double simTime)
| 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 |