Jose Trejo-Meza | 5 Sep 20:59
Picon

KeyError on interruption

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
Tony Vignaux | 6 Sep 00:35
Picon
Gravatar

Re: KeyError on interruption

I suggest you let us have a listing of the program so we can try and repeat the error.

On 9/6/07, Jose Trejo-Meza < jl.trejo <at> gmail.com> wrote:
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


-------------------------------------------------------------------------
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
Jose Trejo-Meza | 6 Sep 00:50
Picon

Re: KeyError on interruption

Tony,

Thanks for replying. My program can be found below. I performed a debugging step through. The keyError is being generated by a key (3661, event time) of the victim that is being "_unpost" (??) and that happens to be past the simulation end time (3650), when interrupting the victim (a Coils object) from the Leak process.

-José

from SimPy.Simulation import Process, Resource, now, initialize, activate, simulate, hold, request, release, stopSimulation
from random import Random, expovariate, weibullvariate

numberCoilsPerHeater=4
numberHeaters=9
productionRate=48
initDecokeCycle=60.0
decokeThreshold=15
cycleReduction=0.50
#decokingTime=1
decokingTime=1 #Testing
RUNS=10
   
class Coils(Process):
    """Coils subject to failure"""
    coilsTotal=0
   
    def __init__(self):
        Coils.coilsTotal+=1
        self.coilNum=Coils.coilsTotal
        Process.__init__(self)
        self.id="Coil " + str(Coils.coilsTotal)

    def decokeTime(self):
        return self.dt    # hr
   
    def decokeCycle(self):
        if now()==0:
            self.dc=initDecokeCycle
        elif self.dc<=decokeThreshold:
            self.dc=initDecokeCycle
        else:
            self.dc-=cycleReduction
        return self.dc
   
    def leakWhileWorking(self):
        self.dc = initDecokeCycle
        yield hold,self,self.dc
   
    def leakWhileDecoking(self):
        self.dc = initDecokeCycle
   
    def PEM(self):
        while True:
            arrive=now()
            yield hold,self,self.decokeCycle ()
            if self.interrupted():
                print "*** %s %s leak interruption Time left in cycle: %s"\
                    %(now(), self.id,self.interruptLeft)
                #self.leakWhileWorking()
                self.dc=initDecokeCycle
                self.dt=self.dt-self.dt # No decoking
                yield hold,self,self.dc+Leak.leakReplaceTime
                self.interruptReset()
            #print "%s %s enters."\
            #    %(arrive,self.id)
            yield request,self,decoking    # get a helpdesk line
            atlast=now()
            yield hold,self,self.decokeTime()    # get service
            self.dt = decokingTime
            if self.interrupted():
                print "*** %s %s leak interruption Time left in decoking: %s"\
                    %(now(), self.id, self.interruptLeft)
                self.dc = initDecokeCycle
                yield hold,self,Leak.leakReplaceTime
                self.interruptReset()
                #self.leakWhileDecoking()
            yield release,self,decoking    # hang up line
            cycle=now()-self.cycleStart
            self.cycles+=1
            print "%s %s leaves. Total cycle time =%s. Cycle Num=%s"\
                %(now(),self.id,cycle,self.cycles)
            self.cycleStart=now()

class Leak(Process):
    leakTotal=0
    leakReplaceTime=3
   
    def __init__(self):
        Process.__init__(self)
        Leak.leakTotal+=1
        self.coilNum=Leak.leakTotal
        self.id="Leak " + str( Leak.leakTotal)
        print "%s %s created."\
            %(now(), self.id)
   
    def PEM(self):
        n=0
        failureTime=now()
        for c in TrafficCoils.coilsList:
            self.interrupt(c)
        Leak.leakTotal += 1
        yield hold,self,Leak.leakReplaceTime

