Commit 29802823 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

reinstatement of code to output trace (if it is yes on the topology)

parent 72a309a8
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"_class": "Dream.Configuration", "_class": "Dream.Configuration",
"numberOfReplications": "1", "numberOfReplications": "1",
"maxSimTime": "1440", "maxSimTime": "1440",
"trace": "No", "trace": "Yes",
"confidenceLevel": "0.95" "confidenceLevel": "0.95"
}, },
"elementList": [ "elementList": [
......
...@@ -347,6 +347,14 @@ def main(argv=[], input_data=None): ...@@ -347,6 +347,14 @@ def main(argv=[], input_data=None):
for model_resource in G.RepairmanList: for model_resource in G.RepairmanList:
model_resource.postProcessing(G.maxSimTime) model_resource.postProcessing(G.maxSimTime)
#output trace to excel
if(G.trace=="Yes"):
G.traceFile.save('trace'+str(i+1)+'.xls')
G.traceIndex=0 #index that shows in what row we are
G.sheetIndex=1 #index that shows in what sheet we are
G.traceFile = xlwt.Workbook() #create excel file
G.traceSheet = G.traceFile.add_sheet('sheet '+str(G.sheetIndex), cell_overwrite_ok=True) #create excel sheet
G.outputJSONFile=open('outputJSON.json', mode='w') G.outputJSONFile=open('outputJSON.json', mode='w')
G.outputJSON['_class'] = 'Dream.Simulation'; G.outputJSON['_class'] = 'Dream.Simulation';
G.outputJSON['general'] ={}; G.outputJSON['general'] ={};
......
...@@ -191,8 +191,9 @@ class Machine(CoreObject): ...@@ -191,8 +191,9 @@ class Machine(CoreObject):
def checkIfMachineIsUp(self): def checkIfMachineIsUp(self):
return self.Up return self.Up
#calculates the processing time
def calculateProcessingTime(self): def calculateProcessingTime(self):
return self.rng.generateNumber() return self.rng.generateNumber() #this is if we have a default processing time for all the entities
#checks if the Machine can accept an entity #checks if the Machine can accept an entity
#it checks also who called it and returns TRUE only to the predecessor that will give the entity. #it checks also who called it and returns TRUE only to the predecessor that will give the entity.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment