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
All Methods Instance Methods Abstract Methods Concrete Methods 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 Detail
-
connection
protected final TConnection connection
Connection to the IMB hub.
-
-
Constructor Detail
-
ModelStarter
public ModelStarter(String[] args, String providedModelName, int providedModelId) throws IMBException
Create a new ModelStarter.- Parameters:
args- String[]; the command line argumentsprovidedModelName- String; name of the modelprovidedModelId- int; id of the model- Throws:
IMBException
-
-
Method Detail
-
startModel
public abstract void startModel(ModelParameters parameters, TConnection imbConnection)
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
public abstract void parameterRequest(ModelParameters parameters)
The model must fill in its parameters.- Parameters:
parameters- ModelParameters; ModelParameters
-
doStartModel
public void doStartModel(ModelParameters parameters) throws IMBException
Start a model.- Parameters:
parameters- ModelParameters; the parameters needed to start the model- Throws:
IMBException- ...
-
doStopModel
public void doStopModel() throws IMBExceptionStop the model and go to idle state.- Throws:
IMBException- ...
-
doQuitApplication
public void doQuitApplication()
Terminate the application.
-
signalModelProgress
public void signalModelProgress(int currentProgress) throws IMBExceptionReport a new progress value.- Parameters:
currentProgress- int; the new progress value- Throws:
IMBException
-
signalModelState
public void signalModelState(ModelState newState, String federation) throws IMBException
Inform a federation about a state change.- Parameters:
newState- ModelState; the new statefederation- String; the federation- Throws:
IMBException- ...
-
signalModelState
public void signalModelState(ModelState newState) throws IMBException
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
public String getRemoteHost()
Retrieve the remote host name.- Returns:
- String; the name of the remote host
-
-