def main(test=0, CSVFileName='DataSet.csv', csvFile=None):
    if csvFile:
        CSVFileName = csvFile.name

    filename = CSVFileName
    data = ImportCSVdata(
    )  #call the Import_CSV module and using its method Input_data import the data set from the CSV file to the tool
    Data = data.Input_data(filename)

    ProcTime = Data.get(
        'ProcessingTimes',
        [])  #get from the returned Python dictionary the three data sets
    MTTF = Data.get('MTTF', [])
    MTTR = Data.get('MTTR', [])

    CI = ConfidenceIntervals()  #create a Intervals object
    DM = DataManipulation()
    if test:
        return DM.round(CI.ConfidIntervals(
            ProcTime, 0.95)), CI.ConfidIntervals(MTTR, 0.95), DM.ceiling(
                CI.ConfidIntervals(MTTF, 0.90))
    #print the confidence intervals of the data sets applying either 90% or 95% probability
    print DM.round(CI.ConfidIntervals(ProcTime, 0.95))
    print DM.ceiling(CI.ConfidIntervals(MTTF, 0.90))
    print CI.ConfidIntervals(MTTR, 0.95)
def main(test=0, CSVFileName='DataSet.csv',
                 csvFile=None):
    if csvFile:
        CSVFileName = csvFile.name
        
    filename = CSVFileName
    data=ImportCSVdata()   #call the Import_CSV module and using its method Input_data import the data set from the CSV file to the tool
    Data = data.Input_data(filename)
    
    ProcTime = Data.get('ProcessingTimes',[])       #get from the returned Python dictionary the three data sets
    MTTF = Data.get('MTTF',[])
    MTTR = Data.get('MTTR',[])
    
    CI=ConfidenceIntervals()  #create a Intervals object
    DM=DataManipulation()
    if test:
        return DM.round(CI.ConfidIntervals(ProcTime, 0.95)), CI.ConfidIntervals(MTTR, 0.95), DM.ceiling(CI.ConfidIntervals(MTTF, 0.90))
    #print the confidence intervals of the data sets applying either 90% or 95% probability
    print DM.round(CI.ConfidIntervals(ProcTime, 0.95))
    print DM.ceiling(CI.ConfidIntervals(MTTF, 0.90))
    print CI.ConfidIntervals(MTTR, 0.95)
示例#3
0
P3_Scrap= B.ReplaceWithZero(P3_Scrap)
P4_Scrap= B.ReplaceWithZero(P4_Scrap)
P5_Scrap= B.ReplaceWithZero(P5_Scrap)
P6_Scrap= B.ReplaceWithZero(P6_Scrap)
P7_Scrap= B.ReplaceWithZero(P7_Scrap)
P8_Scrap= B.ReplaceWithZero(P8_Scrap)
P9_Scrap= B.ReplaceWithZero(P9_Scrap)
P10_Scrap= B.ReplaceWithZero(P10_Scrap)
P11_Scrap= B.ReplaceWithZero(P11_Scrap)

# #Call the BasicSatatisticalMeasures object 
C=StatisticalMeasures()
#Create a list with values the calculated mean value of scrap quantity on the different stations in the line
listScrap=[C.mean(P1_Scrap),C.mean(P2_Scrap),C.mean(P3_Scrap),C.mean(P4_Scrap),C.mean(P5_Scrap),C.mean(P6_Scrap),C.mean(P7_Scrap),C.mean(P8_Scrap),C.mean(P9_Scrap),C.mean(P10_Scrap), C.mean(P11_Scrap)] 
 
D= DataManipulation()
 
listScrap=D.round(listScrap)       #Round the mean values of the list so as to get integers

dictScrap={}
dictScrap['P1']= listScrap[0]
dictScrap['P2']= listScrap[1]
dictScrap['P3']= listScrap[2]
dictScrap['P4']= listScrap[3]
dictScrap['P5']= listScrap[4]
dictScrap['P6']= listScrap[5]
dictScrap['P7']= listScrap[6]
dictScrap['P8']= listScrap[7]
dictScrap['P9']= listScrap[8]
dictScrap['P10']= listScrap[9]
dictScrap['P11']= listScrap[10]