def Llegar(self) : 
     
     with open("n_comunes/g_tiempo_hasta_otro_paciente.txt","a") as document:
         while True : 
             hora,  dia = INDEX.hora(now()),   INDEX.dia(now())
             t_llegada = tasas[hora][dia]          
             tiempo = exponential((t_llegada/60))     
             document.write("{}\n".format(tiempo))             
             yield hold,  self,  tiempo
Exemplo n.º 2
0
 def get_interval(self):
     """  generate interval between two consequent transitions accoding to
     expontial distribution
     """
     val = exponential(self.v[self.cs])
     return val
Exemplo n.º 3
0
 def __init__(self, service_time_rate):
     self.service_rate = service_time_rate
     t = random.exponential(scale=service_time_rate, size=1)[0]
     self.service_time = t
Exemplo n.º 4
0
def create_exponential_interarrival(arrival_rate, n, max_times=1000):
    inter_arrivals = random.exponential(scale=arrival_rate, size=n)
    arrival_times = np.cumsum(inter_arrivals)
    while arrival_times[-1] > max_times:
        arrival_times = arrival_times[:-1]
    return arrival_times
Exemplo n.º 5
0
 def get_interval(self):
     """  generate interval between two consequent transitions accoding to
     expontial distribution
     """
     val = exponential(self.v[self.cs])
     return val
Exemplo n.º 6
0
 def scheduleERV(self, event, propensity):
     self.events.put(
         (self.time + random.exponential(1.0 / propensity), event))
Exemplo n.º 7
0
import random
import math
from numpy import random
from queue import Queue

SEED = 1
i = 0
random.seed(SEED)
while i < 20:
    i += 1

    print(random.exponential(1 / 5))
Exemplo n.º 8
0
def tiempo_hasta_otro_paciente(t_llegada):
	#if not NUMEROS_ALEATORIOS_COMUNES:
		return exponential((t_llegada/60))