📄 eventupdatedijkstra.java
字号:
package dk.itu.nulx30.eventSimulation;
import dk.itu.nulx30.networkModel.DijkstraRouting;
/**
* This event calls the method <code>updateRoutingTable</code> on the
* routing-algorithm if it is of the same instance as <code>DijkstraRouting</code>.
*
* @author Jacob Wahl Winther
* @author Mikkel Bundgaard
* @author Troels C. Damgaard
* @author Federico Decara
*/
public class EventUpdateDijkstra extends Event {
/** the simulation in which this event has occured*/
private EventSimulation sim;
/**
* Class constructor for <code>EventUpdateDijkstra</code> which takes a time
* and an <code>EventSimulation</code> as argument
*
* @param time the time when this event is about to occur
* @param sim the simulation in which this event has occured
*/
public EventUpdateDijkstra( double time, EventSimulation sim ) {
super( time );
this.sim = sim;
}
/**
* Execute this event's method
*/
public void doEvent() {
if ( sim.getRoutingAlgorithm() instanceof DijkstraRouting ){
( ( DijkstraRouting ) sim.getRoutingAlgorithm() ).updateRoutingTable();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -