home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / JSL.ZIP / JSL20 / examples / warehouse / WareHouseSimulation.java < prev   
Encoding:
Java Source  |  1998-02-20  |  2.7 KB  |  79 lines

  1.  
  2. package examples.warehouse;
  3.  
  4.  
  5. import simula.* ;
  6. import simula.simset.* ;
  7. import simula.simset.simulation.* ;
  8. /**
  9.  * A versatile warehouse model
  10.  * @author Andrea Poltronieri
  11.  * @version 1.0 12 Feb 1998
  12.  */
  13. public class WareHouseSimulation extends Simulation{
  14.         /**Arrivals frequency */
  15.         public double arr ;
  16.         /**Removal frequency */
  17.         public double rem ;
  18.         /** Number of itemes transited for the warehouse*/
  19.         public double iharea ;
  20.         /** Time of last arrive/departure*/
  21.         public double lastevent ;
  22.         /** Simulation length */
  23.         public double simperiod ;
  24.         /** Arrived batches*/
  25.         public int arrived  ;
  26.         /** Rejected batches */
  27.         public int rejected ;
  28.         /** Lower bound for incoming batches */
  29.         public int in1 ;
  30.         /** Upper boud for incoming batches */
  31.         public int in2 ;
  32.         /** Lower bound for outgoing batches */
  33.         public int out1 ;
  34.         /** Upper bound for outgoing batches */
  35.         public int out2 ;
  36.         /** Occuped storage space*/
  37.         public int n ;
  38.         /** Storage space*/
  39.         public int m ;
  40.         /** Random generator seed*/
  41.         public int seed ;
  42.         /** Process wich performs batch processing*/
  43.         public Removals worker ;
  44.  
  45.  
  46. /**
  47.  * Print credits on standar error.
  48.  */
  49. private static void credits ( ) {
  50.     System.err.println("***********************************************************") ;
  51.     System.err.println("*                    Example for Korretto                 *") ;
  52.     System.err.println("*  A versatile warehouse model                            *") ;
  53.     System.err.println("* see 'Simulation techiniques for discrete event systems' *") ;
  54.     System.err.println("*      I. Mitrani -- Cambridge University press           *") ;
  55.     System.err.println("*  example 3.1                                            *") ;
  56.     System.err.println("***********************************************************") ;
  57.     System.err.println("*  author : Andrea Poltronieri                            *") ;
  58.     System.err.println("*  Verona University                                      *") ;
  59.     System.err.println("*    e-mail : poltro@arena.sci.univr.it                     *") ;
  60.     System.err.println("*  http://arena.sci.univr.it/~poltro                      *") ;
  61.     System.err.println("***********************************************************") ;
  62.     return;
  63. }
  64. /**     
  65.   * Start the simualtion, instantiating a new Simulation and launching the main program
  66.   * @param  args[] Ignored
  67.   * @see simula.simset.simulation.Simulation
  68.   * @see simula.simset.simulation.SimulationMain
  69. */
  70.   public static void main (String args[]) {
  71.     try{
  72.         credits();
  73.         WareHouseSimulation sim = new WareHouseSimulation();
  74.         WareHouseMain main = new WareHouseMain(sim);
  75.  
  76.     } catch (Exception e) { System.out.println("Exception caught: " + e);}
  77.  
  78.   }              
  79. }