class TrafficCoils(Process):
    """Generates Coil decoke cycles"""
    arrivalRate=1/initDecokeCycle    # (per hour) arrival rate
    rv=Random(4567)    # a random number generator
    coilsList = []
   
    def __init__(self):
        Process.__init__(self)
       
    def generateCycles(self):
        n=0
        timeToNext=0
        while n<numberCoilsPerHeater:
            coil=Coils()    # new customer call
            TrafficCoils.coilsList.append(coil)
            coil.cycles=0
            coil.cycleStart=now()
            coil.dc=initDecokeCycle
            coil.dt=decokingTime
            yield hold,self,timeToNext
            timeToNext=round( TrafficCoils.rv.expovariate(TrafficCoils.arrivalRate),0)
            activate(coil,coil.PEM())
            n+=1
           
class TrafficLeaks(Process):
    """Generates Leaks (failures) in the coils"""
    rv=Random(4567)
    Walpha=63.38*30
    Wbeta=5.79
   
    def __init__(self):
        Process.__init__(self)

    def generateLeaks(self):
        while True:
            leak=Leak()
            leak.cycles=0
            leak.cycleStart=now()
            timeToNext=round(TrafficLeaks.rv.weibullvariate(TrafficLeaks.Walpha, TrafficLeaks.Wbeta),0)
            yield hold,self,timeToNext
            activate(leak,leak.PEM())

for run in range(RUNS):
    print "=== SIMULATION: %s"\
        %(run)
    initialize()
    decoking=Resource(capacity=numberCoilsPerHeater)
    trafficC=TrafficCoils()
    activate(trafficC, trafficC.generateCycles ())
    trafficL=TrafficLeaks()
    activate(trafficL,trafficL.generateLeaks())
    simulate(until=10*365)    # days
    stopSimulation()
    print (Coils.coilsTotal)

      
      

On 9/5/07, Tony Vignaux <vignaux <at> gmail.com> wrote:
I suggest you let us have a listing of the program so we can try and repeat the error.

On 9/6/07, Jose Trejo-Meza < jl.trejo <at> gmail.com> wrote:
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



-------------------------------------------------------------------------
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
Jose Trejo-Meza | 14 Sep 23:13
Picon

Re: KeyError on interruption

Klaus,

Thank you for the pointing that out. After making sure TrafficCoils.coilsList is initialized before each simulation loop, I went and looked for other variables needing initialization. This made the simulation loop work.

Given the KeyError message and me just lightly stepping through the simPy code and call stack would have never clued me into the source of the error. May I ask how you were able to pinpoint the culprit?

Thanks.

-José



On 9/6/07, kgmuller < kgwork <at> xs4all.nl> wrote:
José,
your problem is caused by a simple programming error: you don't reset the class attribute "TrafficCoils.coilsList" to [ ] at the beginning of each run. Thus, processes (i.e., instances of class "Coils") stay in that list after a run. (I suspect, that you have to reset "Leak.leakTotal" to 0, too. But I am  not sure, maybe you want to count "leakTotal" acrosss runs. Does not do any harm, anyhow. And what about "Coils.coilsTotal"? Does this refer to a total for one run, or all? )
 
Another proposal: you don't need to call "stopSimulation()" after coming out of "simulate(. . .)". Does not do any harm, but is unnecessary.
 
The script is easily repaired by adding the resetting code to the "run" loop like so:
 
. . . . .
for run in range(RUNS):
    print "=== SIMULATION: %s"\
        %(run)
    initialize()
## Begin KGM repair
    TrafficCoils.coilsList = []
## End KGM repair
    decoking=Resource(capacity=numberCoilsPerHeater)
    trafficC=TrafficCoils()
    activate(trafficC, trafficC.generateCycles ())
    trafficL=TrafficLeaks()
    activate(trafficL,trafficL.generateLeaks())
    simulate(until=10*365)    # days
## Begin KGM repair
    #stopSimulation() 
## End KGM repair
    print (Coils.coilsTotal)
 
An interesting application and nice code. Thanks for sharing this with us!
 
Keep posting on the list, please!
 
Klaus Muller

From: simpy-users-bounces <at> lists.sourceforge.net [mailto:simpy-users-bounces <at> lists.sourceforge.net ] On Behalf Of Jose Trejo-Meza
Sent: Thursday, September 06, 2007 12:51 AM
To: Tony Vignaux
Cc: simpy-users <at> lists.sourceforge.net
Subject: Re: [Simpy-users] KeyError on interruption

Tony,

