?? event.java
字號:
package dk.itu.nulx30.eventSimulation;
import dk.itu.nulx30.util.BinaryHeapElement;
/**
* Event is the common superclass of all events in the event based simulation.
* It contains the information about when an event is to occur. It uses the
* priority field in BinaryHeapElement to indicate the time. This facilitates
* that instances of <code>Event</code> can be put in a binary heap and that the
* extractMin method, will extract the event that will occur first. It is not
* possible to change the time when an event will occur.
*
* @author Jacob Wahl Winther
* @author Mikkel Bundgaard
* @author Troels C. Damgaard
* @author Federico Decara
*/
public abstract class Event extends BinaryHeapElement {
/**
* Class constructor. Set the time when this event is about to occur.
* Must be called from subclasses.
*
* @param eTime the time when this event should occur.
*/
public Event( double eTime ) {
setPriority( eTime );
}
/**
* Returns the time when this event will occur,
* @return time when event occurs
*/
public double getTime() {
return getPriority();
}
/**
* The code that must be executed when event occurs.
*/
public abstract void doEvent();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -