• Nie Znaleziono Wyników

Simulatie met Java

N/A
N/A
Protected

Academic year: 2021

Share "Simulatie met Java"

Copied!
1
0
0

Pełen tekst

(1)

Delft University of Technology

Faculty Mechanical, Maritime and Materials Engineering Transport Technology / Logistic Engineering

R. den Ouden Simulatie met Java®.

Computer program, Report 97.3.LT.4902, Transport Technology, Logistic Engineering.

Java is a computer language which importance is increasing by its use for internet. Several simulation tools for Java are available, such as SimJava or JavaSim, but none of these tools make Java a programming language suitable for discrete-event simulation. My computer assignment was to develop a simulation-tool for Java which includes the event scheduler. Subsequently a standard simulation problem, the 'lock model' had to be programmed which makes use of the simulation unit developed. De simulation methods of the simulation unit have to correspond to the terminology and principles of Must. After getting acquainted to and gaining programming experience with Java I started programming the lock model. While programming, for each simulation method like 'start', '(re)activate', 'passivate', 'hold' and 'stop', a separate method (Java-term for procedure) was developed. In the end a collection of simulation methods was formed, so only these simulation methods had to be saved in a new package (Java-term for unit). This package makes it possible to use these simulation methods in every Java-program by initializing the package in the class-definition (the syntax of the class). While developing the simulation program is decided to use a class of the thread-type for each component. The usage of the threads makes it possible to stop each component temporarily while running the simulation, which is essential for the discrete-event simulation. Since Java supports the usage of multi-threading (running several threads simultanious), it was of great importance to take care of the fact that while running the simulation, only one thread is active at a time, because of the discrete-event principle.

Conclusions with regard to the development of the simulation unit and the usage of Java are: It is possible to simulate with Java by the discrete-event principle;

Java is not user-friendly in using the file-project-structure. The user must be very careful changing an existing file, since when a file is changed, the original one isn't available anymore;

The usage of threads for each process description offers the advantage of using the available thread-methods as stop en resume. This makes it easy to stop the components temporarily (event-based-principle);

Often the situation occurs that more than one events with the same eventtime are created. This can cause problems i.e. the event-order. The user of the simulation package must be sure that the events are created in the right order and are executed in the right order;

Java can only process 1677 threads. When more threads are created and activated the program causes a program failure. At first sight it seems that 1677 thread is extremely much, but with simulation with a long runtime and/or many objects this fact will cause problems very quickly. Although the developed simulation-unit makes it possible to program and simulate the lock model in Java, the simulation-unit is far from complete, reliable and user-friendly like simulation tools as Must or Prosim. Therefore the following recommendations are made:

Test and develop the simulation-package into a 'full' simulation tool (like Must or Prosim);

Examine if it is possible to use the facility of multi-threading, i.e. running the components simultanious. This is more in keeping with the reality and simplifies the event-scheduling principle or makes it even superfluous;

Examine the developments of simulation tools which make simulation with Java possible, critically. It is useless developing a 'new' simulation tool for Java, when a functioning simulation tool for Java is available.

Reports on Logistic Engineering (in Dutch)

Cytaty

Powiązane dokumenty

I will report on recent progress towards implementing a practical algorithm to solve the unit equation over the S-integers, where S is a finite list of rational prime numbers.

26 września odbyła się promocja dwóch książek: Zniewolonego umysłu (3 wyda- nie, w pockecie, co t u t a j oznacza, że książka uznana jest za klasykę i że powinna znaleźć

4.5.. Denote this difference by R.. In a typical problem of combinatorial num- ber theory, the extremal sets are either very regular, or random sets. Our case is different. If A is

Warto podkreślić, że w całym raporcie do zagrożenia terroryzmem odnosiło się aż 5 wskaźników, z czego trzy z nich wystą- piły w kategorii bezpieczeństwa osobistego

Given the interesting findings of last year, we analyzed the effectiveness of the combined test suites generated by all competing tools and compared; results are confronted with

Table 3: Summary of the Hungarian interrogative imperative sentence types discussed in the paper BS (1) US (2) VS (3) WS (4) Form: Subjunctive+ rise-fall intonation particle

Stworzone oprogramowanie umo liwia rozwi zanie problemu timeout’ów serwera WWW podczas wykonywania długich oblicze programów CLP oraz mo e sta si baz do rozwini cia

Significantly less works related to optimization of coupling shapes in such connections [11] (optimization of chain couplings). At that stress state in connections is analyzed