home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-02-20 | 2.5 KB | 75 lines |
-
- package examples.prepriosys;
-
-
- import simula.* ;
- import simula.simset.* ;
- import simula.simset.simulation.* ;
- /**
- * A preemptive system with priorities
- * @author Andrea Poltronieri
- * @version 1.0 12 Feb 1998
- */
-
- public class PrePrioSysSimulation extends Simulation{
- // Global vars declaration ;
- /** Seed for random generator */
- public int seed;
- /** Top element in the queue */
- public int top ;
- /** Queue index */
- public int i ;
- /** Simulation length*/
- public double simtime ;
- /** Customers served*/
- public int numthrough[] ;
- /** Total sojourn time for customers */
- public double sojourn[] ;
- /** Available servers list*/
- public Head available ;
- /** Queues of customers */
- public Head queue[] ;
- /** Number of queues*/
- public int k ;
- /** Server number*/
- public int c ;
- /** List of busy Servers*/
- public Head[] busy ;
-
-
-
-
- /**
- * Print credits on standar error.
- */
- private static void credits ( ) {
- System.err.println("***********************************************************") ;
- System.err.println("* Example for Korretto *") ;
- System.err.println("* A system with priorities (preemptive) *") ;
- System.err.println("* see 'Simulation techiniques for discrete event systems' *") ;
- System.err.println("* I. Mitrani -- Cambridge University press *") ;
- System.err.println("* example 3.3 *") ;
- System.err.println("***********************************************************") ;
- System.err.println("* author : Andrea Poltronieri *") ;
- System.err.println("* Verona University *") ;
- System.err.println("* e-mail : poltro@arena.sci.univr.it *") ;
- System.err.println("* http://arena.sci.univr.it/~poltro *") ;
- System.err.println("***********************************************************") ;
- return;
- }
- /**
- * Start the simualtion, instantiating a new Simulation and launching the main program
- * @param args[] Ignored
- * @see simula.simset.simulation.Simulation
- * @see simula.simset.simulation.SimulationMain
- */
- public static void main (String args[]) {
- try {
- credits();
- PrePrioSysSimulation sim = new PrePrioSysSimulation();
- PrePrioSysMain main = new PrePrioSysMain(sim);
- } catch (Exception e) {
- System.err.println ("Exception caught in PrePrioSys launcher :\n"+e) ;
- }
- }
- }