📄 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();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -