KeyError on interruption
2007-09-05 18:59:24 GMT
Hello,
I'm working on a failure model for a process production system and ran into the exception below. My model is generating two kinds of Process objects where one interrupts the other. The model generates 4 Coil objects (the interrupted) and as many Leak objects (the interrupter) as simulation time allow, usually a few. I think an instance of Leak is causing the KeyError, but I don't know how it is causing it. This happens only when I put the simulation into a loop (initialize(), simulate(), etc.), and always on the second simulation (using fixed seed in the random number generator). I searched the mailing list archives, but there is not much about KeyError's. Does anyone have an idea of what's causing this?
-José
1555.0 Coil 8 leaves. Total cycle time =47.0. Cycle Num=28
1556.5 Coil 6 leaves. Total cycle time =46.5. Cycle Num=29
1566.0 Coil 5 leaves. Total cycle time =47.0. Cycle Num=29
1584.0 Leak 5 created.
File "C:\lang\Workspace\Heaters\src\mainSim.py", line 145, in <module>
simulate(until=10*365) # days
File "C:\lang\Python25\lib\site-packages\SimPy\Simulation.py", line 2009, in simulate
a=_e._nextev()
File "C:\lang\Python25\lib\site-packages\SimPy\Simulation.py", line 554, in _nextev
tt=tempwho._nextpoint.next()
File "C:\lang\Workspace\Heaters\src\mainSim.py", line 91, in PEM
self.interrupt(c)
File "C:\lang\Python25\lib\site-packages\SimPy\Simulation.py", line 404, in interrupt
reactivate(victim)
File "C:\lang\Python25\lib\site-packages\SimPy\Simulation.py", line 597, in reactivate
a.cancel(obj)
File "C:\lang\Python25\lib\site-packages\SimPy\Simulation.py", line 380, in cancel
_e._unpost(whom=victim)
File "C:\lang\Python25\lib\site-packages\SimPy\Simulation.py", line 524, in _unpost
thislist=self.events[thistime]
KeyError: 3661.0
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ Simpy-users mailing list Simpy-users <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/simpy-users
RSS Feed