15
*Corresponding author. E-mail: tveith@vt.edu. Computers & Operations Research 26 (1999) 607 621 Netsim: Java TM L -based simulation for the World Wide Web Tamie L. Veith!,*, John E. Kobza", C. Patrick Koelling# ! Biological Systems Engineering Department, Virginia Tech, Blacksburg, VA 24061, USA " Department of Industrial and Systems Engineering, Virginia Tech, Blacksburg, VA 24061, USA # School of Industrial Engineering and Management, Oklahoma State University, Stillwater, OK 74078, USA Received December 1997; received in revised form April 1998 Abstract Current literature motivates development of a general, WWW-based simulation package with maximum user interactivity and cross-platform capabilities. Netsim, a general, WWW-based, discrete-event simulation package written entirely in Java, meets this need. Java is an object-oriented programming language designed for internet programming. It makes Netsim possible and enables easy incorporation with existing WWW materials. As a result, Netsim supports and enhances the existing WWW environment for users of all levels. Netsim provides complete model creation and modification capabilities, through the event graph paradigm, along with both graphical animation and data output. Netsim allows expandability for complex modeling and integration with other Java-based programs and future extensions. ( 1999 Elsevier Science Ltd. All rights reserved. Scope and purpose Research in the area of World Wide Web-based simulation is growing rapidly as World Wide Web (WWW) programming tools develop. Still, much of this research provides only limited, WWW-based simulation capabilities. Netsim answers these limitations and provides a positive, unique contribution to WWW-based simulation by combining Java, event graphs, and the WWW into a general simulation package. In particular, Netsim (1) provides a simple method for including interactive, discrete-event simulation in WWW sites, (2) uses graphical interfaces for model entry, editing and manipulation, (3) allows user control of model execution, (4) provides animated and numerical output, (5) uses Java to provide: (i) object oriented flexibility which: (a) allows straightforward code modification and re-use, (b) minimizes computer memory usage, (c) allows easy program expansion; (ii) platform independence through the WWW; (iii) compatibility with other Java-based graphical and analytical tools, and (6) does not require external applications or databases. By accessing Netsim simulation models through the WWW, users are able to ensure a common reference and to easily communicate, building on understandings and ideas. Additionally, 0305-0548/99/$ see front matter ( 1999 Elsevier Science Ltd. All rights reserved. PII: S 0 3 0 5 - 0 5 4 8 ( 9 8 ) 0 0 0 3 9 - 2

Netsim: Java™-based simulation for the World Wide Web

Embed Size (px)

Citation preview

Page 1: Netsim: Java™-based simulation for the World Wide Web

*Corresponding author. E-mail: [email protected].

Computers & Operations Research 26 (1999) 607—621

Netsim: Java TML-based simulation for the World Wide Web

Tamie L. Veith!,*, John E. Kobza", C. Patrick Koelling#

! Biological Systems Engineering Department, Virginia Tech, Blacksburg, VA 24061, USA" Department of Industrial and Systems Engineering, Virginia Tech, Blacksburg, VA 24061, USA

# School of Industrial Engineering and Management, Oklahoma State University, Stillwater, OK 74078, USA

Received December 1997; received in revised form April 1998

Abstract

Current literature motivates development of a general, WWW-based simulation package with maximumuser interactivity and cross-platform capabilities. Netsim, a general, WWW-based, discrete-event simulationpackage written entirely in Java, meets this need. Java is an object-oriented programming language designed forinternet programming. It makes Netsim possible and enables easy incorporation with existing WWW materials.As a result, Netsim supports and enhances the existing WWW environment for users of all levels. Netsim providescomplete model creation and modification capabilities, through the event graph paradigm, along with bothgraphical animation and data output. Netsim allows expandability for complex modeling and integration withother Java-based programs and future extensions. ( 1999 Elsevier Science Ltd. All rights reserved.

Scope and purpose

Research in the area of World Wide Web-based simulation is growing rapidly as World Wide Web(WWW) programming tools develop. Still, much of this research provides only limited, WWW-basedsimulation capabilities. Netsim answers these limitations and provides a positive, unique contribution toWWW-based simulation by combining Java, event graphs, and the WWW into a general simulationpackage. In particular, Netsim (1) provides a simple method for including interactive, discrete-eventsimulation in WWW sites, (2) uses graphical interfaces for model entry, editing and manipulation, (3) allowsuser control of model execution, (4) provides animated and numerical output, (5) uses Java to provide: (i)object oriented flexibility which: (a) allows straightforward code modification and re-use, (b) minimizescomputer memory usage, (c) allows easy program expansion; (ii) platform independence through the WWW;(iii) compatibility with other Java-based graphical and analytical tools, and (6) does not require externalapplications or databases. By accessing Netsim simulation models through the WWW, users are able toensure a common reference and to easily communicate, building on understandings and ideas. Additionally,

0305-0548/99/$— see front matter ( 1999 Elsevier Science Ltd. All rights reserved.PII: S 0 3 0 5 - 0 5 4 8 ( 9 8 ) 0 0 0 3 9 - 2

Page 2: Netsim: Java™-based simulation for the World Wide Web

through animation and data output, Netsim contributes a graphic as well as analytic representation ofa system process. This enables users to understand the system both visually and statistically.

Keywords: Internet; Java; Modeling; Object-oriented simulation

1. Introduction

Professionals and educators increasingly connect to the World Wide Web (WWW), throughWWW browsers such as Netscape Navigator, to access resources, share information, schedulemeetings, and leave messages. Using Java TML, a WWW-based programming language, people cannow customize and interact with WWW-based computational programs as they would withtraditional, non-Internet-based programs. In particular, Java allows website designers to incorpor-ate interactive simulation, enhancing the site for targeted audiences as well as other interestedusers.

This paper describes and analyzes Netsim, a Java-based, WWW simulation package(http://hokies.ise.vt.edu/netsim). Netsim is a general, discrete-event simulation package based onthe event graph approach [1,2]. The package provides users with the same modeling capabilitiesand degree of interactive, multimedia capability as do non-Internet-based programs [3].

The event graph approach models a system by using state variables, events and connectionsbetween events. The state variables, which maintain the current status of and collect data about themodel, are updated as the events execute. The connections between events control the scheduling offuture events. The simulation model is depicted as a graph where the events are represented asnodes and the connections between events are represented as edges. Graphical interfaces, such asimplemented in the workstation-based simulation language SIGMA [2], facilitate editing andviewing of the simulation model.

Netsim offers both modelers and users two large advantages over many traditionalsimulation packages. First, Netsim’s object-oriented paradigm and use of the event graphsimulation method provides distinct modeling advantages over procedural-based simulationpackages such as SLAM II' [4]. This combination of paradigms allows the capabilities ofNetsim to be easily modified, maintained, or expanded and allows for code re-use. Additionally,it helps minimize the amount of computer memory used by a Netsim simulation model[5,6].

Secondly, a simulation problem modeled in Netsim can be instantly viewed as an animatedmodel on a WWW browser, allowing users to benefit fully from the advantages of the WWWenvironment. The resulting models are then easily explored and manipulated by any colleagues orclients connected to the WWW without the introduction of additional, possibly unfamiliarsoftware. Through the platform-independence of Java, Netsim users avoid system compatibilityproblems often encountered with non-Internet programs. Additionally, WWW applications aregenerally maintained in a single location, allowing the Netsim simulation modeler to easilydistribute modifications, regulate file versions, and control user access. Other benefits withWWW-based applications, such as Netsim, include access from distant sites and off-hour avail-ability.

608 T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621

Page 3: Netsim: Java™-based simulation for the World Wide Web

2. Literature review/motivation

Research in the area of WWW-based simulation is developing rapidly as WWW programmingtools develop. Still, much of this research provides only limited, WWW-based simulation capabili-ties. Netsim answers these limitations and provides a positive, unique contribution to WWW-based simulation.

Thorpe helped introduce the idea of Internet-based simulation and, with the development of DISas a standardized protocol, simulation developers and users began to realize the potential benefitsof networked simulation [7]. Unfortunately, DIS is mainly geared toward specific, technicalsituations and is not connected to the type of widely accessed, open-topic, network environmentpresented by the WWW.

By creating simulation models linked to HTML pages, Neilson [8] and Cole and Tooker [9,10]set the stage for incorporating analytical information tools to the WWW environment. Theirsimulation packages allow user interaction, through the WWW browser, between provided modelsand any relevant WWW sites. However at this stage, Java was not available. As a result, both oftheir simulation packages require the model and/or the appropriate, browser-compatible softwareto reside on the user’s machine.

Both Singh [11] and Bradley [12] realized the effectiveness of the Java applet as a WWWmultimedia tool. By including informational applets in their science tutorials and research publica-tions, they enhance the informational value for the user as well as the potential for the user toreproduce reported results more easily. Unfortunately, neither of these implementations take fulladvantage of the interactive capabilities of Java, particularly in terms of a general WWW-basedsimulation tool.

By combining a database for handling data with a Java applet for displaying the model to theuser, Nair’s JSIM package provides more interactivity for the user [13]. Additionally, because thedatabase resides on the server, JSIM realizes many of the potential advantages of WWWsimulation. The main drawback to JSIM is the interruption during simulating caused by constantinformation transfer between the database and the applet.

SimKit, created by Buss and Stork [14], is written entirely in Java, eliminating the need forthe model to reside on the user’s machine and to have a connected database. SimKit allows afair degree of user interaction through a form for entering and editing basic model parameters.Additionally, although it does not provide model animation, SimKit does combine withJava-based graphing packages to provide a number of statistical and graphical interpretations. Byusing the event-graph approach and utilizing the object-oriented nature of the Java language,SimKit allows for future expansion. However, the current focus is primarily toward militaryapplications.

Netsim, like SimKit, is written entirely in Java and models discrete-event simulations using theevent graph approach. A model created in Netsim appears as an applet on an HTML page and isavailable over the WWW, taking full advantage of the portability of Java. No special software orcode is needed on the user’s machine.

As a general simulation package that allows users to define and customize models, Netsimprovides more model flexibility than SimKit. The object-oriented structure offered by Java andmaintained in Netsim allows easy expansion of the package as well as compatibility with otherJava-based tools such as the graphing or analytical tools used by SimKit.

T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621 609

Page 4: Netsim: Java™-based simulation for the World Wide Web

Netsim provides a maximum amount of user interaction with the simulation model. A program-ming interface provides a blank template with text fields for the various parts of a simulationmodel, such as event names and state variables. Any type of basic simulation model may be enteredinto this interface by following the appropriate format, as described in Section 5. While knowledgeof simulation, particularly including the event graph approach, is useful in designing a model inNetsim, no knowledge of Java or simulation modeling is required to enter or modify the model.

A second interface allows the user to control execution of the simulation model. This interfacenot only provides start, pause, and stop capabilities and data output, but also an animation of themodel. Model animation allows viewers a visual demonstration of how the system is operating overtime. This is an important feature of Netsim in that users of all education backgrounds can use thisWWW-based simulation tool to visually understand the operation of a system or process.

Netsim addresses the limitations presented in the current WWW-based simulation literature.Yet, it also incorporates the many advantages of WWW simulation, such as wide availability,controlled access, efficient maintenance, and increased WWW integration. Netsim enhances theWWW environment, offering an effective, general simulation tool that provides both modelanimation and data output. Additionally, Netsim’s capabilities for expansion and combinationwith other Java tools ensure that Netsim can grow with the technology supported by Java and theWWW.

3. Package design

As discussed in Section 1, the Netsim simulation package supports discrete-event simulationusing event-graph modeling. Consisting of two user interfaces, an input interface for defining andediting the model and an output interface for viewing the model, Netsim features complete modelcreation and modification capabilities as well as standard simulation data collection capabilities.The current version of Netsim handles up to six events and six total connections between events,which is sufficient to demonstrate the concept of WWW-based simulation. Netsim’s capabilitiescan be expanded by modifying the interfaces used to define and display the model.

Netsim allows the user to choose the random number seed, the run-length and the output mode(animation and/or data). It runs as a Java applet on any Java-compatible WWW browser or appletviewer. Additionally, a basic user’s manual written in HTML accompanies the Netsim packageand, through the WWW, is linked to the HTML page containing the Netsim applet. The manualexplains how to create and interact with a model using Netsim.

Due to the object-oriented structure of Java and Netsim, most of Netsim’s classes inherita number of standard classes contained in the Java class library. For example, the Netsim classdefining the viewing interface includes the java.awt.Graphics class and extends the java.awt.Canvasclass. These classes provide behaviors for drawing, updating, and displaying the graphic version ofthe simulation model onto the interface. Both of these classes are contained in the AbstractWindow Toolkit (AWT) package of the Java class library, available to all programmers.

Fig. 1 outlines the relationship among all classes specifically created for and contained within theNetsim package. Currently, none of the Netsim classes extends another class within Netsim.Consequently, it should be understood that Fig. 1 is not a class hierarchy diagram in the sense thata class in the lower level of the chart extends a class in an upper level. Rather, upper level classes

610 T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621

Page 5: Netsim: Java™-based simulation for the World Wide Web

Fig. 1. Netsim package internal structure.

invoke instances of connected, lower level classes and call methods within those classes. Thepackage must be compiled as a group or the classes compiled in succession from the lowest levelupward.

The Netsim simulation package can be considered from a number of different levels. At the mostgeneral level, Netsim consists of three interconnected pieces: a user/programmer interface, a com-piler, and an interpreter as shown in Fig. 1.

3.1. User/programmer interface

The user/programmer interface provides a means for the programmer to introduce a model intothe simulation package. This interface may be designed to prompt the programmer for specificinformation and specific formats. Alternatively, the interface may be as simple as a text windowwith the expectation that the programmer is familiar with the appropriate format. In the case ofNetsim, this interface, shown in Fig. 2, resembles a general entry form with text fields for thenecessary information. The model user can also use this interface to check and modify modelparameters.

Netsim takes advantage of a Java layout format similar to hypercard to link the programmer’sentry form with the viewing interface (Fig. 3) on which the interpreter will display the simulationoutput. Using password restrictions on this interface link, Netsim may be setup so that theprogramming interface or modifications to the model through it are strictly limited to anauthorized programmer. Alternatively, access may be left unrestricted allowing any user to createand edit his/her own model.

In both interfaces, Netsim makes extensive use of the java.util.StringTokenizer class for parsingdata input. This class is extended by ModelParser and greatly simplifies the compiling process.

T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621 611

Page 6: Netsim: Java™-based simulation for the World Wide Web

Fig. 2. Interface for creating and modifying model.

3.2. Compiler

The compiler reads the data input into the entry form and parses them into forms usable by theinterpreter. Because no special compiler software is needed, the model is instantly executable witha single mouse-click after being entered into Netsim.

3.3. Interpreter

Finally, the interpreter combines the model specifications entered in the entry form withinformation preprogrammed into the simulation package, such as random variate formulas, to

612 T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621

Page 7: Netsim: Java™-based simulation for the World Wide Web

Fig. 3. Interface for viewing model animation and data output.

create a dynamic version of the simulation model. The interpreter provides the user with ananimation of the model as well as requested data output as shown in Fig. 3. Either of the outputoptions may be temporarily canceled, allowing the viewer to get a feel for the general behavior ofthe system by focusing solely on the animation, or providing the data output at a much higherspeed.

4. Information flow

Like Netsim as a whole, the interpreter section of the package can be split into three mainsections: the database, the DataDictionary class; the interfaces for the user, the ViewerPanel,AnimationCanvas and EntryPanel classes; and the simulator, the SchedThread class. The databaseholds the information specific to a given model and supplies these data to the viewing interface as

T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621 613

Page 8: Netsim: Java™-based simulation for the World Wide Web

Fig. 4. Information flow within Netsim.

well as to the user/programmer interface. The interfaces present the model data to the user ina graphical, user-friendly way and enable interaction with the model. Certain user commands onthe viewing interface change the status of a simulation run. The run status is passed to thesimulator, which then determines the next step in the run. This information is sent to the databasefor processing, resulting in new and revised data for display on the interfaces. Fig. 4 depicts thisongoing cycle. The following subsections discusses each of the three pieces in more detail.

4.1. Database

The database categorizes initial input according to its role in the model and then transforms eachtype of input into a functional data form that it can manipulate and analyze. The data are stored inhashtables or vectors until needed. Once a simulation run begins, the database takes the next eventfrom the future events list of the simulator, calculates new state variables and random variatevalues, as necessary, and updates existing database values. Finally, the database updates the futureevents list and sends requested data to the viewing interface.

4.2. Interfaces

The viewing interface displays the simulation model graphically, redrawing the screen as datachanges are received from the database. It also displays data output, such as the time and name ofthe current event. This interface and the user/programmer interface link the user to the heart ofthe simulation program by presenting model specific information and animating the behaviorof the model. Additionally, the viewing interface provides tools such as menus and buttons thatallow the user to alter model parameters and control the status of the simulation run. The currentrun status and any changes in the model parameters are passed to the simulator.

4.3. Simulator

The simulator accepts run status and model parameter information from the viewing interfaceand monitors the simulation clock and the future events list. Using the run status, specifiedrun-length, current clock time and future events list, the simulator determines the next action of thesimulation. The simulator sends this information to the database, enabling the database to processthe next event and update variable values.

614 T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621

Page 9: Netsim: Java™-based simulation for the World Wide Web

5. Model creation

At any time a user may switch between the user/programmer interface and the viewing interfaceby clicking on the lower right button of the screen, which is labeled “View Simulation” or“Define/Revise Model” depending on the current interface. The save buttons on the lowerleft side of the screen are currently disabled. Ideally, they would allow the user to name andsave either the data output or the model specifications into a directory on the local computer.The data output, as a text file, can then be imported into traditional spreadsheet and analysispackages and is available for further analysis by the user. The model specifications, also as atext file, act as parameters that, when opened in Netsim, define the saved model. Due to securityrestrictions, Java applets themselves are currently not able to be saved in this type of manner.While saving and retrieving text from an applet as described is theoretically possible, it was notattempted in this version of Netsim and actual limitations and implementation difficulties areunclear.

To create a model, the programmer simply enters the name of each event into the entry forminterface, followed by the state variable rules for that event. All names and variables are case-sensitive. The events will appear on the animated model from left to right in the order they areentered on the entry form. The state variables will also be processed in the order they are listed.This may make a difference in the results of a model if one variable references another during thesame event.

Each event may contain as many variables and variable rules as desired. A variable rule may dothe following, for the example variables Q, TS, ¹, TE and the array ¼[ ]:

f Change the existing value by assigning a new integer value (e.g., Q"1, where Q is the variablename and 1 is the new variable value).

f Increase or decrease the existing value by an integer amount, (e.g., Q"#1 or Q"!1).f Increase or decrease the existing value by another variable, (e.g., Q"#TS or Q"!TS).f Assign the current simulation time to a variable using the reserved word ‘‘clk’’, (e.g., ¹"clk).f Increase or decrease the existing value by ‘‘clk’’, the current simulation time, (e.g., ¹"#clk).f Assign the current ‘‘clk’’ time to the array, ¼[ ], using another variable to index the array, (e.g.,¼[Q]"clk creates an array of clock times indexed by Q).

f Combine any of these six operations, (e.g., TE"clk!TS or ¹"#clk!¼[Q]).

The programmer specifies relationships between events using edges. These connections may becreated between any two events. Events may also be self-scheduling (i.e., the edge leads back to thesame event). Netsim currently allows one edge in each direction between two different events andone edge for each self-scheduling event, with up to one condition on each edge. These limitations, aswell as the current limitation of six event nodes, may be eliminated by extending the current code.However, the interfaces may have to be revised to effectively use the screen to display the modelspecifications and the event graphs of a larger model.

The programmer creates an edge by typing in the name of the event where the edge begins in the‘‘from’’ text box and the event where the edge ends in the ‘‘to’’ text box. These names arecase-sensitive and must match the event names defined in the upper section of the event form or theedge will not appear in the model.

T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621 615

Page 10: Netsim: Java™-based simulation for the World Wide Web

Table 1Format for edge conditions

Var. name Operator Integer value

Examples: Q ( 1Q ' !1Q " 0

TRUE

Basic conditions may be placed on the edges by using the format shown in Table 1. The variablename may be any variable defined as a state variable in the upper section of the event form. Theoperator is (,', or"; the integer value may be any integer. The reserved word ‘‘TRUE’’ typedwithout the quotations in the ‘‘condition’’ text box, makes that edge unconditional.

Additionally, time delays are added to the edges by typing the appropriate function in the ‘‘timedelay’’ text box. These time delay functions are also case-sensitive. Netsim currently supports threetypes of time delays: constant increases, sta(a); uniform random variates, uni(a, b); and exponentialrandom variates, exp(a). The parameters a and b may be any integers chosen by the user. Forexample, the delay defined by sta(5) causes constant time increments of 5 time units, uni(3, 5) causesa delay uniformly distributed between 3 and 5 time units, and exp(5) delays the upcoming event anexponential amount of time with a mean of 5 time units. Netsim is easily expandable to includeother random distributions.

The user alters the priority of an edge by typing the preferred priority, integers 1—9, in the‘‘priority’’ text box. The priority is set by default at 5 with 9 signaling an immediate priority and1 being a very low priority. This priority scale is backwards from that used in SIGMA, a similar,non-Internet simulation package [2]. However, the scale, as used in Netsim, seems to be slightlymore intuitive, particularly to the occasional user. With Netsim an edge requiring a higher priorityshould be assigned a higher priority value.

6. Comparison of Netsim with SIGMA

6.1. The model

Netsim was compared to SIGMA using the carwash model as presented in Fig. 2.6 on p. 26 of theSIGMA documentation [2]. This model is a standard G/G/1 queueing model and provides somemeasure of control in the comparison between the simulation packages. The event graph and statevariable rules of the carwash model are given in Fig. 5 with the variables defined in Table 2. Thetime delay for arrivals was exponentially distributed with a mean of 5 time units, while the servicetime was exponentially distributed with a mean of 3 units.

In case of scheduling ties between interarrivals and services, a higher priority was placed on theenter—enter edge than on the start—leave edge. On a scale of 1—9 the higher priority is 6 in Netsim

616 T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621

Page 11: Netsim: Java™-based simulation for the World Wide Web

Fig. 5. Event graph for carwash model.

Table 2Variable definitions for carwash model

State variables in model:S"d of servers availableQ"d of customers in queueCI"d of customers that have entered systemCO"d of customers that have left systemTS"time customer begins serviceTE"total time server is busy throughout run¼[ ]"array tracking the time of each entry into the systemWT"total accumulated waiting time of customers in the systemt!"interarrival time, exponential with a mean of 5 time units

t4"service time, exponential with a mean of 3 time units

»ariables collected for data comparison:Q"d of customers left in the queueCO"system throughputWT"total waiting timeTE"total server busy time

while in SIGMA it is 4; this is due to the inverse relationship of the two programs’ priority scales.The default priority for both Netsim and SIGMA is 5.

6.2. Results and discussion

To accurately compare treatment of the carwash model between Netsim and SIGMA, thenatural log values produced by SIGMA for the RNG seed 12 352 were input directly into Netsim,bypassing the usual random number generator and natural log calculator. These values were thenused by both Netsim and SIGMA in calculating the required exponential random variates. Outputat each time unit of activity was compared for the time unit, event, number in queue, accumulated

T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621 617

Page 12: Netsim: Java™-based simulation for the World Wide Web

Table 3Sample of simulation run using different clock multipliers

Multiplier Time WT TE

10 000 14433.98 2006.2937 82.814751 000 000 14433.98 2006.294220 82.8147698

system throughput, accumulated time spent in system (or waiting time), and total server busy time.Both packages present identical results to at least the second decimal, differing by at most 0.001.This slight difference is non-accumulating during simulation runs and quite possibly results frompackage differences in byte storage and manipulation.

The future events lists for the two packages matched and, when hand traced, corresponded to thetheoretical behavior of the model. At each step of the run, state variables and random variatesmatched between packages and with theoretical values. In addition, the future events list generatedby Netsim was traced for numerous variations, both stochastic and deterministic, of the carwashmodel. State variables at each simulation step, as well as overall model behavior were examined ineach case and, for deterministic models, were compared to those from identical models run inSIGMA. In all cases the models performed as expected by discrete-event simulation theory.

7. Netsim limitations

7.1. Conversion of clock values

In the current version of Netsim, in order to maintain a compatible format among variable valuesin the database, ‘‘clk’’ must be an integer. However, the simulation clock time is taken from uniform(0, 1) random variates calculated by the java.util.Random.nextDouble( ) method in Java. To solvethis discrepancy, the clock time, when used in the variable database, is first converted to an integer.This is done by multiplying by 10 000 and truncating the remaining decimal portion. The new valueis equivalent to ‘‘clk’’. Time-valued variables are easily rescaled by dividing by 10000.

In Table 3, a sample of rescaled data output using the 10 000 multiplier is compared to a runwith the same seed and using a 1 000000 multiplier. As shown, the 10 000 multiplier reducesthe number of significant digits in the data output to at most three, but does not otherwise affectthe accuracy of the output. The number of significant digits can be increased by increasing themultiplier. However, this causes variable values to quickly exceed the predefined integer size limit.Potential solutions to this conversion problem for future versions of Netsim are discussed inSection 7.3 below.

7.2. Thread synchronicity

The current version of Netsim contains the following surface-level oddities caused by lack ofproper synchronicity among the threads. These inconsistencies affect viewing the animation, but do

618 T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621

Page 13: Netsim: Java™-based simulation for the World Wide Web

not affect the simulation process or accuracy of the data output. In particular, in order to rerun thesimulation the user must actually click on the stop button before clicking the play button, even ifthe simulation has finished naturally. Additionally, when viewing a Netsim model on a WWWbrowser, pausing the animation and temporarily activating a different window on the computerscreen may cause the simulation run to resume. Finally, the pause button is not reliable onmachines, such as the Sun, that use multithreaded processors.

7.3. Conclusions

As shown, the current version of Netsim contains a small number of limitations. These areprogramming issues which can be remedied with more complex programming techniques thanundertaken for the creation of Netsim. In particular, the creation of a special database couldprevent the loss of significant digits caused by integer translation of simulation clock time. Sucha database would have to recognize and be devoted specifically to time-valued variables, managingthose variables separately from other variables. Additionally, viewing inconsistencies are remediedby carefully synchronizing the threads within the package. However, because some of these threadsreference methods within each other, proper solution of this problem will necessitate extensiveknowledge of multithreading capabilities and behaviors within the Java language. None of thediscussed limitations directly affects the simulation process.

8. Future work

Because Netsim was specifically created as a general simulation package, expansion, in mostcases, simply involves extension through additional classes and/or methods. The object-orientedstructure of Netsim greatly facilitates this process. Future additions should include classes forhandling more advanced simulation models, support for a wider range of random variates, andadditional user interfaces. Databases holding edge information should be expanded to allowparameter passing, enabling complex modeling through simple event graphs. Additionally, userunderstanding would be enhanced by replacing event graphs with system-appropriate icons anddesigns and by including context-sensitive help within the applet. For users concerned withreplicating or presenting the data output, future modifications include enabling the current ‘‘save’’buttons as well as adding graphing and statistical analysis capabilities.

Use of the Java language is expanding rapidly, especially in the creation of educational software.Consequently, some of the potential enhancements mentioned for Netsim may be made possible bylinking with other existing Java-based classes, in their current form or with minor modifications.

The information potential through the WWW is growing rapidly, encouraging more and morepeople of all backgrounds and interests to gain regular, frequent access to the WWW. Additionally,the increase of standardized HTML formats, multimedia browser plug-ins, and scripting andprogramming languages are allowing WWW site providers to create sites that are more interesting,visual, and user-friendly. As the popularity of the WWW for everyday transfer of information andideas expands, WWW-based simulation may become an extremely beneficial and desired additionto the common WWW environment. For example, by providing a high level of user interactivitythrough simple interfaces, Netsim encourages users of all levels of understanding to interact with

T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621 619

Page 14: Netsim: Java™-based simulation for the World Wide Web

the model. Additionally, through animation and data output, Netsim contributes a graphic as wellas analytic representation of a system process. This enables users to understand the system bothvisually and statistically. By accessing the Netsim simulation models through the WWW users areable to ensure a common reference and to communicate easily with each other, building onunderstandings and ideas.

References

[1] Buss AH. Modeling with event graphs. In: Charnes JM, Morrice DJ, Brunner DT, Swain JJ, editors. Proceedings ofthe 1996 Winter Simulation Conference, Coronado, California, December 8—11, 1996:153—60.

[2] Schruben LW. Graphical simulation modeling and analysis: using SIGMA for windows. Danvers, MA, Boyd andFraser, 1995.

[3] Jones CV. Java and OR/MS. INFORMS CSTS Newsletter 1996;17:3—11.[4] Pritsker AAB. Introduction to simulation and SLAM II, 3rd ed. New York: Wiley, 1986.[5] Freeman A, Ince D. Active Java: object-oriented programming for the World Wide Web. Harlow, England:

Addison-Wesley, 1996.[6] Joines JA, Roberts SD. Design of object-oriented simulation in C##. In: Charnes JM, Morrice DJ, Brunner DT,

Swain JJ, editors. Proceedings of the 1996 Winter Simulation Conference. Coronado, California, December 8—11,1996;65—72.

[7] Fullford D. Distributed interactive simulation: its past, present and future. In: Charnes JM, Morrice DJ, BrunnerDT, Swain JJ, editors. Proceedings of the 1996 Winter Simulation Conference. Coronado, California, December8—11, 1996;179—85.

[8] Neilson I, Thomas R, Smeaton C, Slater A, Chand G. Education 2000: implications of W3 technology. Computersand Education 1996;26:113—22.

[9] Cole R, Tooker S. Physics to go: Web-based tutorials for CoLoS physics simulations. Proceeding of the Frontierson Education FIE’96 26th Annual Conference, 1996;681—3.

[10] Tooker S, Cole R. Using OpenDoc to create low-cost physics simulation tools for secondary and higher education.Proceeding of the Frontiers on Education FIE’96 26th Annual Conference, 1996;688—9.

[11] Singh T, Zhu M, Thakker U, Ravaioli U. Impact of World Wide Web, Java, and virtual environments on educationin computational science and engineering. Proceeding of the Frontiers on Education FIE’96 26th AnnualConference, 1996;1007—10.

[12] Bradley GH. Dynamic and interactive research publications using Java. http://dubhe.cc.nps.navy.mil/)gbradley/,1996.

[13] Nair RS, Miller JA, Zhang Z. Java-based query driven simulation environment. In: Charnes JM, Morrice DJ,Brunner DT, Swain JJ, editors. Proceedings of the 1996 Winter Simulation Conference, Coronado, Cali-fornia, December 8—11, 1996;786—93. http://www.cs.uga.edu/)rajesh/JSIM/jsimdistribution/ docs/API—users—guide.html.

[14] Buss AH, Stork KA. Discrete event simulation on the World Wide Web using Java. In: Charnes JM, Morrice DJ,Brunner DT, Swain JJ, editors. Proceedings of the 1996 Winter Simulation Conference. Coronado, California,December 8—11, 1996;780—5. http://131.120.142.115/)stork/simkit—home.html.

Tamie L. Veith, M.S., is a USDA National Needs doctoral fellow in the Biological Systems Engineering Department atVirginia Tech. She received her B.A. in Mathematics from Reed College and her M.S. in Industrial and SystemsEngineering at Virginia Tech. Her research interests include theoretical and biological systems applications of operationsresearch with particular interest in computer modeling and Internet applications.

620 T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621

Page 15: Netsim: Java™-based simulation for the World Wide Web

John E. Kobza, Ph.D., is an Assistant Professor of Industrial and Systems Engineering at Virginia Tech. He receivedthe B.S. degree in electrical engineering from Washington State University, and the M.S. degree in electrical engineeringfrom Clemson University. He received the Ph.D. degree in Industrial and Systems Engineering at Virginia Tech. Hisresearch interests include system performance modeling and analysis. E-mail: [email protected].

C. Patrick Koelling, Ph.D., is professor and head of the School of Industrial Engineering and Management atOklahoma State University. He earned B.S.I.E., M.S.I.E., and MBA degrees from the University of Missouri, and a Ph.D.from Arizona State University. He is a senior member of the Institute of Industrial Engineers. Dr. Koelling’s areas ofexpertise are in operations research and computer applications. E-mail: [email protected].

T.L. Veith et al. / Computers & Operations Research 26 (1999) 607—621 621