• 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

Uncategorized

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

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

Racing Problem – Pit Crew Operations

Posted on July 28, 2021 by Abigail Stason

Write a BOSS program to analyze the pit operations of my racing crew, and run on BOSS. The crew performs the following operations when the driver makes a pit stop. All times listed below are distributed normally unless otherwise stated, i.e. if it says 4 to 6 seconds, that means it took him between 4 to 6 seconds, normally distributed.

a) Bill replaces the right side tires. It takes him between 4 and 8 seconds to jump the wall, between 2 and 10 seconds to get between the wall and the car and the same time to get from tire to tire. It takes him 10 to 14 seconds to jack the car and change a tire. Sometimes Bill goes around the front of the car, and sometimes he goes around the back, depending on how far forward the car driver stopped in the pit area. 40% of the time the driver stops too far forward for Bill to get in front of the car, so he goes around the back. 60% of the time the driver stops such that Bill goes around the front of the car. Bill returns the same way he went.

b) Jill replaces the left side tires. It takes her between 2 and 10 seconds to jump the wall, from 3 and 9 seconds to get between the wall and the car and the same time to get from tire to tire. It takes her from 8 to 16 seconds to change a tire.

c) Hill fills the tank on the left side of the car. It takes him between 1 and 10 seconds to jump the wall, between 4 and 10 seconds distributed uniformly to get from the wall to the car, between 8 and 12 seconds to attach the gas can spout to the car, 2 seconds to detach the spout, and between 20 to 40 seconds to fill the tank He carries two cans of gas, both of which are used to fill the car.

d) Phil washes the windshield and cleans the air intakes on the front of the car. He does his work from behind the wall with a long pole. If Bill decides to run in front of the car, Phil must wait until Bill has reached the front right wheel. Once he has begun the cleaning operation he will continue until finished, regardless of Bill. If the pole is in Bill’s way when he is ready to return, Bill has to wait until the pole is retracted. It takes Phil 5 to 10 seconds to extend and retract the cleaning pole, and 10 to 15 seconds to clean the intakes and windshield. Phil is always behind the wall, and the driver can leave even if he has not finished cleaning the windshield.

e) Bill can work without getting in Jill or Hill’s way, on the right side of the car, but may have to wait on Phil.

f) By SCCA rules, Jill and Hill cannot both operate on the left side of the car at the same time – the filler cap and tires are too close together. Thus, only one crew member is permitted to work on the left side of the car at once. Both can run to the left side of the car at the same time, but if Jill gets there first, she does her job completely, including the changing of both left side tires. As soon as she finishes the last tire, Hill can begin fueling. If Hill gets there first, Jill must wait until he is finished fueling. She can begin working as soon as he disconnects the second tank.

g) Our car is not permitted to leave until all personnel are back behind the wall, and no competing cars are in the area that want to pit in front of us.

h) Competing cars are also making stops in their pits. They come into pit road distributed exponentially, with a mean of 30 seconds. If a competing car enters pit road, and their pit is behind us, they do not influence us in any way. If their pit is ahead of ours, our car cannot exit until they pass. These cars require from 3 to 9 seconds to clear our pit.  70% of the pits are ahead of ours. If a competing car enters pit road after our car starts to pull out, it is the competing car’s responsibility to yield to our car. We are born at time 0 and it takes our car from 6 to 12 seconds to get into the pit. It takes from 2 to 5 seconds to exit.

Set up this simulation to determine the total time elapsed during a typical pit stop. The recorded time should start when we are born, and stop when we have exited the pit.

1) You could probably use either the seizure of resources or gates to keep the crew and drivers from being killed on the track, but I want both to be used. Thus, your code must use gates to keep the pit crew behind the wall until our car has entered the pit, and to keep the driver from running over a crew member until they are back behind the wall. Use the seizure of resources to keep me in my pit if oncoming traffic that pits in front of me is seen.

2) Every line of code must be annotated with an explanation for the purpose of that line. For example:

SETGATE{NAME = wallgate,  STATUS = close};  “close wallgate to keep workers out until racecar stops”

Note the required quote marks. 

No hand solution.

Filed Under: Uncategorized

Dredging simulation

Posted on July 28, 2021 by Abigail Stason

Problem 6.7) Write a BOSS program to simulate the dredging/hauling/dumping job described below.

