Softball Manager's Problem
Project 8.5 (Modeling Using Graph Theory) pg.338A Harbor System
Project 5.5 (Simulation Modeling) pg. 222
December 14, 2016
Softball Manager's Problem
Project 8.5 (Modeling Using Graph Theory) pg.338
A Harbor System
Project 5.5 (Simulation Modeling) pg. 222
Table 1:Positions Players can play
Problem
\[sh, sn, sm, sl, sk, sj, si, sh, sg, sf, se, sd, sc, sb, sa, etc.\]
\[sp <= 1; sn <= 1; sm <= 1; sl<= 1; sk <= 1; etc. \]
The objective is to maximize the flow from the source node s to sink node t.
The objective function of the Linear Program is the total flow (over the artificial feedback link)
\[ max: sp + sn + sm + sl + sk + sj + si + sh + sg + sf + se + sd + sc + sb + sa \]
# read in lpSolve Input file
graph <- read.lp("softballproblem.txt",type = "lp")
Now we can solve the model and retrieve some results.
solve(graph)
## [1] 0
A return value of 0 indicates that the model was successfully solved.
# Get the value of the objective function get.objective(graph)
## [1] 7
The softball manager's problem has a maximum flow of 7 . A maximum flow of 7 means the manager would not fill the 11 spots requred to form his team. Therefore there is no feasible solution to this problem.
Consider a small harbor with unloading facilities for ships. Only one ship can be unloaded at any one time. Ships arrive for unloading of cargo at the harbor, and the time between the arrival of successive ships varies from 15 to 145 min. The unloading time required for a ship depends on the type and amount of cargo and varies from 45 to 90 min. We seek answers to the following questions:
What are the average and maximum times per ship in the harbor?
If the waiting time for a ship is the time between its arrival and the start of unloading, what are the average and maximum waiting times per ship?
What percentage of the time are the unloading facilities idle?
What is the length of the longest queue?
Write a computer simulation to implement the ship harbor algorithm.
Average time per ship in the harbor
hartime/5
## [1] 17.6
Average waiting time per ship before unloading
waitTime/5
## [1] 0
Percentage of total simulation time unloading facilities are idle
idletime / fin[5]
## [1] 0.4205426