1
2
3
4
5
6
7
8
9
10 package nl.tudelft.simulation.dsol.simulators;
11
12 import java.rmi.RemoteException;
13
14 import nl.tudelft.simulation.dsol.SimRuntimeException;
15 import nl.tudelft.simulation.dsol.eventlists.EventListInterface;
16 import nl.tudelft.simulation.dsol.experiment.TimeUnitInterface;
17 import nl.tudelft.simulation.dsol.formalisms.devs.SimEventInterface;
18 import nl.tudelft.simulation.event.EventType;
19
20 /***
21 * The DEVS defines the interface of the DEVS simulator. DEVS stands for the
22 * Discrete Event System Specification. More information on Discrete Event
23 * Simulation can be found in "Theory of Modeling and Simulation" by Bernard
24 * Zeigler et. al.
25 * <p>
26 * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
27 * University of Technology </a>, the Netherlands. <br>
28 * See for project information <a href="http://www.simulation.tudelft.nl">
29 * www.simulation.tudelft.nl </a> <br>
30 * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
31 * License (GPL) </a>, no warranty <br>
32 *
33 * @author <a href="http://www.simulation.tudelft.nl/people/jacobs.html">Peter
34 * Jacobs </a>
35 * @version 1.8 2004-03-18
36 * @since 1.0
37 */
38 public interface DEVSSimulatorInterface extends SimulatorInterface
39 {
40 /*** The EVENTLIST_CHANGED_EVENT is fired when the eventList is changed */
41 EventType EVENTLIST_CHANGED_EVENT = new EventType("EVENTLIST_CHANGED_EVENT");
42
43 /***
44 * cancels an event from the event list.
45 *
46 * @param event a simulation event to be canceled.
47 * @return boolean the succes of the operation.
48 * @throws RemoteException on network failure.
49 */
50 boolean cancelEvent(SimEventInterface event) throws RemoteException;
51
52 /***
53 * returns the eventlist of the simulator.
54 *
55 * @return the eventlist.
56 * @throws RemoteException on network failure
57 */
58 EventListInterface getEventList() throws RemoteException;
59
60 /***
61 * Method scheduleEvent schedules an event on the eventlist.
62 *
63 * @param event a simulation event
64 * @throws RemoteException on network failure
65 * @throws SimRuntimeException whenever event is scheduled in past.
66 */
67 void scheduleEvent(SimEventInterface event) throws RemoteException,
68 SimRuntimeException;
69
70 /***
71 * schedules a methodCall at a relative duration. The executionTime is thus
72 * simulator.getSimulatorTime()+relativeDuration.
73 *
74 * @param priority the priority compared to other events scheduled at the
75 * same time.
76 * @param source the source of the event
77 * @param target the target
78 * @param method the method
79 * @param args the arguments.
80 * @param relativeDelay the relativeDelay in timeUnits of the simulator.
81 * @throws RemoteException on network failure.
82 * @throws SimRuntimeException whenever the event is scheduled in the past.
83 */
84 void scheduleEvent(double relativeDelay, short priority, Object source,
85 Object target, String method, Object[] args)
86 throws RemoteException, SimRuntimeException;
87
88 /***
89 * schedules a methodCall at a relative duration. The executionTime is thus
90 * simulator.getSimulatorTime()+relativeDuration.
91 *
92 * @param priority the priority compared to other events scheduled at the
93 * same time.
94 * @param timeUnit the timeUnits of the delay
95 * @param source the source of the event
96 * @param target the target
97 * @param method the method
98 * @param args the arguments.
99 * @param relativeDelay the relativeDelay in timeUnits of the simulator.
100 * @throws RemoteException on network failure.
101 * @throws SimRuntimeException whenever the event is scheduled in the past.
102 */
103 void scheduleEvent(double relativeDelay, TimeUnitInterface timeUnit,
104 short priority, Object source, Object target, String method,
105 Object[] args) throws RemoteException, SimRuntimeException;
106
107 /***
108 * schedules a methodCall at a relative duration. The executionTime is thus
109 * simulator.getSimulatorTime()+relativeDuration.
110 *
111 * @param source the source of the event
112 * @param target the target
113 * @param method the method
114 * @param args the arguments.
115 * @param relativeDelay the relativeDelay in timeUnits of the simulator.
116 * @throws RemoteException on network failure.
117 * @throws SimRuntimeException whenever the event is scheduled in the past.
118 */
119 void scheduleEvent(double relativeDelay, Object source, Object target,
120 String method, Object[] args) throws RemoteException,
121 SimRuntimeException;
122
123 /***
124 * schedules a methodCall at a relative duration. The executionTime is thus
125 * simulator.getSimulatorTime()+relativeDuration.
126 *
127 * @param timeUnit the timeUnits of the delay
128 * @param source the source of the event
129 * @param target the target
130 * @param method the method
131 * @param args the arguments.
132 * @param relativeDelay the relativeDelay in timeUnits of the simulator.
133 * @throws RemoteException on network failure.
134 * @throws SimRuntimeException whenever the event is scheduled in the past.
135 */
136 void scheduleEvent(double relativeDelay, TimeUnitInterface timeUnit,
137 Object source, Object target, String method, Object[] args)
138 throws RemoteException, SimRuntimeException;
139
140 /***
141 * Method setEventList sets the eventlist.
142 *
143 * @param eventList the eventList for the simulator.
144 * @throws RemoteException on network failure
145 * @throws SimRuntimeException whenever simulator.isRunning()==true
146 */
147 void setEventList(EventListInterface eventList) throws RemoteException,
148 SimRuntimeException;
149 }