def calc_move_time(dist): total = 0 for i in range(dist): total+=(0.5+rvgs.exponential(0.5)) return total
def littlef(x, y, thetax, thetay): val = 4 * rvgs.exponential(-(x / thetax)**2 - (y / thetay)**2) return val
def get_service(self): return rvgs.exponential( 2 ) #chose exponential because it is skewed toward smaller numbers but if they mess up we have a possiblilty of getting higher numbers
def littlef(x, y, thetax, thetay): val = 4 * rvgs.exponential(-(x/thetax)**2-(y/thetay)**2) return val
def calc_move_time(dist): total = 0 for i in range(dist): total += (0.5 + rvgs.exponential(0.5)) return total
heapq.heappush(heap, event3) print(heapq.heappop(heap).eventType.name) # .name gives string name of enum, .value gets the number of the enum print(heapq.heappop(heap).eventType) print(heapq.heappop(heap).eventType) #Next set of things is to mess with ranges of the different distributions total_time = 0 num_items = int(rvgs.uniform(1,6)) min = 999999999999999 max = 0 for j in range(0,1000): total_time = 0 for i in range(0, num_items): num = rvgs.exponential(1.5) total_time += rvgs.exponential(1.5) if total_time > max: max = total_time if total_time < min: min = total_time print("max = ", max) print("min = ", min) min = 999999999 max = 0 for k in range(0,1000): num = rvgs.exponential(3) if num > max: max = num if num < min:
def get_arrival(interarrival): get_arrival.arrival_time += rvgs.exponential( interarrival ) #adjusting this number will adjust our inter-arrival time return get_arrival.arrival_time # arrival time is one of those function variable things that I cant remember the name of
def get_arrival(interarrival): get_arrival.arrival_time += rvgs.exponential(interarrival) #adjusting this number will adjust our inter-arrival time return get_arrival.arrival_time # arrival time is one of those function variable things that I cant remember the name of
def get_service(self): return rvgs.exponential(3)
def get_service(self): return rvgs.exponential(2) #chose exponential because it is skewed toward smaller numbers but if they mess up we have a possiblilty of getting higher numbers