Re: using custom priorities with a Store
Klaus Muller <kgmuller <at> xs4all.nl>
2007-04-21 04:41:52 GMT
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/