Esempio n. 1
0
def calc_move_time(dist):
    total = 0
    for i in range(dist):
        total+=(0.5+rvgs.exponential(0.5))
    return total
Esempio n. 2
0
def littlef(x, y, thetax, thetay):
    val = 4 * rvgs.exponential(-(x / thetax)**2 - (y / thetay)**2)
    return val
Esempio n. 3
0
 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
Esempio n. 4
0
def littlef(x, y, thetax, thetay):
    val = 4 * rvgs.exponential(-(x/thetax)**2-(y/thetay)**2)
    return val
Esempio n. 5
0
def calc_move_time(dist):
    total = 0
    for i in range(dist):
        total += (0.5 + rvgs.exponential(0.5))
    return total
Esempio n. 6
0
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:
Esempio n. 7
0
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
Esempio n. 8
0
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
Esempio n. 9
0
 def get_service(self):
     return rvgs.exponential(3)
Esempio n. 10
0
 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