0% found this document useful (0 votes)
35 views4 pages

114 - LabAct 1

The document describes a simulation model of a movie theater workflow to calculate average wait times with varying numbers of cashiers, servers, and ushers. It includes the simulation code and outputs showing default, minimum employee, and lowest wait time scenarios. Recommendations are provided to meet a 10-minute wait time requirement while minimizing employees, such as automating ticket sales and focusing on cashier-server ratios.

Uploaded by

Mors Talionis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views4 pages

114 - LabAct 1

The document describes a simulation model of a movie theater workflow to calculate average wait times with varying numbers of cashiers, servers, and ushers. It includes the simulation code and outputs showing default, minimum employee, and lowest wait time scenarios. Recommendations are provided to meet a 10-minute wait time requirement while minimizing employees, such as automating ticket sales and focusing on cashier-server ratios.

Uploaded by

Mors Talionis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

IT-115: QUANTITATIVE METHODS SHANE IVAN FALLAR

BSIT – 3C

LABORATORY ACTIVITY NO. 1


THEATER MANAGEMENT SIMULATION

FLOWCHART MODEL

Enter # of Enter # of Enter # of


START cashiers servers ushers

Generate new Use Default No


Parameters Valid Input?
moviegoer
(1,1,1)

Yes
Moviegoer buys Moviegoer arrives Generate a Queue
ticket; and waits in line to with Three (3)
Generate buy ticket Customers
random delay
(1-3 min)

Moviegoer gets in Ticket is Yes Get in line and


line and waits to checked by an Moviegoer
purchase food.
have ticket checked. Usher buys
Generate
Generate delay Snacks?
random delay
(3 sec) (1-5 min)

No

No Simulation Record total Enter theater


has reached wait time and and find their
time limit? insert it to list. seat.

Yes

ALGORITHM Calculate
average wait Display average
wait time END
1. INPUT, usertimeis prompted to enter number 6. CHOOSE, whether or not to buy food.
of Cashiers. a. BUYS FOOD, get in line to a
2. INPUT, user is prompted to enter number server.
of Servers. b. DOESN’T BUY, skip this step.
3. INPUT, user is prompted to enter number 7. GO, moviegoers find their seat.
of Ushers. 8. RECORD, total time taken is added to
4. ARRIVE, moviegoers arrive at the theater wait time list.
and get in line. 9. LIMIT, check if simulation time limit is
5. BUY, moviegoers buy ticket from the reached.
cashier. a. LIMIT NOT REACHED, add
6. CHECK, ticket is checked by an usher. new moviegoer and go back to step
5.
b. REACHED, go to next step.
IT-115: QUANTITATIVE METHODS SHANE IVAN FALLAR
BSIT – 3C

CODE
import simpy
import random
import statistics
wait_times = []

class Theater(object):
      def __init__(self, env, num_cashiers, num_servers, num_ushers):
        self.env = env
        self.cashier = simpy.Resource(env, num_cashiers)
        self.servers = simpy.Resource(env, num_servers)
        self.ushers = simpy.Resource(env, num_ushers)

# Pre-Move Processes
      def purchase_ticket(self, moviegoer):
          yield self.env.timeout(random.randint(1, 3))

      def check_ticket(self, moviegoer):
          yield self.env.timeout(3 / 60)

      def sell_food(self, moviegoer):
          yield self.env.timeout(random.randint(1, 5))

# Moviegoer Requests
def go_to_movies(env, moviegoer, theater):
      arrival_time = env.now

      with theater.cashier.request() as request:
        yield request
        yield env.process(theater.purchase_ticket(moviegoer))

      with theater.cashier.request() as request:
        yield request
        yield env.process(theater.check_ticket(moviegoer))

      if random.choice([True, False]):
        with theater.servers.request() as request:
          yield request
          yield env.process(theater.sell_food(moviegoer))

      wait_times.append(env.now - arrival_time)

# Time Randomizers
def run_theater(env, num_cashiers, num_servers, num_ushers):
    theater = Theater(env, num_cashiers, num_servers, num_ushers)
  
    for moviegoer in range(3):
      env.process(go_to_movies(env, moviegoer, theater))
IT-115: QUANTITATIVE METHODS SHANE IVAN FALLAR
BSIT – 3C

    while True:
      yield env.timeout(0.20)

      moviegoer += 1
      env.process(go_to_movies(env, moviegoer, theater))

# Get Time Average


def get_average_wait_time(wait_times):
    average_wait = statistics.mean(wait_times)
    minutes, frac_minutes = divmod(average_wait, 1)
    seconds = frac_minutes * 60
    return round(minutes), round(seconds)

# User Input Part


def get_user_input():
      num_cashiers = input("Input # of cashiers working: ")
      num_servers = input("Input # of servers working: ")
      num_ushers = input("Input # of ushers working: ")
      params = [num_cashiers, num_servers, num_ushers]
      
      if all(str(i).isdigit() for i in params):
        params = [int(x) for x in params]
      else:
        print("Could not parse input. The simulation will use default value
s:", "\n1 cashier, 1 server, 1 usher.",)
        params = [1, 1, 1]

      return params

# Main Simulation Loop


def main():
  random.seed(42)
  num_cashiers, num_servers, num_ushers = get_user_input()

  env = simpy.Environment()
  env.process(run_theater(env, num_cashiers, num_servers, num_ushers))
  env.run(until=90)
  
  mins, secs = get_average_wait_time(wait_times)
  print("Running simulation...", f"\nThe average wait time is {mins} minute
s and {secs} seconds.",)

if __name__ == '__main__':
    main()

OUTPUTS
IT-115: QUANTITATIVE METHODS SHANE IVAN FALLAR
BSIT – 3C

A. Default Parameter Results

B. Meeting Requirements using the least number of Employees

C. Lowest Possible Time

RECCOMENDATIONS
From the above outputs, it is easily seen that the biggest determining factors to the wait time
are the number of cashiers and the number of serves currently working. In order to even get within the
below 10-minute requirement there must be at least ten (10) cashiers. On the other hand, the theater
must work to minimize the number of Serves as these all must be actual employees due to the nature
of the task of serving food, while ticket selling on the other hand can be automated using kiosks.
With all these taken into account the following course of action is recommended:
a. Find a set up that achieves the following requirements:
i. Minimizes total number of workers.
ii. Find a Cashier to Server ration that uses the least possible number of servers even
at the cost of adding cashiers.

b. Automate the selling of tickets as much as possible, ideally having 1 Human cashier for
every 5 Kiosks to account for possible emergencies.

c. Minimize number of ushers due to their negligible effect on waiting time.

You might also like