The dredge shown is being used to deepen the Intercoastal Canal between Galveston and Corpus Christi. The hold of the dredge has a capacity of 2000 cubic yards. The dredge bucket has a capacity of about 60 cy (by about, I mean that when dredging, it carries a mean of 60 cy, sometimes more, sometimes less, normally distributed, with sometimes (but rarely) as little as 50 cy, and sometimes (rarely) as much as 70 cy.) The time it takes the bucket to be positioned, lowered, filled, raised, and emptied into the hold is from 3 to 5 minutes normally distributed.

If the hold of the dredge is ever filled to capacity, the operator stops dredging for 15 minutes. After waiting she then checks to see if barges have unloaded at least half of her capacity, and if so she begins dredging again. If not, she waits another 15 minutes and checks again.

There are two barge unloading positions against the dredge.

There are 5 barges employed on this job. Each has a hold capacity of 160 cy. They require a mean loading time of 30 minutes, with sigma = 4 minutes, and a mean unloading time at the riverbank of from 8 to 10 minutes uniformly distributed.  It takes a barge from 20 to 24 minutes to travel from the dredge to the riverbank when loaded, and from 8 to 10 minutes to return, both normally distributed.

When the barges come up to the dredge, the captains are instructed to keep away unless there is a minimum of  400 cy in the hold of the dredge. This keeps the barges from getting in the way when the dredge does not have sufficient material to fill the barge, and also provides some dredge material to assist in stabilizing the dredge.

OSHA regulations require that before each dredge scoop, the dredge operator check for boats coming down the canal. If a boat is sighted, the operator must delay the next dredge scoop until the boat has passed. Boats come down the canal exponentially distributed with a mean of 1 hour, and it takes them from 4 to 16 minutes, distributed normally, to pass. Barge operations are not affected by these boats, and they may continue to work.

Study the system for 5 days, working 24 hours a day.

  1. First, take all the variation out of the model. In other words, your first run should have a dredge bucket capacity of exactly 60 cy (set sigma = 0), the time to load it 4 minutes exactly, barge loading time exactly = 30 minutes (sigma = 0), boats coming down the canal = 1 hour exactly, etc.
  2. Second, put the above stated variations back into the model and re-run it.

No hand solution.

Filed Under: Uncategorized

Oil Tank Field and Loading Dock

Posted on July 28, 2021 by Abigail Stason

Problem 6.8) The tank field and unloading dock system shown below stores oil from wells in Algeria. The oil flows from the fields at a rate of 600 bbl/min into 5 tanks, each with a capacity of 1,000,000 bbl.

Ships with a capacity of 1,000,000 bbl come to offload the oil at an average of one ship per day, distributed exponentially. The offloading lines can pump oil into each of the tankers at a rate of 8000 bbl/min. It requires between 100 and 140 minutes to dock the ships at the loading dock, with a sigma of 40/6 minutes, and between 10 to 30 minutes to cast off, with a sigma of 20/6 minutes, both distributed normally. Up to three ships can dock at the unloading dock at a time.

Storms entering the area will disrupt docking and/or loading. One third of the storms coming through the area (large storms) are of such magnitude that both docking and unloading operations are affected. You have enough warning that if loading or docking has commenced, they may continue. If not, these operations must not begin until the storm has passed. Smaller storms merely require that docking operations be delayed, and resumed after the storm passes (i.e. loading of a docked tanker may continue during the smaller storms.) Storms hit the area exponentially distributed about every month, with large storms lasting for a mean of three days, with a sigma of one day. Smaller storms last for a mean of one day with a sigma of 1/2 day.

Our problem is that the pipeline cannot be shut down for any reason. If shut down, the oil cools and solidifies in the pipeline, and we will never get it flowing again. Study the tank farm for three months, and determine if 5 tanks appear to be enough to prevent having to shut down the incoming pipeline because of the tanks getting full. If the tanks ever get full, you may shut down the simulation since the result is unacceptable. Please assume that the tanks are 1/2 full when you start your analysis. You may assume that oil comes into the facility in chunks of 600 barrels per minute, rather than continuously.

Filed Under: Uncategorized

Haul Dirt Simulation II

Posted on July 28, 2021 by Abigail Stason