Thanks for replying. My program can be found below. I performed a debugging step through. The keyError is being generated by a key (3661, event time) of the victim that is being "_unpost" (??) and that happens to be past the simulation end time (3650), when interrupting the victim (a Coils object) from the Leak process.

-José

from SimPy.Simulation import Process, Resource, now, initialize, activate, simulate, hold, request, release, stopSimulation
from random import Random, expovariate, weibullvariate

numberCoilsPerHeater=4
numberHeaters=9
productionRate=48
initDecokeCycle=60.0
decokeThreshold=15
cycleReduction=0.50
#decokingTime=1
decokingTime=1 #Testing
RUNS=10
   
class Coils(Process):
    """Coils subject to failure"""
    coilsTotal=0
   
    def __init__(self):
        Coils.coilsTotal+=1
        self.coilNum=Coils.coilsTotal
        Process.__init__(self)
        self.id="Coil " + str(Coils.coilsTotal)

    def decokeTime(self):
        return self.dt    # hr
   
    def decokeCycle(self):
        if now()==0:
            self.dc=initDecokeCycle
        elif self.dc<=decokeThreshold:
            self.dc=initDecokeCycle
        else:
            self.dc-=cycleReduction
        return self.dc
   
    def leakWhileWorking(self):
        self.dc = initDecokeCycle
        yield hold,self,self.dc
   
    def leakWhileDecoking(self):
        self.dc = initDecokeCycle
   
    def PEM(self):
        while True:
            arrive=now()
            yield hold,self,self.decokeCycle ()
            if self.interrupted():
                print "*** %s %s leak interruption Time left in cycle: %s"\
                    %(now(), self.id,self.interruptLeft)
                #self.leakWhileWorking()
                self.dc=initDecokeCycle
                self.dt=self.dt-self.dt # No decoking
                yield hold,self,self.dc+Leak.leakReplaceTime
                self.interruptReset()
            #print "%s %s enters."\
            #    %(arrive,self.id)
            yield request,self,decoking    # get a helpdesk line
            atlast=now()
            yield hold,self,self.decokeTime()    # get service
            self.dt = decokingTime
            if self.interrupted():
                print "*** %s %s leak interruption Time left in decoking: %s"\
                    %(now(), self.id, self.interruptLeft)
                self.dc = initDecokeCycle
                yield hold,self,Leak.leakReplaceTime
                self.interruptReset()
                #self.leakWhileDecoking()
            yield release,self,decoking    # hang up line
            cycle=now()-self.cycleStart
            self.cycles+=1
            print "%s %s leaves. Total cycle time =%s. Cycle Num=%s"\
                %(now(),self.id,cycle,self.cycles)
            self.cycleStart=now()

class Leak(Process):
    leakTotal=0
    leakReplaceTime=3
   
    def __init__(self):
        Process.__init__(self)
        Leak.leakTotal+=1
        self.coilNum=Leak.leakTotal
        self.id="Leak " + str( Leak.leakTotal)
        print "%s %s created."\
            %(now(), self.id)
   
    def PEM(self):
        n=0
        failureTime=now()
        for c in TrafficCoils.coilsList:
            self.interrupt(c)
        Leak.leakTotal += 1
        yield hold,self,Leak.leakReplaceTime

class TrafficCoils(Process):
    """Generates Coil decoke cycles"""
    arrivalRate=1/initDecokeCycle    # (per hour) arrival rate
    rv=Random(4567)    # a random number generator
    coilsList = []
   
    def __init__(self):
        Process.__init__(self)
       
    def generateCycles(self):
        n=0
        timeToNext=0
        while n<numberCoilsPerHeater:
            coil=Coils()    # new customer call
            TrafficCoils.coilsList.append(coil)
            coil.cycles=0
            coil.cycleStart=now()
            coil.dc=initDecokeCycle
            coil.dt=decokingTime
            yield hold,self,timeToNext
            timeToNext=round( TrafficCoils.rv.expovariate(TrafficCoils.arrivalRate),0)
            activate(coil,coil.PEM())
            n+=1
           
