#import libraries import VBASim import Basic_Classes as bc import RNG import numpy as np #initialize variables TheQueues = [] TheResources = [] TheDTStats = [] TheCTStats = [] #create instances of objects ParkingLot = bc.FIFOQueue() MaxCars = 0 TimeSpent = bc.DTStat() Calendar = bc.EventCalendar() TheQueues.append(ParkingLot) TheDTStats.append(TimeSpent) AllAverageQueues = [] AllMaxCars = [] AllTimeSpent = [] print("Rep", "Average Number", "Max Number", "Average Time Spent") MeanTBA = 0.021 #for stationary Poisson arrival #MeanTBA = 0.03312 #for nonstationary Poisson arrival MeanPT = 1.0
import Basic_Classes as bc import RNG import numpy as np import csv Clock = 0.0 ZRNG = RNG.InitializeRNSeed() #initialize variables TheQueues = [] TheResources = [] TheDTStats = [] TheCTStats = [] WaitingList = bc.FIFOQueue() WaitingTime = bc.DTStat() Difference = bc.DTStat() Calendar = bc.EventCalendar() Server = bc.Resource() TimeSpent = bc.DTStat() TheQueues.append(WaitingList) TheDTStats.append(WaitingTime) TheDTStats.append(Difference) TheResources.append(Server) Server.SetUnits(3) MeanTBA = 1.0 MeanST = 2.7 Phases = 2 RunLength = 10000
ZRNG = RNG.InitializeRNSeed() ''' Class1 Class2 Queue1 Queue2 | \ | | \ | A B1 B2 | \ | | \ | ServerA ServerB ''' Queue1 = Basic_Classes.FIFOQueue() Queue2 = Basic_Classes.FIFOQueue() ServerA = Basic_Classes.Resource() ServerB = Basic_Classes.Resource() TotalTime1 = Basic_Classes.DTStat() TotalTime2 = Basic_Classes.DTStat() Calendar = Basic_Classes.EventCalendar() TheCTStats = [] TheDTStats = [] TheQueues = [] TheResources = [] TheDTStats.append(TotalTime1) TheDTStats.append(TotalTime2) TheQueues.append(Queue1) TheQueues.append(Queue2) TheResources.append(ServerA) TheResources.append(ServerB)
#!/usr/bin/env python2 import VBASim import RNG import Basic_Classes import pandas as pd Clock = 0.0 ZRNG = RNG.InitializeRNSeed() Queue = Basic_Classes.FIFOQueue() Wait = Basic_Classes.DTStat() Server = Basic_Classes.Resource() Calendar = Basic_Classes.EventCalendar() TheCTStats = [] TheDTStats = [] TheQueues = [] TheResources = [] TheDTStats.append(Wait) TheQueues.append(Queue) TheResources.append(Server) c = 10 # retrial if # customers in the system >= c Server.SetUnits(1) MeanTBA = 1.0 MeanST = 0.8 MeanTR = 2.0 # retrial customer return time ~ exp(MeanTR) Phases = 3 RunLength = 55000.0 WarmUp = 5000.0 AllStats = []
import VBASim import RNG import Basic_Classes import pandas as pd import math import numpy as np import matplotlib.pyplot as plt from scipy.special import comb Clock = 0.0 ZRNG = RNG.InitializeRNSeed() Queue = Basic_Classes.FIFOQueue() Wait = Basic_Classes.DTStat() Longwait = Basic_Classes.DTStat() Server = Basic_Classes.Resource() Calendar = Basic_Classes.EventCalendar() TheCTStats = [] TheDTStats = [] TheQueues = [] TheResources = [] TheDTStats.append(Wait) TheDTStats.append(Longwait) TheQueues.append(Queue) TheResources.append(Server) s = 10 Server.SetUnits(s) MeanTBA = 1 / 9.2