infinity issue corrected

parent 92e68215
...@@ -55,7 +55,7 @@ class Exit(CoreObject): ...@@ -55,7 +55,7 @@ class Exit(CoreObject):
CoreObject.initialize(self) CoreObject.initialize(self)
# initialize the internal Queue (type Resource) of the Exit # initialize the internal Queue (type Resource) of the Exit
self.Res=simpy.Resource(self.env, capacity=10000) self.Res=simpy.Resource(self.env, capacity=float('inf'))
# The number of resource that exited through this exit. # The number of resource that exited through this exit.
# XXX bug: cannot output as json when nothing has exited. # XXX bug: cannot output as json when nothing has exited.
self.numOfExits=0 self.numOfExits=0
......
...@@ -801,7 +801,7 @@ def createObjects(): ...@@ -801,7 +801,7 @@ def createObjects():
stop = float(element.get('stop') or -1) stop = float(element.get('stop') or -1)
# infinity (had to be done to make it as float) # infinity (had to be done to make it as float)
if stop<0: if stop<0:
stop=infinity stop=float('inf')
interval = float(element.get('interval') or 1) interval = float(element.get('interval') or 1)
duration = float(element.get('duration') or 0) duration = float(element.get('duration') or 0)
method = (element.get('method', None)) # get the method to be run / default None method = (element.get('method', None)) # get the method to be run / default None
...@@ -1286,7 +1286,7 @@ def main(argv=[], input_data=None): ...@@ -1286,7 +1286,7 @@ def main(argv=[], input_data=None):
# if the simulation is ran until no more events are scheduled, # if the simulation is ran until no more events are scheduled,
# then we have to find the end time as the time the last entity ended. # then we have to find the end time as the time the last entity ended.
if G.maxSimTime==-1: if G.maxSimTime==-1:
G.env.run(until=infinity) G.env.run(until=float('inf'))
# simulate(until=infinity) # simulate until there are no more events. # simulate(until=infinity) # simulate until there are no more events.
# # If someone does it for a model that has always events, then it will run forever! # # If someone does it for a model that has always events, then it will run forever!
# # identify from the exits what is the time that the last entity has ended. # # identify from the exits what is the time that the last entity has ended.
......
...@@ -122,7 +122,7 @@ class Source(CoreObject): ...@@ -122,7 +122,7 @@ class Source(CoreObject):
# initialize the internal Queue (type Resource) of the Source # initialize the internal Queue (type Resource) of the Source
# self.Res=Resource(capacity=infinity) # self.Res=Resource(capacity=infinity)
self.Res=simpy.Resource(self.env, capacity=10000) self.Res=simpy.Resource(self.env, capacity=float('inf'))
self.Res.users=[] self.Res.users=[]
# self.Res.waitQ=[] # self.Res.waitQ=[]
self.numberOfArrivals = 0 self.numberOfArrivals = 0
......
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