class TrafficLeaks(Process):
    """Generates Leaks (failures) in the coils"""
    rv=Random(4567)
    Walpha=63.38*30
    Wbeta=5.79
   
    def __init__(self):
        Process.__init__(self)

    def generateLeaks(self):
        while True:
            leak=Leak()
            leak.cycles=0
            leak.cycleStart=now()
            timeToNext=round(TrafficLeaks.rv.weibullvariate(TrafficLeaks.Walpha, TrafficLeaks.Wbeta),0)
            yield hold,self,timeToNext
            activate(leak,leak.PEM())

for run in range(RUNS):
    print "=== SIMULATION: %s"\
        %(run)
    initialize()
    decoking=Resource(capacity=numberCoilsPerHeater)
    trafficC=TrafficCoils()
    activate(trafficC, trafficC.generateCycles ())
    trafficL=TrafficLeaks()
    activate(trafficL,trafficL.generateLeaks())
    simulate(until=10*365)    # days
    stopSimulation()
    print (Coils.coilsTotal)

      
      

On 9/5/07, Tony Vignaux <vignaux <at> gmail.com> wrote:
I suggest you let us have a listing of the program so we can try and repeat the error.

On 9/6/07, Jose Trejo-Meza < jl.trejo <at> gmail.com> wrote:
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




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users
Tony Vignaux | 16 Sep 22:32
Picon
Gravatar

A suggestion about PEMs

I suggest we explore the possibility of cleaning up the clumsy activate statement:

activate(c,c.run(x,y,z)[,at=t])

Here, run is the Process Execution Method  for the Process object.  I  have found in practice that I usually choose a name for the Process Execution Method (PEM or pem) from a very limited set ( run, execute, live, ..).

I suggest an option where, if the pem is given the identifier pem, it need not be explicitly mentioned in the call.

The activate statement could then just be:
 
newactivate(c [,at=t]),

One disadvantage is that the pem could not have arguments other than self. All would have to be passed as arguments to the __init__() for the class.  Here is a question for the computer scientists: Is this good OO style? Does it matter?

Any comments?


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users
kgmuller | 24 Sep 16:40
Picon
Picon
Favicon

Proposal for a new activation method

This posting seeks your feedback on a proposal to add to the SimPy API.

Tony Vignaux and I propose to add a user-callable method "iactivate" to
class Process which will allow a simplified/shortened form of process
activation. This would be in addition to the "activate" function.

Here is the proposal:

"""Another way of activating a process, p is the iactivate Process method
attribute. 

For a subclass which has a generator function (containing a yield) called
"PEM", this can be called in the
following ways:
• p.iactivate(p.PEM([args]) [,{at=t|delay=period}] [,prior=False])
if p is a Process. Here the generator function, PEM, can have any identifier
(such as run, lifecycle, etc). It
can have parameters.
• p.iactivate([p.PEM()] [,{at=t|delay=period}] [,prior=False])
if p is a Process and the generator function is given the standard
identifier, PEM. The identifier, PEM, is
recognised as a generator method but may not have parameters. Note that the
call p.PEM() is optional.
Thus a valid call would be p.iactivate() to activate the generator PEM at
time now without attributes.
An anonymous Process object can be created and activated in one command
using iactivate using the standard
PEM identifier, PEM.
• P([args]).iactivate([{at=t|delay=period}] [,prior=False])
Here, P is the identifier for the Process and not for a Process object as
was p, in the previous statements,
above. The generator method with the standard identifier, PEM, may not have
parameters.

iactivate can also be used if the name of the generator function is
different. It can then be called like this:

• p.iactivate(p.genname([args][,{at=t|delay=period}] [,prior=False])
"""
(end of proposal)

What we would like to hear from you is:
-- what do you think of the proposal?
-- do you think that another name instead of "PEM" is more appropriate for
the generator function, e.g. "lifecycle"?
-- do you think that the programming user who wants to use the short form of
iactivate should be able to select a generator function name from a list
with several default names?

Please, let us have your feedback!

Klaus Müller 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Tony Vignaux | 25 Sep 05:20
Picon
Gravatar

Re: [Simpy-developer] Proposal for a new activation method

Klaus,

1. I suggest a more attractive alternative to iactivate would be start.
2.  I suggest that, for the sake of simplicity, we do not  give a list of alternative "approved names". We should choose a good name and stick to it. As an alternative to PEM, how about run.

Tony

On 9/25/07, kgmuller <kgmuller <at> xs4all.nl> wrote:
This posting seeks your feedback on a proposal to add to the SimPy API.

Tony Vignaux and I propose to add a user-callable method "iactivate" to
class Process which will allow a simplified/shortened form of process
activation. This would be in addition to the "activate" function.

Here is the proposal:

"""Another way of activating a process, p is the iactivate Process method
attribute.

For a subclass which has a generator function (containing a yield) called
"PEM", this can be called in the
following ways:
• p.iactivate(p.PEM([args]) [,{at=t|delay=period}] [,prior=False])
if p is a Process. Here the generator function, PEM, can have any identifier
(such as run, lifecycle, etc). It
can have parameters.
• p.iactivate([p.PEM()] [,{at=t|delay=period}] [,prior=False])
if p is a Process and the generator function is given the standard
identifier, PEM. The identifier, PEM, is
recognised as a generator method but may not have parameters. Note that the
call p.PEM() is optional.
Thus a valid call would be p.iactivate() to activate the generator PEM at
time now without attributes.
An anonymous Process object can be created and activated in one command
using iactivate using the standard
PEM identifier, PEM.
• P([args]).iactivate([{at=t|delay=period}] [,prior=False])
Here, P is the identifier for the Process and not for a Process object as
was p, in the previous statements,
above. The generator method with the standard identifier, PEM, may not have
parameters.

iactivate can also be used if the name of the generator function is
different. It can then be called like this:

• p.iactivate(p.genname([args][,{at=t|delay=period}] [,prior=False])
"""
(end of proposal)

What we would like to hear from you is:
-- what do you think of the proposal?
-- do you think that another name instead of "PEM" is more appropriate for
the generator function, e.g. "lifecycle"?
-- do you think that the programming user who wants to use the short form of
iactivate should be able to select a generator function name from a list
with several default names?

Please, let us have your feedback!

Klaus Müller


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Simpy-developer mailing list
Simpy-developer <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-developer

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users
Steven H. Rogers | 25 Sep 14:28
Favicon

Re: [Simpy-developer] Proposal for a new activation method

Concur.

# Steve
Tony Vignaux wrote:
> Klaus,
>
> 1. I suggest a more attractive alternative to iactivate would be start.
> 2.  I suggest that, for the sake of simplicity, we do not  give a list 
> of alternative "approved names". We should choose a good name and 
> stick to it. As an alternative to PEM, how about run.
>
> Tony
>
> On 9/25/07, * kgmuller* <kgmuller <at> xs4all.nl 
> <mailto:kgmuller <at> xs4all.nl>> wrote:
>
>     This posting seeks your feedback on a proposal to add to the SimPy
>     API.
>
>     Tony Vignaux and I propose to add a user-callable method
>     "iactivate" to
>     class Process which will allow a simplified/shortened form of process
>     activation. This would be in addition to the "activate" function.
>
>     Here is the proposal:
>
>     """Another way of activating a process, p is the iactivate Process
>     method
>     attribute.
>
>     For a subclass which has a generator function (containing a yield)
>     called
>     "PEM", this can be called in the
>     following ways:
>     • p.iactivate(p.PEM([args]) [,{at=t|delay=period}] [,prior=False])
>     if p is a Process. Here the generator function, PEM, can have any
>     identifier
>     (such as run, lifecycle, etc). It
>     can have parameters.
>     • p.iactivate([p.PEM()] [,{at=t|delay=period}] [,prior=False])
>     if p is a Process and the generator function is given the standard
>     identifier, PEM. The identifier, PEM, is
>     recognised as a generator method but may not have parameters. Note
>     that the
>     call p.PEM() is optional.
>     Thus a valid call would be p.iactivate() to activate the generator
>     PEM at
>     time now without attributes.
>     An anonymous Process object can be created and activated in one
>     command
>     using iactivate using the standard
>     PEM identifier, PEM.
>     • P([args]).iactivate([{at=t|delay=period}] [,prior=False])
>     Here, P is the identifier for the Process and not for a Process
>     object as
>     was p, in the previous statements,
>     above. The generator method with the standard identifier, PEM, may
>     not have
>     parameters.
>
>     iactivate can also be used if the name of the generator function is
>     different. It can then be called like this:
>
>     • p.iactivate(p.genname([args][,{at=t|delay=period}] [,prior=False])
>     """
>     (end of proposal)
>
>     What we would like to hear from you is:
>     -- what do you think of the proposal?
>     -- do you think that another name instead of "PEM" is more
>     appropriate for
>     the generator function, e.g. "lifecycle"?
>     -- do you think that the programming user who wants to use the
>     short form of
>     iactivate should be able to select a generator function name from
>     a list
>     with several default names?
>
>     Please, let us have your feedback!
>
>     Klaus Müller
>
>
>     -------------------------------------------------------------------------
>     This SF.net email is sponsored by: Microsoft
>     Defy all challenges. Microsoft(R) Visual Studio 2005.
>     http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>     _______________________________________________
>     Simpy-developer mailing list
>     Simpy-developer <at> lists.sourceforge.net
>     <mailto:Simpy-developer <at> lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/simpy-developer
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Simpy-users mailing list
> Simpy-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/simpy-users
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
kgmuller | 25 Sep 14:51
Picon
Picon
Favicon

