26.08.2013 Views

3.1 MB - Evernote

3.1 MB - Evernote

3.1 MB - Evernote

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Simulation Controller side<br />

52<br />

Implementation<br />

At the Simulation Controller side is the root package parallelJavaGpssSimulator. It<br />

contains the class Simulate, which is the application class that is used to start the<br />

parallel simulator. When run the Simulate class will load the configuration from<br />

command line arguments or the configuration file, it will also load and parse the<br />

simulation model file and then create an Active Object instance of the<br />

SimulationController class (the JavaDoc documentation for this class can be found in<br />

Appendix E). The SimulationController instance receives the configuration settings and<br />

the simulation model when its simulate() method is called. As a result of this call the<br />

SimulationController class will read the deployment descriptor file and create the<br />

required number of LogicalProcess instances at the specified nodes.<br />

Logical Process side<br />

The functionality of the Logical Processes is found in the package<br />

parallelJavaGpssSimulator.lp. This package contains the LogicalProcess class, the<br />

ParallelSimulationEngine class (the JavaDoc documentation for both can be found in<br />

Appendix E) and a few helper classes. The LogicalProcess instances are created as<br />

Active Objects by the Simulation Controller. After their creation the LogicalProcess<br />

instances receive the simulation model partitions and the configuration when their<br />

initialize() method is called. When all LogicalProcess instances are initialised then the<br />

Simulation Controller calls their startSimulation() method to start the simulation. Figure<br />

15 illustrates the communication flow between the Simulation Controller and the<br />

Logical Processes before and at the end of the simulation. The method calls just<br />

described can be found at the start of this communication flow. When the Simulation<br />

Controller detects that a confirmed simulation end has been reached then all Logical<br />

Processes are requested to end the simulation with a consistent state matching that<br />

confirmed simulation end using the endOfSimulationByTransaction() method. The<br />

Logical Processes will confirm when they reached the consistent simulation state after<br />

which the Simulation Controller will request the post simulation report details from<br />

each Logical Process. Further specific details about the implementation of the parallel<br />

simulator can be found in section 5.3.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!