Category : Miscellaneous Language Source Code
Archive   : OPAL140.ZIP
Filename : CRITICAL.OPL

 
Output of file : CRITICAL.OPL contained in archive : OPAL140.ZIP
{
CRITICAL.OPL - Critical Gap Example
OPAL - The Programmable DOS Shell
Copyright (c) 1986, The Software Factory, Inc.

This example OPAL program calculates the length of the critical gap, T
in seconds. T is a function of TH, the angle between the ramp anf highway
; D, the normalized length of the acceleration lane; and S, the ramp
factor.

S is zero for a tapered ramp, and one for a parallel ramp.
}

LET fldbar_ = '7m'
LET flddsp_ = '1m'

SCRCLR
SHOW "OPAL - Critical Gap On Ramp Example"
SHOW " "
SHOW "One of the factors used in evaluating the effectiveness of a ramp leading"
SHOW "to a highway is the Critical Gap. It is assumed that a driver waits on a"
SHOW "ramp until he estimates a time gap between successive vehicles which he"
SHOW "regards as sufficiently long for him to safely enter the traffic stream."
SHOW "This Critical Gap is a function of the angle between the ramp and the"
SHOW "highway, and the length of the acceleration lane."
SHOW " "
SHOW "The angle is entered in degrees."
SHOW "The acceleration lane is entered as a normalized length, i.e. /100"
SHOW " "
SHOW "A shape factor is available for Tapered or Parallel ramps"
SHOW " "
LET more=TRUE
DO WHILE more
SHOW " "
LET fldbuf_=' 10'
LET th=CONPROMPT(integer_,3,32,"Enter the angle between the Ramp and Highway: ",0,0,360)
IF th=0 THEN BREAK
LET fldbuf_=' 1.20'
LET d= CONPROMPT(real_,6.2,32,"Enter the normalized length of the Acceleration Lane: ")
IF d=0.0 THEN BREAK
LET fldbuf_='T'
LET type=CONPROMPT(string_,1,37,"Is the ramp Tapered or Parallel (T/P): ",1,"T","P")
IF type="T" THEN LET s=0
ELSE LET s=1
LET t=5.547+.828*th-1.043*d+.045*d*d-.042*th*th-.847*s
PRINT("%n%n*** Critical Gap=%6.2f secs.%n%n",t)

LET fldbuf_='N'
LET more=CONPROMPT(yesno_,1,32,"Run another example (Y/N): ")
END

PRINT("%n%n*** Critical Gap Example Complete...%n%n Thanks!!!%n%n")

END


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : OPAL140.ZIP
Filename : CRITICAL.OPL

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/