Package nl.tno.imb.mc
Class ModelStarter
java.lang.Object
nl.tno.imb.mc.ModelStarter
public abstract class ModelStarter extends Object
Model starter.
-
Field Summary
Fields Modifier and Type Field Description protected TConnectionconnectionConnection to the IMB hub. -
Constructor Summary
Constructors Constructor Description ModelStarter(String[] args, String providedModelName, int providedModelId)Create a new ModelStarter. -
Method Summary
Modifier and Type Method Description voiddoQuitApplication()Terminate the application.voiddoStartModel(ModelParameters parameters)Start a model.voiddoStopModel()Stop the model and go to idle state.StringgetRemoteHost()Retrieve the remote host name.intgetRemotePort()Retrieve the remote port number.abstract voidparameterRequest(ModelParameters parameters)The model must fill in its parameters.abstract voidquitApplication()Kill the model; called before this application exits.voidsignalModelProgress(int currentProgress)Report a new progress value.voidsignalModelState(ModelState newState)Inform our federation about a state change.voidsignalModelState(ModelState newState, String federation)Inform a federation about a state change.abstract voidstartModel(ModelParameters parameters, TConnection imbConnection)Start the model.abstract voidstopModel()Stop the model.
-
Field Details
-
connection
Connection to the IMB hub.
-
-
Constructor Details
-
ModelStarter
public ModelStarter(String[] args, String providedModelName, int providedModelId) throws IMBExceptionCreate a new ModelStarter.- Parameters:
args- String[]; the command line argumentsprovidedModelName- String; name of the modelprovidedModelId- int; id of the model- Throws:
IMBException
-
-
Method Details
-
startModel
Start the model.- Parameters:
parameters- ModelParameters; ModelParametersimbConnection- TConnection; connection to the IMB hub
-
stopModel
public abstract void stopModel()Stop the model. -
quitApplication
public abstract void quitApplication()Kill the model; called before this application exits. -
parameterRequest
The model must fill in its parameters.- Parameters:
parameters- ModelParameters; ModelParameters
-
doStartModel
Start a model.- Parameters:
parameters- ModelParameters; the parameters needed to start the model- Throws:
IMBException- ...
-
doStopModel
Stop the model and go to idle state.- Throws:
IMBException- ...
-
doQuitApplication
public void doQuitApplication()Terminate the application. -
signalModelProgress
Report a new progress value.- Parameters:
currentProgress- int; the new progress value- Throws:
IMBException
-
signalModelState
Inform a federation about a state change.- Parameters:
newState- ModelState; the new statefederation- String; the federation- Throws:
IMBException- ...
-
signalModelState
Inform our federation about a state change.- Parameters:
newState- ModelState; the new state- Throws:
IMBException- ...
-
getRemotePort
public int getRemotePort()Retrieve the remote port number.- Returns:
- int; the remote port number
-
getRemoteHost
Retrieve the remote host name.- Returns:
- String; the name of the remote host
-