gsim.core
Interface Core

All Superinterfaces:
java.io.Serializable

public interface Core
extends java.io.Serializable

The core is a central class managing model and simulation objects. New models are created by one of the create methods. A simulation is created by passing the Environment object to the createScenarioManager method, which then instantiates a simulation.

Note: There are no means yet to store and open a DefinitionEnvironment, i.e. model setups cannot be persisted.

Author:
Stephan

Method Summary
 ScenarioConnector connectScenarioManager(java.lang.String ns, java.util.HashMap<?,?> props)
          Connects to running simulation.
 DefinitionEnvironment create(java.lang.String ns, java.util.HashMap<?,?> props)
          Create a gsim Environment.
 DefinitionEnvironment create(java.lang.String ns, java.io.InputStream setup, java.util.HashMap<?,?> props)
          Create a gsim Environment from an existing model file.
 BatchManager createBatchManager(Executable ex, java.util.HashMap<java.lang.String,java.lang.Object> props)
          Creates a BatchManager.
 ScenarioManager createScenarioManager(DefinitionEnvironment env, java.util.HashMap<java.lang.String,java.lang.Object> props, int steps, int runs)
          Creates a ScenarioManager (used to start and control simulation).
 java.io.InputStream getModelDefinition(java.lang.String canonicalPath)
          Utility method to open a file containing a model definition in xml format.
 java.lang.String[] getRunningSimulations(java.util.HashMap<?,?> props)
          Connects to the simulation engine and retrieves the ids of simulations currently being executed.
 

Method Detail

connectScenarioManager

ScenarioConnector connectScenarioManager(java.lang.String ns,
                                         java.util.HashMap<?,?> props)
                                         throws GSimException
Connects to running simulation.

Parameters:
ns - namespace of the model
props - property table
Returns:
ScenarioConnector
Throws:
GSimException

create

DefinitionEnvironment create(java.lang.String ns,
                             java.util.HashMap<?,?> props)
                             throws GSimException
Create a gsim Environment.

Parameters:
ns - namespace (a unique identifier) of the model
props - property table
Returns:
environment
Throws:
GSimException

create

DefinitionEnvironment create(java.lang.String ns,
                             java.io.InputStream setup,
                             java.util.HashMap<?,?> props)
                             throws GSimException
Create a gsim Environment from an existing model file.

Parameters:
ns - nameSpace (a unique identifier) of the model
setup - input-stream of the model file
props - property table
Returns:
DefinitionEnvironment
Throws:
GSimException

createBatchManager

BatchManager createBatchManager(Executable ex,
                                java.util.HashMap<java.lang.String,java.lang.Object> props)
                                throws GSimException
Creates a BatchManager. A BatchManager is a utility that executes a java class on behalf of the user. For example, the user writes a program that iterates over a number of parameter settings. In remote mode, this class is sent the server.

Parameters:
ex - executable interface
props - runtime properties
Returns:
BatchManager
Throws:
GSimException

createScenarioManager

ScenarioManager createScenarioManager(DefinitionEnvironment env,
                                      java.util.HashMap<java.lang.String,java.lang.Object> props,
                                      int steps,
                                      int runs)
                                      throws GSimException
Creates a ScenarioManager (used to start and control simulation).

Parameters:
env - DefinitionEnvironment
props - runtime properties
steps - number of steps the simulation shall run
runs - number of repetitions
Returns:
ScenarioManager
Throws:
GSimException

getModelDefinition

java.io.InputStream getModelDefinition(java.lang.String canonicalPath)
Utility method to open a file containing a model definition in xml format. return input-stream

Parameters:
canonicalPath - path to the file

getRunningSimulations

java.lang.String[] getRunningSimulations(java.util.HashMap<?,?> props)
                                         throws GSimException
Connects to the simulation engine and retrieves the ids of simulations currently being executed.

Parameters:
props - Property table
Returns:
List of simulation ids
Throws:
GSimException