'' 
'' COPYRIGHT (C) 1987, CACI, INC. - FEDERAL, LA JOLLA
''
''
'' Model: port      Port model - graphic color
''
''-----------------------------------------------------------------------
preamble             ''  PORT:   African Port Model - In Graphic Color


   normally mode is undefined

   processes include GENERATOR and FINAL.REPORT
      every TUG
         has a TUG.STATUS
         and a TUG.LOCATION
         and a TUG.SHIP.IN.TOW            ''pointer to SHIP being towed
         and a TUG.COLOR
      define TUG.SHIP.IN.TOW, TUG.COLOR, TUG.STATUS, TUG.LOCATION
             as integer variables

      every SHIP
         has a SHIP.TYPE
         and a SHIP.LOCATION
         and a SHIP.BERTH                 ''index of SHIP's assigned BERTH
         and a SHIP.COLOR
         and may belong to the TUG.QUEUE
         and may belong to the HARBOR     ''for displaying SHIPs in HARBOR
      define SHIP.TYPE as a text variable
      define SHIP.LOCATION, SHIP.BERTH, SHIP.COLOR, FIRSTIME and TIMESCALE
         as integer variables

   resources include DOCK

   the system
      has a LOADING.TIME random step variable
      and owns the TUG.QUEUE
      and the HARBOR
      and the BACKGROUND.SET
   define NO.OF.BERTHS, NO.NEW.SHIPS, RUN.LENGTH
      and DOCKS.IN.USE as integer variables
   define LOADING.TIME and IN.PORT.TIME as real variables
   define TUG.QUEUE and HARBOR as a fifo sets
   accumulate AVG.DOCK.QUEUE as the average
      and MAX.DOCK.QUEUE as the maximum of N.Q.DOCK
   accumulate DOCK.UTILIZATION as the average of DOCKS.IN.USE
   accumulate AVG.TUG.QUEUE as the average
      and MAX.TUG.QUEUE as the maximum of N.TUG.QUEUE
   accumulate TUG.UTILIZATION as the average of TUG.STATUS
   tally AVG.IN.PORT.TIME as the average
      and MAX.IN.PORT.TIME as the maximum
      and NO.OF.SHIPS.SERVED as the number of IN.PORT.TIME

   define .END.OF.SIMULATION to mean TIME.V >= RUN.LENGTH
   define .IN.HARBOR to mean 1
   define .AT.DOCK to mean 2
   define .IDLE to mean 0
   define .BUSY to mean 1
   define .SKIP.TEXT to mean while mode is text, skip 1 field

   temporary entities include SHIP.COUNTER
      every DAYS
         has a DAY.A
      define DAY.A as an integer variable

      every HOURS
         has an HOUR.A
      define HOUR.A as an integer variable

      every MINUTES
         has a MINUTE.A
      define MINUTE.A as an integer variable

      every BERTH                         ''to manage docked SHIP display
         has a BERTH.STATUS
         and belongs to the BACKGROUND.SET
      define BERTH.STATUS as an integer variable

      every DSPLY.E has
         a DCOLOR.A(3/4) in word 7
      define DCOLOR.A as an integer variable

   define TIME.COMPRESS.FLAG as an integer variable
   Define OUTPUT.FLAG as an integer variable
   dynamic graphic entities include TUG
   graphic entities include SHIP, SHORELINE, BERTH, SHIP.COUNTER,
      DAYS, HOURS, and MINUTES

   define .background to mean 0
   define .white to mean 1
   define .red to mean 2
   define .green to mean 3
   define .blue to mean 4
   define .yellow to mean 5
   define .purple to mean 6
   define .turquoise to mean 7
   define .pink to mean 8
   define .lgreen to mean 9
   define .lblue to mean 10
   define .orange to mean 11
   define .brown to mean 12
   define .dpurple to mean 13
   define .dpink to mean 14
   define .black to mean 15

 ''define snap.r as a routine
 
end   ''preamble
