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.

47<br />

Implementation<br />

can easily be modelled in any simulation model using an additional GENERATE and<br />

TERMINATE block. For instance if a simulation is supposed to be terminated when it<br />

reaches a simulation time of 10,000 then an additional GENERATE block is added that<br />

generates a single Transaction for the simulation time 10,000 immediately followed by a<br />

TERMINATE block that stops the simulation when that Transaction is terminated. This<br />

additional set of GENERATE and TERMINATE block can either be added to the end of<br />

an existing partition or as an additional partition. All other TERMINATE blocks in such<br />

a simulation will need to have a decrement parameter of 0. The following GPSS code<br />

shows an example model that will terminate at the simulation time 10,000.<br />

PARTITION Partition1,1 sets Termination Counter to 1<br />

… original model partition<br />

GENERATE 1,0,10000 generates a Transaction for time 10000<br />

TERMINATE 1 end of simulation after 1 Transaction<br />

5.2 Implementation Phases<br />

The following sections will describe the four main development phases of the parallel<br />

simulator.<br />

5.2.1 Model Parsing<br />

The classes for parsing and validating the GPSS model read from the model file can be<br />

found in the package parallelJavaGpssSimulator.gpss.parser. A GPSS model file is<br />

parsed by calling the method ModelFileParser.parseFile(). This method returns an<br />

instance of the class Model from the package parallelJavaGpssSimulator.gpss that<br />

contains the whole GPSS model as an object structure. The Model instance contains a<br />

list of model partitions represented by instances of the class Partition and each Partition<br />

instance contains a list of GPSS blocks and lists of other entities like labels, queues,<br />

facilities and storages that make up the model partition.<br />

Global GPSS block references<br />

GPSS simulators require a way of referencing GPSS blocks. A TRANSFER block for<br />

instance needs to reference the block it should transfer Transactions to. Sequential<br />

simulators often just use the block index within the model to refer to a specific block.

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

Saved successfully!

Ooh no, something went wrong!