Problem 6.6) Simulate the hauling of dirt from the hill to the pit, using BOSS. Normal sized trucks take a mean of 15 minutes to load, normally distributed, with a sigma of 1 minute. It takes 30 minutes for them to travel from the hill to the pit (normally distributed), with a sigma of 1 minute. It takes them 3 minutes, distributed exponentially, to dump at the pit, and 22 minutes (normal) to return to the hill, with a sigma of 0.5 minutes. There are also BIG trucks available, each of which carries twice the load of a normal truck. It takes BIG trucks 30 minutes normally distributed with a sigma of 0.5 minutes to load, and 6 minutes distributed exponentially to unload at the pit. Travel times are the same as for the normal size trucks. There is one front end loader available, and one unloading position at the pit.

Normal trucks cost $200/day, including all costs including the driver, workman’s comp, insurance, fuel, etc. BIG trucks cost 50% more. You invoice the loads actually carried to the pit at $50 per normal load, $100 for a BIG load. Compute the daily profit from this operation, assuming that you put 3 normal trucks and 2 BIG trucks on the job. For this problem, run the simulation 5 times and report the average profit.

No hand solution required, or even practical.

Filed Under: Uncategorized

Classroom simulation

Posted on July 28, 2021 by Abigail Stason

Problem 6.5) Use the BOSS computer program to simulate our 322 class. By simulate, I mean how does it behave? Include students arriving at appropriate times, going to a seat, handing in homework, waiting until class is over, leaving, etc. Make sure that they don’t run into each other when going in or out of the door, nor sit in each other’s laps. Make sure none of them get away before being released by the prof at the end of class. 30% of them hand in their homework before sitting down, the rest snag a seat first, then hand in their homework and return to their seat. You can assume that their average interarrival time is 20 seconds and that a total of 35 of the 37 enrolled will show up (an optimistic estimate).  Aisles and the area where homework is submitted need not be considered resources due to their ability to concurrently handle multiple entities.

Syntax: ARRIVE, GATE, SETGATE, TESTGATE, GOTO, SEIZE, WAIT, RELEASE. DEPART, IF, RESOURCE, LABELS, RANDOM

No hand solution required.

Address the following question in your homework submission:

Why would the following single statement

IF RANDOM <= 0.3 THEN GOTO takeaseatfirst ELSE GOTO turninhomeworkfirst;

not give the same results as:

IF RANDOM <= 0.3 THEN GOTO takeaseatfirst:
IF RANDOM >= 0.3 THEN GOTO turninhomeworkfirst;

 

E-mail from a student regarding this problem, and reply:

“Dr. Lowery”

“There seems to be no data for us to use in our simulations regarding timing of anything.”

I understand your dilemma. Many engineering problems are not well defined and require that you make estimates of the input parameters to solve the problem. This is not something that many of your undergraduate classes require you to do, but it is critical that you start to understand it is a normal part of engineering.

“I know that we can perform simple experiments ourselves to determine how long it takes to open a door, or how long it takes to walk across the room”

Sounds like a reasonable task to me.

“But what about arrival rates, or other distributions?

As mentioned in class, students arrive exponentially distributed.

“Even our experiments will not be accurate, since we can’t actually time all individuals in the class.”

If you feel that you cannot come up with a reasonable estimate for these parameters, you should drop by our classroom and measure the time it takes you to walk from the door to each seat, 200 times. That should give you a reasonable estimate of how long it takes others in the class to perform this action.

“Are we supposed to simply “make” this data up? That doesn’t seem like it would be conducive to a simulation who’s purpose is to mimic reality.” (The word is “whose”, not who’s.)

There is a difference between “making up” something, and generating reasonable engineering estimates. Might as well start learning to do this before you graduate, since you will almost certainly be asked to do so later. It is of course critical that you carefully and conspicuously note all input data for which estimates were made, so that others will know that the accuracy of your solution is based on these assumptions. You should also give your best estimate of how badly you feel the solution will be affected by the assumtions used.

L^3

 

Filed Under: Uncategorized

MacDondald’s Hamburger Store

Posted on July 28, 2021 by Abigail Stason

Problem 6.4) For the hamburger counter shown below, assume the following:

People come into the hamburger store at about every 2 minutes, distributed exponentially.

