home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / JSL.ZIP / JSL20 / examples / MainProcess.java < prev    next >
Encoding:
Java Source  |  1998-02-20  |  1.2 KB  |  43 lines

  1.  
  2. package examples;
  3.  
  4. import simula.simset.simulation.* ;
  5. import simula.*;
  6.  
  7. public class MainProcess extends SimulationMain {
  8.  
  9.  
  10.     public MainProcess(Simulation _simulation) throws SimulaException {
  11.         super(_simulation);
  12.     }
  13.     public void run() {
  14.         try {
  15.             PrintProcess pp1 = new PrintProcess("Ariane 1", sim);
  16.             PrintProcess pp2 = new PrintProcess("Ariane 2", sim);
  17.             PrintProcess pp3 = new PrintProcess("Ariane 3", sim);
  18.  
  19.             Lang.outtext("French Guyana space center : Launch Ariane 1 NOW ! ") ;
  20.             sim.activate(pp1);
  21.  
  22.             Lang.outtext("French Guyana space center : Launch Ariane 2 at 2:00 PM ") ;
  23.             sim.activate_at(pp2, 2, false);
  24.  
  25.             Lang.outtext("French Guyana space center : Launch Ariane 3 before Ariane 2 ") ;
  26.             sim.activate_before(pp3, pp2);
  27.  
  28.             Lang.outtext("French Guyana space center : Ariane 2 mission cancelled ! ") ;
  29.             sim.cancel(pp2);
  30.  
  31.             Lang.outtext("French Guyana space center : coffee break..");
  32.             sim.hold(9);
  33.  
  34.             Lang.outtext("French Guyana space center : mission over.");
  35.             System.exit(1);
  36.  
  37.         } catch(SimulaException e) {
  38.             Lang.outtext("French Guyana space center exception :> " + e.getMessage());
  39.             System.exit(1);
  40.         }
  41.     }
  42.     public String toString() { return "coffee break ending at " + evTime + " PM "; }
  43. }