© National University of Singapore. All rights reserved.
Simulator Template |
Contents3. Implementation This section fundamentally describes the structure of the SPaDES/Java framework in terms of its Java classes. 3.1 SPaDES/Java Class HierarchyThe major components of the SPaDES/Java class hierarchy are shown in Figure 3.1 below. All the SPaDES/Java classes are sub-classes of the Thread class in the standard Java library. The SPaDES/Java package consists of the following simulation classes :
Figure 3.1 - SPaDES/Java class hierarchy3.2 SPaDES/Java Class SpecificationsResources in the process-oriented view are regarded as passive processes. The Resource class contains an implicit queue and methods that model the arrival and departure of an SProcess object, but these are transparent to the simulationist, whose operating environment only revolves around the SProcess class. The only significance is the constructor of the Resource object. There are three different versions, but the one which is normally called is the following : public Resource(String name, int units)
where name refers to the name of the resource and units refer to the total number of service units that the resource constitutes. Resources involved in a SPaDES/Java simulation have to be declared in the Executive-extended class object, which codes for the simulation kernel. The SProcess class models a process object in the system. The simulationist manipulates processes via a set of abstracted methods, known as primitives, declared within the SProcess class. There are six such primitives, corresponding to the state transition model illustrated in 2.2. The following table describes these primitives briefly.
| |||||||||||||||||||||
Syntax Summary | ||||||||||||||||||||||
Sample Programs | ||||||||||||||||||||||
Sample Output | ||||||||||||||||||||||
Performance | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 | ||||||||||||||||||||||
1 |