Nicolas Chauvat | 2 Apr 17:52
Picon
Favicon
Gravatar

[ANN] EuroPython 2007: Call for Proposals

Book Monday 9th July to Wednesday 11th July 2007 in your calendar!
EuroPython 2007, the European Python and Zope Conference, will be held in
Vilnius, Lithuania.  Last year's conference was a great success, featuring
a variety of tracks, amazing lightning talks and inspiring keynotes.  With
your participation, we want to make EuroPython 2007, the sixth EuroPython,
even more successful than the previous five.

Talks, Papers and Themes
------------------------

This year we have decided to borrow a few good ideas from PyCon, one of
which is to move away from the 'track' structure.  Instead, speakers are
invited to submit presentations about anything they have done that they
think would be of interest to the Python community.  We will then arrange
them into related groups and schedule them in the space available.  In the
past, EuroPython participants have found the following themes to be of
interest:

 * Science
 * Python Language and Libraries
 * Web Related Technologies
 * Education
 * Games
 * Agile Methodologies and Testing
 * Social Skills

In addition to talks, we will also accept full paper submissions about any
of the above themes.  The Call for Refereed Papers will be posted shortly.

The deadline for talk proposals is Friday 18th May at midnight (24:00
(Continue reading)

Amr Abd El Aziz | 11 Apr 18:10
Picon

help with my model

Hi

I am having a problem with a model i have. The following error message occur 
randomly when i run the program

Traceback (most recent call last):
  File "/home/amrnet/workspace/exm/src/Ass3/original/Model.py", line 41, in 
?
    simulate(until=60.*8*240)
  File "/home/amrnet/bin/SimPy-1.8/SimPy/Simulation.py", line 2021, in 
simulate
    dispatch[command](a)
  File "/home/amrnet/bin/SimPy-1.8/SimPy/Simulation.py", line 1794, in 
requestfunc
    a[0][2]._request(a)
  File "/home/amrnet/bin/SimPy-1.8/SimPy/Simulation.py", line 1129, in 
_request
    z._remainService = z._nextTime - _t
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'

-------------------------------------------------------------------------------------------------------------------------------------
here is the problamatic source fragment it is used to model machine 
breakdown and takes the resource, mean time between failure and mean time to 
repair
-------------------------------------------------------------------------------------------------------------------------------------
class BreakDownE(Process):
    # rsc is the resource object to be preempted,in this case the machine
    # mtbf mean tim between failures
    # mttr mean time to repair
    # tm the tally object that record working time of the machine
(Continue reading)

RCRamsdell | 11 Apr 22:53
Favicon

Re: help with my model

Hi Amr,

What is happening is that in your PCellAP classes you do something like
this:

yield request,self,M2a,1
yield release,self,M1a

When the yield request above is processed the value ._nextTime is set to
None (see Simulation.py line 1154.  If the BreakDownE class tries to
pre-empt the PCellAP class while it is in middle of this, the preempt
routine tries to runs line 1129, which of course fails because nextTime
is None, which cannot do subtraction.

I think that this is a simpy bug (Klaus?).  It seems silly to not allow
a Process to request another resource if it might be bumped from one it
has with low priority.

A workaround seems to be to temporarily increase the priority of the
PCellAP while it is requesting the next resource like so:
    self._priority[M1a]=999 #<=== increase priority in M1a queue to keep
from being preempted while trying to move on
    yield request,self,M2a,1
    yield release,self,M1a

BTW, I added the following to your classes to make them easier to follow
using print statements:
class ACellAP1(Process):
    def __init__(self, name="A_CellAP1"):
        Process.__init__(self, name=name)
(Continue reading)

Amr Abd El Aziz | 12 Apr 04:37
Picon

Re: help with my model

Hi RCRamsdell,

You are right that is exactly what is happening. The problem i was modelling 
was.

a product go through 3 machines in series. The buffer between all machines 
is zero. This means if a product finishes on Machine Ma1 and requests Ma2 
and find it busy it has to block machine Ma1 till it can be processed by 
Ma2.

I modelled it using the yield request release clause you referred to.
yield request,self,M1a,1
yield hold,self,4.
yield request,self,M2a,1
yield release,self,M1a

so it can not release M1a before requiring M2a

Now machines breakdown which stop any work on them. Breakdown have to 
preempt the machine from the current job it is doing and thus have to have a 
higher priority then regular work.

I am still thinking of a work around to the event you pointed out. Perhaps 
sub-classing the Resource class will offer a solution.I would think to add a 
limited capacity buffer for jobs waiting to be processed by resources would 
do the trick.

Thank you for your help and your quick response.

Amr
(Continue reading)

Amr Abd El Aziz | 12 Apr 04:57
Picon

Re: help with my model

by the way i am sure your solution will work too. Though it does not 
actually model the situation and for that I can not include it for now. ( I 
know even my proposed model do not do the trick too for there is no machine 
that will break down while idle)

This model is an example I teach in a class on simulation and I have to 
justify to the students why I had this not so straight forward logic. That 
is also the reason I do not initialize any of the model classes.

Students have limited programming knowledge and after 5 classes now they can 
not build a simple simulation model by simpy. That is the main reason I am 
trying to teach simpy in a simple systematic manner.

Thanx again for all your help.

<html><div><P>Yours Sincerely</P>
<P>Amr</P></div></html>

----Original Message Follows----
From: <RCRamsdell <at> gldd.com>
To: <ilba7r <at> hotmail.com>, <simpy-users <at> lists.sourceforge.net>
Subject: Re: [Simpy-users] help with my model
Date: Wed, 11 Apr 2007 15:53:59 -0500

Hi Amr,

What is happening is that in your PCellAP classes you do something like
this:

yield request,self,M2a,1
(Continue reading)

Amr Abd El Aziz | 12 Apr 16:50
Picon

Re: help with my model

You are absolutly correct and by the way i implemented your modification and 
it work like a charm. My main concern was that now the expected values for 
times between breakdowns will be altered. As now we have to add to it the 
expected waiting time a breakdown have icures waiting for a blocked machine. 
It is an approximation though that is acceptable compared to others i have 
in the model.

I will implement this solution for now. And was wondering if for simpy we 
can include a code to accomodate for limited capacity queues for processes 
waiting for a resource (it might be there but I did not find it yet).

My students are used to Arena, simul8 and Awsim and having this type of work 
around always encourage them to revert to those softwares. I am using SimPy 
for in addition to its capability it trains students on the internal for 
simulation development and i found out that the process of developing the 
model teach them a lot by itself (compared to just selecting the proper 
block without taking time to know how it work).

Thanks again for your help and i  am thinking of putting limited capacity 
queues for resources as a feature request if it is not already included in 
simpy.

<html><div><P>Yours Sincerely</P>
<P>Amr</P></div></html>

----Original Message Follows----
From: <RCRamsdell <at> gldd.com>
To: <ilba7r <at> hotmail.com>
Subject: RE: [Simpy-users] help with my model
Date: Thu, 12 Apr 2007 09:33:05 -0500
(Continue reading)

Jungeol Chun | 14 Apr 00:05

using waitevent

I have a question about waitevent.

I need to wait for a signal from the other processes or timeout of the process itself.

e.g. wait for {10 seconds or message event from others}

How can I specify <event part> in 'yield waitevent, self, <event part>'?

Thanks in advance.


--
I think, therefore I am...................single!
--
Jungeol Chun                   nautes <at> gmail.com

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users
Klaus Muller | 18 Apr 14:39
Picon
Picon
Favicon

Re: using waitevent

Dear Jungeol,
the <event part> is a list or a tuple of events. If one of those events is signalled, the process which is waiting the "yield waitevent" continues.
 
Here is an example program:
 
 
from SimPy.Simulation import *
class Waiter(Process):
    """Waiting for events"""
    def waiting(self,whichEvents):
        yield waitevent,self,whichEvents
        print "At time %s process %s sees events fired:%s"\
               %(now(),self.name,[x.name for x in self.eventsFired])
       
class Signaller(Process):
    """Signalling events"""
    def signalling(self,whichEvent,when):
        yield hold,self,when
        whichEvent.signal()
       
initialize()
timeout=SimEvent("timeout")
event1=SimEvent("event1")
event2=SimEvent("event2")
w1=Waiter("Waiter1")
activate(w1,w1.waiting(whichEvents=[timeout,event1]))
w2=Waiter("Waiter2")
activate(w2,w2.waiting(whichEvents=[event1,event2]))
s1=Signaller("Signals timeout")
activate(s1,s1.signalling(whichEvent=timeout,when=10))
s2=Signaller("Signals event1")
activate(s2,s2.signalling(whichEvent=event1,when=20))
s3=Signaller("Signals event2")
activate(s3,s3.signalling(whichEvent=event2,when=30))
simulate(until=50)
 
When run, this produces:
 
At time 10 process Waiter1 sees events fired:['timeout']
At time 20 process Waiter2 sees events fired:['event1']
 
Hope this helps!
 
Klaus Muller
 

From: simpy-users-bounces <at> lists.sourceforge.net [mailto:simpy-users-bounces <at> lists.sourceforge.net] On Behalf Of Jungeol Chun
Sent: Saturday, April 14, 2007 12:05 AM
To: simpy-users <at> lists.sourceforge.net
Subject: [Simpy-users] using waitevent

I have a question about waitevent.

I need to wait for a signal from the other processes or timeout of the process itself.

e.g. wait for {10 seconds or message event from others}

How can I specify <event part> in 'yield waitevent, self, <event part>'?

Thanks in advance.


--
I think, therefore I am...................single!
--
Jungeol Chun                   nautes <at> gmail.com
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users
Tim Condit | 20 Apr 11:06
Picon

using custom priorities with a Store

Hi,

I've been working on a project for some time now, and took the
suggestion to use a Store to model a resource, which has worked out
really well.  It's close to what I need, but I'm sort of trying to get
the members of the Store's getQ to behave inside the queue like they
do outside of it.

Is there a way to have an agent -- a Taxi in this case -- call a
function to decide when they can exit the queue?  I've written a
filter function that the Taxis use to decide which (if any) of the
Fares in the Store's wait queue to pick up, which works great when
there are eligible Fares, based on my criteria.  Whatever they are,
they do not change during the simulation.

The problem comes in when the Taxis do not find an eligible Fare, and
wind up in the getQ, waiting for something to change.  They exit the
queue in either FIFO order, or based on priority, if I recall
correctly.  I am am using FIFO, which leaves the Taxis effectively
blocked until they reach the front of the queue.  Is there a way to
dynamically set the priorities based on the return code of a method
call, similar to the way that the buffer works as a filter for a yield
get, as mixedmode (a function I wrote) is used here for example?

    yield get, self, Agent.waitingFares, mixedmode, 1

Thanks in advance for any help.  It's very late here, and I apologize
if I'm not making sense. :)

Regards,
Tim

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Klaus Muller | 21 Apr 06:41
Picon
Picon
Favicon

Re: using custom priorities with a Store

Tim,
I am glad that the Store construct works for you!

I am not sure that I fully understand your design goal. Do you want the
taxis to renege (leave the getQ) if some event happens? Then I would use
yield (get,self,rL,q[,P]),(waitevent,self,<events>) or  yield
(get,self,rL,q[,P]),(hold,self,t) for a timeout.

What does the taxi do when no eligible fare is available?

Please, provide me with some more detail on your model requirements! I am
happy to help!

Klaus

> -----Original Message-----
> From: simpy-users-bounces <at> lists.sourceforge.net 
> [mailto:simpy-users-bounces <at> lists.sourceforge.net] On Behalf 
> Of Tim Condit
> Sent: Friday, April 20, 2007 11:06 AM
> To: simpy-users <at> lists.sourceforge.net
> Subject: [Simpy-users] using custom priorities with a Store
> 
> Hi,
> 
> I've been working on a project for some time now, and took 
> the suggestion to use a Store to model a resource, which has 
> worked out really well.  It's close to what I need, but I'm 
> sort of trying to get the members of the Store's getQ to 
> behave inside the queue like they do outside of it.
> 
> Is there a way to have an agent -- a Taxi in this case -- 
> call a function to decide when they can exit the queue?  I've 
> written a filter function that the Taxis use to decide which 
> (if any) of the Fares in the Store's wait queue to pick up, 
> which works great when there are eligible Fares, based on my 
> criteria.  Whatever they are, they do not change during the 
> simulation.
> 
> The problem comes in when the Taxis do not find an eligible 
> Fare, and wind up in the getQ, waiting for something to 
> change.  They exit the queue in either FIFO order, or based 
> on priority, if I recall correctly.  I am am using FIFO, 
> which leaves the Taxis effectively blocked until they reach 
> the front of the queue.  Is there a way to dynamically set 
> the priorities based on the return code of a method call, 
> similar to the way that the buffer works as a filter for a 
> yield get, as mixedmode (a function I wrote) is used here for example?
> 
>     yield get, self, Agent.waitingFares, mixedmode, 1
> 
> 
> Thanks in advance for any help.  It's very late here, and I 
> apologize if I'm not making sense. :)
> 
> 
> Regards,
> Tim
> 
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by DB2 Express Download DB2 
> Express C - the FREE version of DB2 express and take control 
> of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> 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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Gmane