Class SimulationMiddleware
- java.lang.Object
-
- edu.kit.ipd.sdq.eventsim.middleware.SimulationMiddleware
-
- All Implemented Interfaces:
ISimulationMiddleware
public class SimulationMiddleware extends Object implements ISimulationMiddleware
The simulation middleware is the central point of the simulation component based simulation. This component is activated in the simulator launch configuration.
-
-
Constructor Summary
Constructors Constructor Description SimulationMiddleware(EventManager eventManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMeasurementCount()
Gives access the the amount of measurements done in the current simulation.de.uka.ipd.sdq.probfunction.math.IRandomGenerator
getRandomGenerator()
ISimulationConfiguration
getSimulationConfiguration()
Gives access to the simulation configuration of the current simulationde.uka.ipd.sdq.simulation.abstractsimengine.ISimulationControl
getSimulationControl()
Gives access to the simulation control instancede.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel
getSimulationModel()
Gives access to the abstract sim engine simulation model, which is the core of the simulation.void
increaseMeasurementCount()
Increases the simulation measurement count.boolean
isStopping()
<T extends SimulationEvent>
voidregisterEventHandler(Class<T> eventType, IEventHandler<T> handler)
Registers a new event handler for events of a specified type.<T extends SimulationEvent>
voidregisterEventHandler(Class<T> eventType, IEventHandler<T> handler, String filter)
void
startSimulation(de.uka.ipd.sdq.simulation.IStatusObserver statusObserver)
Starts a simulation run.void
stopSimulation()
Stops the simulation run.void
triggerEvent(SimulationEvent event)
Triggers the specified simulation event.
-
-
-
Constructor Detail
-
SimulationMiddleware
@Inject public SimulationMiddleware(EventManager eventManager)
-
-
Method Detail
-
startSimulation
public void startSimulation(de.uka.ipd.sdq.simulation.IStatusObserver statusObserver)
Starts a simulation run.- Specified by:
startSimulation
in interfaceISimulationMiddleware
- Parameters:
statusObserver
- A status observer which indicates the simulation progress in the GUI.
-
stopSimulation
public void stopSimulation()
Stops the simulation run.- Specified by:
stopSimulation
in interfaceISimulationMiddleware
-
isStopping
public boolean isStopping()
- Specified by:
isStopping
in interfaceISimulationMiddleware
- Returns:
true
if a simulation stop has been requested;false
else
-
triggerEvent
public void triggerEvent(SimulationEvent event)
Description copied from interface:ISimulationMiddleware
Triggers the specified simulation event. Does not return to the caller until delivery of the event is completed.- Specified by:
triggerEvent
in interfaceISimulationMiddleware
- Parameters:
event
- the event to trigger
-
registerEventHandler
public <T extends SimulationEvent> void registerEventHandler(Class<T> eventType, IEventHandler<T> handler, String filter)
- Specified by:
registerEventHandler
in interfaceISimulationMiddleware
-
registerEventHandler
public <T extends SimulationEvent> void registerEventHandler(Class<T> eventType, IEventHandler<T> handler)
Description copied from interface:ISimulationMiddleware
Registers a new event handler for events of a specified type.- Specified by:
registerEventHandler
in interfaceISimulationMiddleware
- Parameters:
eventType
- The event type to listen forhandler
- The event handler
-
getSimulationConfiguration
public ISimulationConfiguration getSimulationConfiguration()
Gives access to the simulation configuration of the current simulation- Specified by:
getSimulationConfiguration
in interfaceISimulationMiddleware
- Returns:
- A simulation configuration
-
increaseMeasurementCount
public void increaseMeasurementCount()
Description copied from interface:ISimulationMiddleware
Increases the simulation measurement count. One measurement means one user request was entirely processed.- Specified by:
increaseMeasurementCount
in interfaceISimulationMiddleware
-
getMeasurementCount
public int getMeasurementCount()
Description copied from interface:ISimulationMiddleware
Gives access the the amount of measurements done in the current simulation. One measurement means one user request was entirely processed.- Specified by:
getMeasurementCount
in interfaceISimulationMiddleware
- Returns:
- The amount of measurement for the current simulation run.
-
getSimulationModel
public de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel getSimulationModel()
Description copied from interface:ISimulationMiddleware
Gives access to the abstract sim engine simulation model, which is the core of the simulation. It basically represents the main simulation timeline.- Specified by:
getSimulationModel
in interfaceISimulationMiddleware
- Returns:
- The simulation model
-
getSimulationControl
public de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationControl getSimulationControl()
Description copied from interface:ISimulationMiddleware
Gives access to the simulation control instance- Specified by:
getSimulationControl
in interfaceISimulationMiddleware
- Returns:
- The simulation control
-
getRandomGenerator
public de.uka.ipd.sdq.probfunction.math.IRandomGenerator getRandomGenerator()
- Specified by:
getRandomGenerator
in interfaceISimulationMiddleware
- Returns:
-
-