Commit 9d3fdbce authored by Georgios Dagkakis's avatar Georgios Dagkakis

bug noted by Jerome in Exit fixed. Got to see if it is better to return 0,...

bug noted by Jerome in Exit fixed. Got to see if it is better to return 0, None, or nothing in cases where there are no exits and lifespan and takt_time have no meaning
parent b013e446
...@@ -211,9 +211,10 @@ class Exit(CoreObject): ...@@ -211,9 +211,10 @@ class Exit(CoreObject):
json['_class'] = 'Dream.Exit'; json['_class'] = 'Dream.Exit';
json['id'] = str(self.id) json['id'] = str(self.id)
json['results'] = {} json['results'] = {}
json['results']['throughput']=self.numOfExits json['results']['throughput']=self.numOfExits
json['results']['lifespan']=((self.totalLifespan)/self.numOfExits)/G.Base json['results']['lifespan']=self.Lifespan[0]
json['results']['takt_time']=((self.totalTaktTime)/self.numOfExits)/G.Base json['results']['takt_time']=self.TaktTime[0]
else: #if we had multiple replications we output confidence intervals to excel else: #if we had multiple replications we output confidence intervals to excel
#for some outputs the results may be the same for each run (eg model is stochastic but failures fixed #for some outputs the results may be the same for each run (eg model is stochastic but failures fixed
#so failurePortion will be exactly the same in each run). That will give 0 variability and errors. #so failurePortion will be exactly the same in each run). That will give 0 variability and errors.
......
...@@ -98,7 +98,7 @@ def createObjects(): ...@@ -98,7 +98,7 @@ def createObjects():
distributionType=interarrivalTime.get('distributionType', 'not found') distributionType=interarrivalTime.get('distributionType', 'not found')
mean=float(interarrivalTime.get('mean', '0')) mean=float(interarrivalTime.get('mean', '0'))
entity=str_to_class(element.get('entity', 'not found')) entity=str_to_class(element.get('entity', 'not found'))
successorList=element.get('successorList', 'not found') successorList=element.get('successorList', 'not found')
S=Source(id, name, distributionType, mean, entity) S=Source(id, name, distributionType, mean, entity)
S.nextIds=successorList S.nextIds=successorList
G.SourceList.append(S) G.SourceList.append(S)
...@@ -340,7 +340,7 @@ def main(argv=[], input_data=None): ...@@ -340,7 +340,7 @@ def main(argv=[], input_data=None):
print "execution time="+str(time.time()-start) print "execution time="+str(time.time()-start)
if input_data: if input_data:
return outputJSONString return outputJSONString
if __name__ == '__main__': if __name__ == '__main__':
main() main()
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