Re: [Simpy-developer] Proposal for a new activationmethod

Tony,
re 1) could live with that.
re 2) here, I want to listen to user feedback. However, I really like neither "PEM" (too abstract) nor "run" (not descriptive enough). How about "LIFECYCLE" or "BEHAVIOR" or "ACTIONS", I don't care which, but it should be something descriptive, capturing the notion that such generator function prescribes the dynamic behavior of a modelled entity from cradle to grave. Also, the name must be written all in UPPERCASE to somehow show that it is built in.
 
Klaus Muller

From: simpy-users-bounces <at> lists.sourceforge.net [mailto:simpy-users-bounces <at> lists.sourceforge.net] On Behalf Of Tony Vignaux
Sent: Tuesday, September 25, 2007 5:20 AM
To: kgmuller
Cc: Simpy-Users List; Simpy-Developer List
Subject: Re: [Simpy-users] [Simpy-developer] Proposal for a new activationmethod

Klaus,

1. I suggest a more attractive alternative to iactivate would be start.
2.  I suggest that, for the sake of simplicity, we do not  give a list of alternative "approved names". We should choose a good name and stick to it. As an alternative to PEM, how about run.

Tony

On 9/25/07, kgmuller <kgmuller <at> xs4all.nl> wrote:
This posting seeks your feedback on a proposal to add to the SimPy API.

Tony Vignaux and I propose to add a user-callable method "iactivate" to
class Process which will allow a simplified/shortened form of process
activation. This would be in addition to the "activate" function.

Here is the proposal:

"""Another way of activating a process, p is the iactivate Process method
attribute.

For a subclass which has a generator function (containing a yield) called
"PEM", this can be called in the
following ways:
• p.iactivate(p.PEM([args]) [,{at=t|delay=period}] [,prior=False])
if p is a Process. Here the generator function, PEM, can have any identifier
(such as run, lifecycle, etc). It
can have parameters.
• p.iactivate([p.PEM()] [,{at=t|delay=period}] [,prior=False])
if p is a Process and the generator function is given the standard
identifier, PEM. The identifier, PEM, is
recognised as a generator method but may not have parameters. Note that the
call p.PEM() is optional.
Thus a valid call would be p.iactivate() to activate the generator PEM at
time now without attributes.
An anonymous Process object can be created and activated in one command
using iactivate using the standard
PEM identifier, PEM.
• P([args]).iactivate([{at=t|delay=period}] [,prior=False])
Here, P is the identifier for the Process and not for a Process object as
was p, in the previous statements,
above. The generator method with the standard identifier, PEM, may not have
parameters.

iactivate can also be used if the name of the generator function is
different. It can then be called like this:

• p.iactivate(p.genname([args][,{at=t|delay=period}] [,prior=False])
"""
(end of proposal)

