@author: zuq31 """ #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
# -*- coding: utf-8 -*- import VBASim import RNG import Basic_Classes import math import numpy as np import pandas as pd from scipy import stats Clock = 0.0 ZRNG = RNG.InitializeRNSeed() Queue = Basic_Classes.FIFOQueue() # Inventory Calendar = Basic_Classes.EventCalendar() Server = Basic_Classes.Resource() # dummy, not used TheCTStats = [] TheDTStats = [] TheQueues = [] TheResources = [] TheQueues.append(Queue) TheResources.append(Server) AllStats = [] p = 0.2 MeanTBA = 1.0 # Demand Arrival MeanLead = 1.0 # Item Arrival T = 240 # Runlength s = 4 S = 10 NumSold = 0 # total number of sold items M = 0 # total number of ordered items o = 0.5 r = 1
import VBASim 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
#!/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 Basic_Classes import pandas as pd import csv Clock = 0.0 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)
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import VBASim import RNG import Basic_Classes import pandas as pd Clock = 0.0 ZRNG = RNG.InitializeRNSeed() Queue1 = Basic_Classes.FIFOQueue() # Financial Queue2 = Basic_Classes.FIFOQueue() # Contact Management Wait = Basic_Classes.DTStat() Server1 = Basic_Classes.Resource() # Financial Server2 = Basic_Classes.Resource() # Contact Management Calendar = Basic_Classes.EventCalendar() TheCTStats = [] TheDTStats = [] TheQueues = [] TheResources = [] TheDTStats.append(Wait) TheQueues.append(Queue1) TheQueues.append(Queue2) TheResources.append(Server1) TheResources.append(Server2) s1 = 4 s2 = 3 Server1.SetUnits(s1) Server2.SetUnits(s2) MeanTBA = 1.0 MeanST1 = 5.0 MeanST2 = 5.0