#Call the HandleOutliers object and delete the outliers in the lists with the scrap quantity and processing times data of each station
C=HandleOutliers()
MA_Scrap=C.DeleteOutliers(MA_Scrap)
MA_Proc=C.DeleteOutliers(MA_Proc)
M1A_Scrap=C.DeleteOutliers(M1A_Scrap)
M1A_Proc=C.DeleteOutliers(M1A_Proc)
M1B_Scrap=C.DeleteOutliers(M1B_Scrap)
M1B_Proc=C.DeleteOutliers(M1B_Proc)
M2A_Scrap=C.DeleteOutliers(M2A_Scrap)
M2A_Proc=C.DeleteOutliers(M2A_Proc)
M2B_Scrap=C.DeleteOutliers(M2B_Scrap)
M2B_Proc=C.DeleteOutliers(M2B_Proc)
M3A_Scrap=C.DeleteOutliers(M3A_Scrap)
M3A_Proc=C.DeleteOutliers(M3A_Proc)
M3B_Scrap=C.DeleteOutliers(M3B_Scrap)
M3B_Proc=C.DeleteOutliers(M3B_Proc)
MM_Scrap=C.DeleteOutliers(MM_Scrap)
MM_Proc=C.DeleteOutliers(MM_Proc)
PrA_Scrap=C.DeleteOutliers(PrA_Scrap)
PrA_Proc=C.DeleteOutliers(PrA_Proc)
PrB_Scrap=C.DeleteOutliers(PrB_Scrap)
PrB_Proc=C.DeleteOutliers(PrB_Proc)
PaA_Scrap=C.DeleteOutliers(PaA_Scrap)
PaA_Proc=C.DeleteOutliers(PaA_Proc)
PaB_Scrap=C.DeleteOutliers(PaB_Scrap)
PaB_Proc=C.DeleteOutliers(PaB_Proc)
#Call the BasicStatisticalMeasures object and calculate the mean value of the processing times for each station
E=BasicStatisticalMeasures()
meanMA_Proc=E.mean(MA_Proc)
meanM1A_Proc=E.mean(M1A_Proc)
meanM2A_Proc=E.mean(M2A_Proc)
meanM3A_Proc=E.mean(M3A_Proc)
meanM1B_Proc=E.mean(M1B_Proc)
meanM2B_Proc=E.mean(M2B_Proc)
meanM3B_Proc=E.mean(M3B_Proc)
meanMM_Proc=E.mean(MM_Proc)
meanPrA_Proc=E.mean(PrA_Proc)
meanPrB_Proc=E.mean(PrB_Proc)
meanPaA_Proc=E.mean(PaA_Proc)
meanPaB_Proc=E.mean(PaB_Proc)
stopTime=datetime.datetime(2014,3,27,8,40,00)#Give the stop time, based on this the WIP levels in the assembly line are identified calling the WIP method
WIP=currentWIP(processStory,stopTime)#Call the currentWIP method, giving as attributes the processStory dict and the stopTime
#With the loop statement in the outcome of the currentWIP method, which is a dictionary with the name WIP, with a series of calculations the units to be processed are calculated by the WIP batches in the stations
# Call the DistFittest object and conduct Kolmogorov-Smirnov distribution fitting test in the processing times lists of each station
D=DistFittest()
dictProc={}#Create a dictionary that holds the statistical distributions of the processing times of each station
dictProc['MA']=D.ks_test(MA_Proc)
dictProc['M1A']=D.ks_test(M1A_Proc)
dictProc['M1B']=D.ks_test(M1B_Proc)
dictProc['M2A']=D.ks_test(M2A_Proc)
dictProc['M2B']=D.ks_test(M2B_Proc)
dictProc['M3A']=D.ks_test(M3A_Proc)
dictProc['M3B']=D.ks_test(M3B_Proc)
dictProc['MM']=D.ks_test(MM_Proc)
dictProc['PrA']=D.ks_test(PrA_Proc)
dictProc['PrB']=D.ks_test(PrB_Proc)
dictProc['PaA']=D.ks_test(PaA_Proc)
dictProc['PaB']=D.ks_test(PaB_Proc)
#Call the Distributions object and fit (using the Maximum Likelihood Estimation) the lists with the scrap quantity into a discrete statistical distribution, i.e. Geometric distribution
D=Distributions()
dictScrap={}#Create a dictionary that holds the Geometric, which is a discrete statistical distribution of the processing times of each station
dictScrap['MA']=D.Geometric_distrfit(MA_Scrap)
dictScrap['M1A']=D.Geometric_distrfit(M1A_Scrap)
dictScrap['M1B']=D.Geometric_distrfit(M1B_Scrap)
dictScrap['M2A']=D.Geometric_distrfit(M2A_Scrap)
dictScrap['M2B']=D.Geometric_distrfit(M2B_Scrap)
dictScrap['M3A']=D.Geometric_distrfit(M3A_Scrap)
dictScrap['M3B']=D.Geometric_distrfit(M3B_Scrap)
dictScrap['MM']=D.Geometric_distrfit(MM_Scrap)
dictScrap['PrA']=D.Geometric_distrfit(PrA_Scrap)
dictScrap['PrB']=D.Geometric_distrfit(PrB_Scrap)
dictScrap['PaA']=D.Geometric_distrfit(PaA_Scrap)
dictScrap['PaB']=D.Geometric_distrfit(PaB_Scrap)
#Call the JSON_example method giving as attributes the dictionaries with the processing times distributions and the scrap quantities distributions and the WIP levels in the assembly line