public abstract class ModelStarter extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static String |
CLIENTS_ROOT_EVENT_NAME
Default clients root event name.
|
protected TConnection |
connection
Connection to the IMB hub.
|
(package private) static String |
CONTROLLER_PRIVATE_EVENT_NAME_SWITCH
Command line Controller private event name switch.
|
(package private) static String |
CONTROLLER_SWITCH
Command line controller switch.
|
(package private) static String |
CONTROLLERS_EVENT_NAME_SWITCH
Command line controllers event name switch.
|
(package private) static String |
CONTROLLERS_ROOT_EVENT_NAME
Controllers root event name.
|
(package private) static String |
DATA_SOURCE_PARAMETER_NAME
Data source parameter name.
|
(package private) static String |
DEFAULT_CONTROLLER
The default controller.
|
(package private) static String |
DEFAULT_IDLE_FEDERATION
Default idle federation.
|
(package private) static String |
DEFAULT_MODEL_ID
Default model id (must be numeric).
|
(package private) static String |
DEFAULT_MODEL_NAME
Default for model name.
|
(package private) static String |
DEFAULT_MODEL_PRIORITY
Default model priority.
|
(package private) static String |
DEFAULT_REMOTE_HOST
Default remote host.
|
(package private) static String |
DEFAULT_REMOTE_PORT
Default remote port.
|
(package private) static String |
EVENT_NAME_PART_SEPARATOR
Event name part separator.
|
(package private) static String |
FEDERATION_PARAMETER_NAME
Federation parameter name.
|
(package private) static String |
IDLE_FEDERATION_SWITCH
Command line idle federation switch.
|
(package private) static String |
LINK_ID_SWITCH
Command line link id switch.
|
(package private) static String |
MODEL_ID_SWITCH
Command line model id switch.
|
(package private) static String |
MODEL_NAME_SWITCH
Command line model name switch.
|
(package private) static String |
MODEL_PRIORITY_SWITCH
Command line model priority switch.
|
(package private) int |
priority
Priority.
|
(package private) int |
progress
Progress.
|
(package private) static String |
REMOTE_HOST_SWITCH
Command line remote host switch.
|
(package private) static String |
REMOTE_PORT_SWITCH
Command line remote port switch.
|
(package private) ModelState |
state
State of the model.
|
Constructor and Description |
---|
ModelStarter(String[] args,
String providedModelName,
int providedModelId)
Create a new ModelStarter.
|
Modifier and Type | Method and Description |
---|---|
void |
doQuitApplication()
Terminate the application.
|
void |
doStartModel(ModelParameters parameters)
Start a model.
|
void |
doStopModel()
Stop the model and go to idle state.
|
String |
getRemoteHost()
Retrieve the remote host name.
|
int |
getRemotePort()
Retrieve the remote port number.
|
(package private) void |
handleControlEvents(TEventEntry event,
TByteBuffer payload)
Execute a control event.
|
abstract void |
parameterRequest(ModelParameters parameters)
The model must fill in its parameters.
|
abstract void |
quitApplication()
Kill the model; called before this application exits.
|
void |
signalModelProgress(int currentProgress)
Report a new progress value.
|
void |
signalModelState(ModelState newState)
Inform our federation about a state change.
|
void |
signalModelState(ModelState newState,
String federation)
Inform a federation about a state change.
|
abstract void |
startModel(ModelParameters parameters,
TConnection imbConnection)
Start the model.
|
abstract void |
stopModel()
Stop the model.
|
static final String CONTROLLERS_ROOT_EVENT_NAME
static final String CLIENTS_ROOT_EVENT_NAME
static final String FEDERATION_PARAMETER_NAME
static final String DATA_SOURCE_PARAMETER_NAME
static final String REMOTE_HOST_SWITCH
static final String DEFAULT_REMOTE_HOST
static final String REMOTE_PORT_SWITCH
static final String DEFAULT_REMOTE_PORT
static final String IDLE_FEDERATION_SWITCH
static final String DEFAULT_IDLE_FEDERATION
static final String LINK_ID_SWITCH
static final String CONTROLLERS_EVENT_NAME_SWITCH
static final String CONTROLLER_PRIVATE_EVENT_NAME_SWITCH
static final String CONTROLLER_SWITCH
static final String DEFAULT_CONTROLLER
static final String EVENT_NAME_PART_SEPARATOR
static final String MODEL_NAME_SWITCH
static final String DEFAULT_MODEL_NAME
static final String MODEL_ID_SWITCH
static final String DEFAULT_MODEL_ID
static final String MODEL_PRIORITY_SWITCH
static final String DEFAULT_MODEL_PRIORITY
protected final TConnection connection
ModelState state
int priority
int progress
public ModelStarter(String[] args, String providedModelName, int providedModelId) throws IMBException
args
- String[]; the command line argumentsprovidedModelName
- String; name of the modelprovidedModelId
- int; id of the modelIMBException
public abstract void startModel(ModelParameters parameters, TConnection imbConnection)
parameters
- ModelParametersimbConnection
- TConnection; connection to the IMB hubpublic abstract void stopModel()
public abstract void quitApplication()
public abstract void parameterRequest(ModelParameters parameters)
parameters
- ModelParameterspublic void doStartModel(ModelParameters parameters) throws IMBException
parameters
- ModelParameters; the parameters needed to start the modelIMBException
- ...public void doStopModel() throws IMBException
IMBException
- ...public void doQuitApplication()
void handleControlEvents(TEventEntry event, TByteBuffer payload) throws IMBException
event
- TEventEntry; the eventpayload
- TByteBuffer; details of the eventIMBException
- when the payload is malformed.public void signalModelProgress(int currentProgress) throws IMBException
currentProgress
- int; the new progress valueIMBException
public void signalModelState(ModelState newState, String federation) throws IMBException
newState
- ModelState; the new statefederation
- String; the federationIMBException
- ...public void signalModelState(ModelState newState) throws IMBException
newState
- ModelState; the new stateIMBException
- ...public int getRemotePort()
public String getRemoteHost()
Copyright © 2014–2016 Delft University of Technology. All rights reserved.