One server requires 20 seconds distributed normally, with a 5 second sigma to take an order. She then takes 60 seconds to fill the order, distributed normally, with a sigma of 10 seconds. She then takes a mean of 5 seconds, distributed exponentially to take the money and give change. The second person takes the following times for the same operations: 40, 6, 80, 12, 10. Assume that new customers will always go to the shortest line, and that the queue lengths are unlimited.

After people get their hamburgers and fries, 20% of them leave, and the rest go to the seating area. It takes between 10 and 20 seconds to get to the seating area, distributed continuous uniformly. After they are seated they eat for a mean of 5 minutes with a sigma of 1 minute. After eating, 95% of them leave, but 5% go back and order another hamburger and either go back to the seating area or go home to eat it, just like first-time buyers. Ummmm, good.

Simulate this system using BOSS, and find out if any of the resources need to be expanded to maximize our throughput. Do not change the model, just tell me where the bottlenecks are. No hand solution required.

Photo of MacDondald’s Store (to scale):

 

Filed Under: Uncategorized

Haul Dirt Simulation I

Posted on July 28, 2021 by Abigail Stason

Problem 6.3) Write a BOSS program to simulate the hauling of dirt from the hill to the pit, and run it on BOSS. You have 2 trucks, each of which takes a mean of 15 minutes to load, normally distributed, with a sigma of 1 minute. It takes 30 minutes to travel from the hill to the pit (normal distribution), with a sigma of 1 minute. It takes the trucks 3 minutes, distributed exponentially, to unload at the pit, and 22 minutes (normal distribution) to return to the hill, with a sigma of 0.5 minutes. There is one front end loader available at the hill, and one unloading position available at the pit. Assume an 8 hour day.

Trucks cost $200/day, including all costs including the driver, workman’s comp, insurance, fuel, etc. You invoice the loads actually carried to the pit at $50 per load. Run this problem on BOSS. It is run just like you ran your LP problems using MOR, except the system used is “F10, System, Simulation” instead of “F10, System, Linear.”

Using BOSS simulation, how would you change the above code to run 5, and then 7 trucks on the job. You do not need to run this change in trucks. Just make the necessary changes in your original 3-truck code and print them out.

No hand solution is required, or even reasonable, on this problem.

New Syntax: ARRIVE, WAIT, RESOURCE, LABELS, STOPTIME, IF, USED, THEN, ELSE, GOTO, SEIZE, RELEASE, DEPART, END.

Filed Under: Uncategorized

Problem 6.10

Posted on July 28, 2021 by Abigail Stason

The arrival of students to a class was measured as listed below. Sketch an interarrival time histogram for the data, using integer bins (for example 12 through 12.9999999). Determine the most likely time at which the next student would arrive at class if the random number 0.28 were used.

Note that  you can cut and paste the data shown below into Excel, or any spreadsheet. From there you calculate the interarrival times, and can then “COPY” (not cut) the results and then “PASTE SPECIAL” them as “VALUES” into another column before you will be able to sort them into bins. You will not be able to “sort” the original interarrival times you calculate, because they are not numbers, they are the results of “formulas.”

Arrival Time (seconds)

0
11.4
26.1
40.3
53.3
65.5
80
92.7
105.2
119.9
134.8
145.6
159
173.5
187.2
197.2
208.6
222
233.4
247.7
261.5
277.1
290
304.9
317.7
331.4
346.1
359.7
372.1
386.2
399.8
410.3
425.7
439.8
450.1
462.9
474.6
488.2
500.9
512.2
526.9
542.5
554.2
569.2
581.2
594
605.2
617.4
630.4
643.7
658.8
671.9
684.8
698.3
710.2
722.2
738
750.9
766.8
778.7
791.5
805.1
817.5
831
843.9
855.9
868.9
883.4
897.3
910.5
923.6
936.9
950
964.8
978.2
990.1
1002
1016.1
1029.1
1043.8
1057
1070.1
1084.6
1098.2
1113.1
1127.5
1142.2
1154.4
1168.4
1180.2
1195.1
1209.6
1225.6
1239.6
1252.6
1266.3
1278.8

Filed Under: Uncategorized

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 7
  • Go to page 8
  • 9
  • Go to page 10
  • Go to page 11
  • Interim page numbers omitted …
  • Go to page 37
  • Go to Next Page »

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