• 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

Simple Exitlogic Example

Posted on July 28, 2021 by Abigail Stason

PROGRAM
“Show how exitlogic works”

DEFINITION
frontend :RESOURCE = {CAPACITY = 1};
dumpsite :RESOURCE = {CAPACITY = 1};
LABELS = {start};
payperload = 400;
costpertruck = 1000;
numberoftrucks = 1; “Number of trucks to begin study”
trucksdumped = 0;
gross=0;
expenses = costpertruck * numberoftrucks;
profit = 0;

CONTROL
STOPTIME=480;
“WATCHLIST = {frontend, dumpsite};” “Remove watchlist to print output to screen”

EXITLOGIC
“NOTE! You cannot have a WATCHLIST and print to the screen”
“You can print to a disk on file, but not the screen.”
profit = gross – expenses;
PRINTLN{‘ Profit = ‘, profit: 15:2 }; “This will print to screen”
END; “End of Exitlogic”

LOGIC “Logic for controlling arriving trucks”
ARRIVE {TIME=0,LIMIT=numberoftrucks};
start: SEIZE{NAME=frontend, UNITS=1};
WAIT{TIME=EXPD(10)};
RELEASE {NAME=frontend};
WAIT{TIME=CUNIFORM(30,35)};
SEIZE{NAME=dumpsite};
WAIT{TIME=EXPD(2)};
RELEASE {NAME=dumpsite};
gross = gross + payperload;
trucksdumped = trucksdumped+1;
WAIT{TIME=CUNIFORM(20,25)};
GOTO start;
END.

Resulting output:

MOR/DS 1.00
MODEL DESCRIPTION
****************************************************
PROGRAM
“Show how exitlogic works”

DEFINITION
frontend  :RESOURCE = {CAPACITY = 1};
dumpsite  :RESOURCE = {CAPACITY = 1};
LABELS = {start};
payperload = 400;
costpertruck = 1000;
numberoftrucks = 1;   “Number of trucks to begin study”
trucksdumped = 0;
gross=0;
expenses = costpertruck * numberoftrucks;
profit = 0;

CONTROL
STOPTIME=480;
“WATCHLIST = {frontend, dumpsite};”
“Remove watchlist to print output to screen”

EXITLOGIC
[  1]      “NOTE! You cannot have a WATCHLIST and print to the screen”
[  2]      “You can print to a disk on file, but not the screen.”
[  3]      profit = gross – expenses;
[  4]      PRINTLN{‘ Profit = ‘, profit: 15:2 }; “Print to screen”
[  5]      END;   “End of Exitlogic”

LOGIC  “Logic for controlling arriving trucks”
[  1]         ARRIVE {TIME=0,LIMIT=numberoftrucks};
[  2] start:  SEIZE{NAME=frontend, UNITS=1};
[  3]         WAIT{TIME=EXPD(10)};
[  4]         RELEASE {NAME=frontend};
[  5]         WAIT{TIME=CUNIFORM(30,35)};
[  6]         SEIZE{NAME=dumpsite};
[  7]         WAIT{TIME=EXPD(2)};
[  8]         RELEASE {NAME=dumpsite};
[  9]         gross = gross + payperload;
[ 10]         trucksdumped = trucksdumped+1;
[ 11]         WAIT{TIME=CUNIFORM(20,25)};
[ 12]         GOTO start;
[ 13] END.

—————————————————-
Simulation Clock   :   480.00

Block Information

___Stmt___Line______Label_________Name_______Total___Current
1      1                      ARRIVE       1         0
2      2        START          SEIZE       7         0
3      3                        WAIT       7         0
4      4                     RELEASE       7         0
5      5                        WAIT       7         1
6      6                       SEIZE       6         0
7      7                        WAIT       6         0
8      8                     RELEASE       6         0
9      9                  ASSIGNMENT       6         0
10     10                  ASSIGNMENT       6         0
11     11                        WAIT       6         0
12     12                        GOTO       6         0

——————— Resources ———————–

FRONTEND
Capacity     =      1            Current Units    =      0
Total Number =      7            Maximum Entities =      1
Maximum      Average      Average      Std Dev      Average
Units        Util.        Units        Units         Time
1         0.257         0.26         0.44        17.61

Default Queue Statistics
No entries.

DUMPSITE
Capacity     =      1            Current Units    =      0
Total Number =      6            Maximum Entities =      1
Maximum      Average      Average      Std Dev      Average
Units        Util.        Units        Units         Time
1         0.029         0.03         0.17         2.35

Default Queue Statistics
No entries.
——————–  Global Variables  ————————
PAYPERLOAD      =   400.00
COSTPERTRU      =  1000.00
NUMBEROFTR      =     1.00
TRUCKSDUMP      =     6.00
GROSS      =  2400.00
EXPENSES      =  1000.00
PROFIT      =     0.00  <– Note his first opinion of PROFIT
Profit =         1400.00   <– Note his opinion of Profit after EXITLOGIC has run
<– Note also the change in spelling

Compile time:     0.06 (Secs.)
Run time    :     0.00 (Secs.)
Total memory available     :  216986
Memory used by model       :    3321
Maximum dynamic memory used:     226
Total memory used          :    3547

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