• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Lee L. Lowery, Jr., PhD, P.E.
  • Research
  • People
  • Contact

Lee L. Lowery, Jr.

Just another CoE WordPress site

Texas A&M University College of Engineering

Thinning and Logical IFs

Posted on July 28, 2021 by Abigail Stason

PROGRAM

     “Thinning and Logical Tests”

DEFINITION

    LABELS = {thin0,thin30,thin60,thin90,print1};

    filename1:TEXTFILE={NAME=’d:\junk\thins.out’,STATUS=WRITE};”Name Output File”

CONTROL

    STOPTIME=400;

LOGIC

           ARRIVE {TIME=EXPD(5)};

start:  IF(CLOCKTIME<100) THEN GOTO thin0;

           IF(CLOCKTIME>100) AND (CLOCKTIME<200) THEN GOTO thin30;

           IF CLOCKTIME IN [200,300] THEN GOTO thin60;

           IF CLOCKTIME>300 THEN GOTO thin90;

thin0:   GOTO print1;

thin30: IF RAND < 0.3 THEN DEPART{ }; “thin out 30% of arrivals”

            GOTO print1;

thin60: IF RAND < 0.6 THEN DEPART{ }; “thin out 60% of arrivals”

            GOTO print1;

thin90: IF RAND < 0.9 THEN DEPART{ }; “thin out 90% of arrivals”

            GOTO print1;

print1:  PRINTLN {filename1, CLOCKTIME:15:0};

            DEPART{ };

END.

Filed Under: Uncategorized

Pages

  • Contact
  • Lee L. Lowery, Jr., PhD, P.E.
  • Office Hours

© 2016–2025 Lee L. Lowery, Jr. Log in

Texas A&M Engineering Experiment Station Logo
  • College of Engineering
  • Facebook
  • Twitter
  • State of Texas
  • Open Records
  • Risk, Fraud & Misconduct Hotline
  • Statewide Search
  • Site Links & Policies
  • Accommodations
  • Environmental Health, Safety & Security
  • Employment