What we would like to hear from you is:
-- what do you think of the proposal?
-- do you think that another name instead of "PEM" is more appropriate for
the generator function, e.g. "lifecycle"?
-- do you think that the programming user who wants to use the short form of
iactivate should be able to select a generator function name from a list
with several default names?

Please, let us have your feedback!

Klaus Müller


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Simpy-developer mailing list
Simpy-developer <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-developer

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users
The Helmbolds | 25 Sep 18:07
Picon
Favicon

Re: [Simpy-developer] Proposal for a new activationmethod

How about simply "DO" ?

----- Original Message ----
From: kgmuller <kgmuller <at> xs4all.nl>
To: Tony Vignaux <vignaux <at> gmail.com>
Cc: Simpy-Users List <simpy-users <at> lists.sourceforge.net>; Simpy-Developer List <simpy-developer <at> lists.sourceforge.net>
Sent: Tuesday, September 25, 2007 5:51:23 AM
Subject: Re: [Simpy-users] [Simpy-developer] Proposal for a new activationmethod

Tony,
re 1) could live with that.
re 2) here, I want to listen to user feedback. However, I really like neither "PEM" (too abstract) nor "run" (not descriptive enough). How about "LIFECYCLE" or "BEHAVIOR" or "ACTIONS", I don't care which, but it should be something descriptive, capturing the notion that such generator function prescribes the dynamic behavior of a modelled entity from cradle to grave. Also, the name must be written all in UPPERCASE to somehow show that it is built in.
 
Klaus Muller

From: simpy-users-bounces <at> lists.sourceforge.net [mailto:simpy-users-bounces <at> lists.sourceforge.net] On Behalf Of Tony Vignaux
Sent: Tuesday, September 25, 2007 5:20 AM
To: kgmuller
Cc: Simpy-Users List; Simpy-Developer List
Subject: Re: [Simpy-users] [Simpy-developer] Proposal for a new activationmethod

Klaus,

1. I suggest a more attractive alternative to iactivate would be start.
2.  I suggest that, for the sake of simplicity, we do not  give a list of alternative "approved names". We should choose a good name and stick to it. As an alternative to PEM, how about run.

Tony

On 9/25/07, kgmuller <kgmuller <at> xs4all.nl> wrote:
This posting seeks your feedback on a proposal to add to the SimPy API.

Tony Vignaux and I propose to add a user-callable method "iactivate" to
class Process which will allow a simplified/shortened form of process
activation. This would be in addition to the "activate" function.

Here is the proposal:

"""Another way of activating a process, p is the iactivate Process method
attribute.

For a subclass which has a generator function (containing a yield) called
"PEM", this can be called in the
following ways:
• p.iactivate(p.PEM([args]) [,{at=t|delay=period}] [,prior=False])
if p is a Process. Here the generator function, PEM, can have any identifier
(such as run, lifecycle, etc). It
can have parameters.
• p.iactivate([p.PEM()] [,{at=t|delay=period}] [,prior=False])
if p is a Process and the generator function is given the standard
identifier, PEM. The identifier, PEM, is
recognised as a generator method but may not have parameters. Note that the
call p.PEM() is optional.
Thus a valid call would be p.iactivate() to activate the generator PEM at
time now without attributes.
An anonymous Process object can be created and activated in one command
using iactivate using the standard
PEM identifier, PEM.
• P([args]).iactivate([{at=t|delay=period}] [,prior=False])
Here, P is the identifier for the Process and not for a Process object as
was p, in the previous statements,
above. The generator method with the standard identifier, PEM, may not have
parameters.

iactivate can also be used if the name of the generator function is
different. It can then be called like this:

• p.iactivate(p.genname([args][,{at=t|delay=period}] [,prior=False])
"""
(end of proposal)

What we would like to hear from you is:
-- what do you think of the proposal?
-- do you think that another name instead of "PEM" is more appropriate for
the generator function, e.g. "lifecycle"?
-- do you think that the programming user who wants to use the short form of
iactivate should be able to select a generator function name from a list
with several default names?

Please, let us have your feedback!

Klaus Müller


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Simpy-developer mailing list
Simpy-developer <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-developer


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users

Gmane