|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cz.zcu.fav.kiv.jsim.JSimSimulation | +--cz.zcu.fav.kiv.jsim.unsecure.UnsecureSimulation
UnsecureSimulation is an experimental class that you probably will not use at all. It is intended to be used in distributed simulation where simulation time rollbacks can occur. This class allows you to change the simulation time arbitrarily (even backwards) and to access calendar events for reading before they are interpreted. This can be used for future forecast, e.g. for computation of the lookahead time. You had better not use this class at all.
Field Summary | |
private boolean |
undoComing
A flag saying that the simulation will have to roll back. |
Fields inherited from class cz.zcu.fav.kiv.jsim.JSimSimulation |
calendar, MODE_GUI_BATCH, MODE_GUI_INTERACTIVE, MODE_TXT, NEW_PROCESS_FORBIDDEN, NEW_QUEUE_FORBIDDEN, NEW_SEMAPHORE_FORBIDDEN, PRN_ERROR, PRN_MESSAGE, SIMULATION_IN_PROGRESS, SIMULATION_NOT_STARTED, SIMULATION_TERMINATED, time |
Constructor Summary | |
UnsecureSimulation(java.lang.String name)
Creates a new simulation with no processes, no queues and no graphic window. |
|
UnsecureSimulation(java.lang.String name,
int mode)
Creates a new simulation with no processes, no queues and no graphic window. |
|
UnsecureSimulation(java.lang.String name,
int mode,
double guiUpdateDelta)
Creates a new simulation with no processes, no queues and no graphic window. |
Method Summary | |
protected void |
addWholeEventToCalendar(JSimCalendarEvent jsce)
Adds a new event to the calendar. |
protected void |
advanceTime(double positiveDelta)
Advances the simulation time by a positive delta. |
protected java.util.ListIterator |
getAllEventsFromCalendar()
Returns a list iterator over copies of all events of the calendar. |
protected JSimCalendarEvent[] |
getFirstNEventsFromCalendar(int n)
Returns copies of first N events from the calendar. |
boolean |
isUndoComing()
Reports the status of the undo-coming (future rollback) flag. |
protected void |
rollbackTime(double negativeDelta)
Rolls back the simulation time by a negative delta. |
protected void |
setTime(double absoluteTime)
Sets the value of the simulation time to a new value. |
protected void |
setUndoComing(boolean newUndoComing)
Changes the status of the undo-coming (future rollback) flag. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean undoComing
Constructor Detail |
public UnsecureSimulation(java.lang.String name) throws JSimInvalidParametersException
name
- Name of the simulation.
JSimInvalidParametersException
- This exception is thrown out if the specified name is
is null.public UnsecureSimulation(java.lang.String name, int mode) throws JSimInvalidParametersException
name
- Name of the simulation.mode
- Simulation mode. Possible values are MODE_TXT, MODE_GUI_BATCH,
and MODE_GUI_INTERACTIVE.
JSimInvalidParametersException
- This exception is thrown out if the specified name is
is null or an invalid simulation mode is given to the
constructor.public UnsecureSimulation(java.lang.String name, int mode, double guiUpdateDelta) throws JSimInvalidParametersException
name
- Name of the simulation.mode
- Simulation mode. Possible values are MODE_TXT, MODE_GUI_BATCH,
and MODE_GUI_INTERACTIVE.
JSimInvalidParametersException
- This exception is thrown out if the specified name is
is null, an invalid simulation mode is given to the
constructor, or if the update interval is less than zero.Method Detail |
public boolean isUndoComing()
protected void setUndoComing(boolean newUndoComing)
newUndoComing
- The new value of the undo-coming flag.protected void advanceTime(double positiveDelta) throws JSimInvalidParametersException
positiveDelta
- A simulation time difference between the current and desired simulation time.
JSimInvalidParametersException
- This exception is thrown out if the delta is negative.protected void rollbackTime(double negativeDelta) throws JSimInvalidParametersException
negativeDelta
- A simulation time difference between the current and desired simulation time.
JSimInvalidParametersException
- This exception is thrown out if the delta is positive.protected void setTime(double absoluteTime)
absoluteTime
- The new value of simulation time.protected void addWholeEventToCalendar(JSimCalendarEvent jsce) throws JSimInvalidParametersException
jsce
- The event to be added to the calendar.
JSimInvalidParametersException
- This exception is thrown out if the event is null or it is
rejected by the calendar.protected JSimCalendarEvent[] getFirstNEventsFromCalendar(int n) throws JSimInvalidParametersException
n
- The number of events to be returned.
JSimInvalidParametersException
- This exception is thrown out if N is less than 1.protected java.util.ListIterator getAllEventsFromCalendar()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |