worksheet_Inter=worksheets[0]#Define the worksheet with the Inter-arrivals time data
worksheets=workbook.sheet_names()
worksheet_Inter=worksheets[0]#Define the worksheet with the Inter-arrivals time data
data=Import_Excel()
data=Import_Excel()
interTimes=data.Input_data(worksheet_Inter,workbook)#Create the Inter-arrival times dictionary with key the Source and values the inter-arrival time data
interTimes=data.Input_data(worksheet_Inter,workbook)#Create the Inter-arrival times dictionary with key the Source and values the inter-arrival time data
S1=interTimes.get('Source',[])
S1=interTimes.get('Source',[])
#Read from the given directory the Excel document with the data
#Read from the given directory the Excel document with the data
workbook=xlrd.open_workbook('DataSet.xlsx')
worksheets=workbook.sheet_names()
worksheets=workbook.sheet_names()
worksheet_Fail=worksheets[1]#Define the worksheet with the failures data (MTTF,MTTR)
worksheet_Fail=worksheets[1]#Define the worksheet with the failures data (MTTF,MTTR)
data=Import_Excel()
data=Import_Excel()
failures=data.Input_data(worksheet_Fail,workbook)#Create the failures dictionary with key the MTTF and MTTR data points
failures=data.Input_data(worksheet_Fail,workbook)#Create the failures dictionary with key the MTTF and MTTR data points
MTTF=failures.get('MTTF',[])
MTTF=failures.get('MTTF',[])
MTTR=failures.get('MTTR',[])
MTTR=failures.get('MTTR',[])
#======================= Fit data to probability distributions ================================#
#======================= Fit data to probability distributions ================================#
#The Distributions and DistFittest objects are called to fit statistical distributions to the in scope data
#The Distributions and DistFittest objects are called to fit statistical distributions to the in scope data
dist=Distributions()
dist=Distributions()
act2Proc=dist.Weibull_distrfit(Activity2_Proc)
act2Proc=dist.Weibull_distrfit(Activity2_Proc)
act3Proc=dist.Weibull_distrfit(Activity3_Proc)
act3Proc=dist.Weibull_distrfit(Activity3_Proc)
s1Times=dist.Exponential_distrfit(S1)
s1Times=dist.Exponential_distrfit(S1)
distFit=DistFittest()
distFit=DistFittest()
act1MTTF=distFit.ks_test(MTTF)
act1MTTF=distFit.ks_test(MTTF)
act1MTTR=distFit.ks_test(MTTR)
act1MTTR=distFit.ks_test(MTTR)
#======================= Output preparation: output the updated values in the XML file of this example ================================#
#======================= Output preparation: output the updated values in the XML file of this example ================================#
datafile=('Topology1.xml')#define the input xml file
ifnotsimul8XMLFile:
tree=et.parse(datafile)
datafile=(os.path.join(os.path.dirname(os.path.realpath(__file__)),simul8XMLFileName))#It defines the name or the directory of the XML file
simul8=Simul8Output()#Call the Simul8Output object
tree=et.parse(datafile)
#Assign the statistical distribution calculated above in the XML file using methods of the Simul8Output object