This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_lcg( num_iterations ): | |
""" | |
LCG - generates as many random numbers as requested by user, using a Linear Congruential Generator | |
LCG uses the formula: X_(i+1) = (aX_i + c) mod m | |
:param num_iterations: int - the number of random numbers requested | |
:return: void | |
""" | |
# Initialize variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_number_of_carry_on_items__for_COMMUTER_passenger(): | |
""" | |
Number of bags a passenger carries is determined using a GEOMETRIC DISTIBUTION | |
BERNOULLI TRIAL with success bias %p = chance of passenger bringing bags | |
Bernoulli with 80% chance | |
P = 0.80 for international | |
:return: Number of bags a commuter passenger has carried on | |
""" | |
# Count number of iterations until a success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################### | |
##### AIRPORT SERVERS ##### | |
########################### | |
class CheckInServer: | |
""" Class used to model a server at the Check-in terminal | |
""" | |
def __init__(self): | |
""" Initialize the class variables | |
""" | |
self.service_time = 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################## | |
#### CHECK-IN QUEUES ##### | |
########################## | |
class CheckInQueue: | |
""" Class used to model a check-in line Queue | |
""" | |
def __init__(self): | |
self.queue = q.Queue() | |
self.customers_added = 0 |
NewerOlder