Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0078/demos/stat1e.sim
There is 1 other file named stat1e.sim in the archive. Click here to see a list.
BEGIN
  REAL simulation_duration;
  simulation_duration:= 200;
  simulation BEGIN
    REF (platform) harbour, store, factory;
    INTEGER i, u;

    process CLASS truck;
    BEGIN
      WHILE TRUE DO
      BEGIN
        hold(harbour.travel_time);
        ACTIVATE harbour DELAY 0; wait(harbour.queue);
        IF draw(0.5,u) THEN
        BEGIN
          hold(store.travel_time);
          ACTIVATE store DELAY 0; wait(store.queue);
        END ELSE
        BEGIN
          hold(factory.travel_time);
          ACTIVATE factory DELAY 0; wait(factory.queue);
        END;
      END;
    END of truck;

    process CLASS platform(platform_time, travel_time);
    REAL platform_time, travel_time;
    BEGIN
      REF (head) queue;
      queue:- NEW head;
      WHILE TRUE DO
      BEGIN
        INSPECT queue.first WHEN truck DO
        BEGIN
          out; hold(platform_time);
          ACTIVATE THIS truck;
        END OTHERWISE passivate;
      END;
    END of platform;

    harbour:- NEW platform(10,20); ACTIVATE harbour;
    store:- NEW platform(15,20); ACTIVATE store;
    factory:- NEW platform(17,20); ACTIVATE factory;
    FOR i:= 1 STEP 1 UNTIL 5 DO ACTIVATE NEW truck;
    hold(simulation_duration);
  END of simulation;
END of program;