'' 
'' COPYRIGHT (C) 1987, CACI, INC. - FEDERAL, LA JOLLA
''
'' Model: dynhist   
''
'' File : Preamble.sim
''
'' This example program is a demo program for several SIMSCRIPT/ Simgraphics I
'' capabilities. It demonstrates the automatic statistics generation of
'' variables in SIMSCRIPT and how this data can be displayed at run-time
'' by a 'dynamic histogram'. See the Simgraphics I User's Guide for details.
'' 
'' Algorithm: We draw NumSamp random numbers UDyn (uniformly distributed)
''            and NDyn (normal dist). As these variables are assigned their
'' values, the associated dynamic histograms UDyn and NDyn are updated on the
'' screen automatically. The Preamble defines the connection of the two.
'' The graphic representations were chosen/adapted and positioned in the 
'' Simgraphics I editor simedit. The dynamic histogram DynU is displayed 
'' with "dyn1.grf", DynN with "dyn2.grf". 
'' Declaring K as a display variable (Preamble) and associating the 
'' "samplvl.grf" level meter in main causes K to be displayed as it grows.
''
'' Author: Dr. Alasdar Mullarney
''-----------------------------------------------------------------------

preamble  

  normally mode is undefined
  define IconName1, IconName2 as text variables
  define K, ULO, UHI, NLO, NHI, UDELTA, NDELTA and NumSamp 
     as integer variables
  define UDyn, NDyn as real variables
  tally  DynU(ULO to UHI by UDELTA) as the dynamic histogram of UDyn
  tally  DynN(NLO to NHI by NDELTA) as the dynamic histogram of NDyn
  ''  above variable values come from the dynamic histogram icon descriptions
  display variables include K
end

