jasi.sim.basic.control
Interface SimController

All Superinterfaces:
CalendarListener, ElementsListener, SimListener
All Known Implementing Classes:
AbstractSimController, BasicController, Timer

public interface SimController
extends SimListener

Interface to control the execution of a simulation.


Method Summary
 Time advance(Time time, Time next)
          Request a time advance.
<T> boolean
change(Element element, java.lang.String name, T value)
          The attribute value of a simulation element will be changed.
 void finish(Time time)
          A simulation thread will be finished.
 double getSpeed()
          Get the simulation speed factor, given in multiples of real-time.
<T> T
request(Element element, java.lang.String name, T value)
          The attribute value of a simulation element is requested.
 void setSpeed(double speed)
          Set the simulation speed factor, given in multiples of real-time.
 Time start(Time time)
          A simulation thread will be started.
 
Methods inherited from interface jasi.sim.basic.control.SimListener
advancedTime, finishedReadingArchive, finishedSimulation, finishedWritingArchive, gotException, gotMessage, startedSimulation, startReadingArchive, startWritingArchive
 
Methods inherited from interface jasi.sim.basic.element.ElementsListener
changedElement, createdElement, deletedElement, requestedElement
 
Methods inherited from interface jasi.sim.basic.event.CalendarListener
poppedEvent, pushedEvent, removedEvent
 

Method Detail

start

Time start(Time time)
A simulation thread will be started. This method allows to control the start time to be granted.

Parameters:
time - The requested start time.
Returns:
The granted start time.
See Also:
AbstractSimKernel.startSimulation()

advance

Time advance(Time time,
             Time next)
Request a time advance. This method allows to control the time advance to be granted.

Parameters:
time - The current time.
next - The requested time advance.
Returns:
The granted time advance.
See Also:
AbstractSimKernel.continueSimulation(jasi.sim.basic.value.Time, jasi.sim.basic.value.Time)

finish

void finish(Time time)
A simulation thread will be finished.

Parameters:
time - The current time.
See Also:
AbstractSimKernel.finishSimulation()

change

<T> boolean change(Element element,
                   java.lang.String name,
                   T value)
The attribute value of a simulation element will be changed. This method is called by an element handler, whenever the value of an attribute changes. This method returns false, the attribute's value will not be changed. When true, simulation listener will be informed about the change.

Type Parameters:
T - The value type.
Parameters:
element - The simulation element.
name - The attribute's name.
value - The new value of the attribute.
Returns:
True, if it is correct to change the element.

request

<T> T request(Element element,
              java.lang.String name,
              T value)
The attribute value of a simulation element is requested. This method is called, whenever an attribute' value is requested from an element handler. This method has to return true, if simulation should be informed about the request.

Type Parameters:
T - The value type.
Parameters:
element - The simulation element.
name - The attribute's name.
value - The current value of the attribute.
Returns:
True, if request was OK.

setSpeed

void setSpeed(double speed)
Set the simulation speed factor, given in multiples of real-time.

Parameters:
speed - The simulation speed factor.

getSpeed

double getSpeed()
Get the simulation speed factor, given in multiples of real-time.

Returns:
The simulation speed factor.