Process LOAD.GENERATOR given LOAD.FLOOR

  '' Goldmine Simulation                                       August 2, 1988
  '' CACI Products Company

  '' There is one load generator created for each level.  An attribute of the
  '' level describes how often loads are to be created.


  Define LOAD.FLOOR as an integer variable
  Define X as a real variable
  Define Y as a real variable


  Until TIME.V ge STOP.TIME*60 do
    Wait EXPONENTIAL.F(MEAN.RATE(LOAD.FLOOR)/60,1) HOURS
    Create a LOAD
    Let FLOOR(LOAD) = LOAD.FLOOR

    ''Give the load an icon
    Let X = 15 + N.LOAD.QUEUE(LOAD.FLOOR) * 12.0
    Let Y = -100.0 * (3-LOAD.FLOOR)   
    Display LOAD with "load.icn" at (X, Y)

    File LOAD in LOAD.QUEUE(LOAD.FLOOR)

    ''If the lift was stopped then reactivate it
    If LOAD.FLOOR eq 1 and LIFT.STATUS(LIFT) eq "STOP"
      Reactivate the LIFT now
    Endif
  Loop


End ''LOAD.GENERATOR
