In simpy, I'm using the store as my resource due to the nature of the problem.
I have a few get request for a store item. However, some get request have higher priority and I wish for it to be processed first. I do not wish to follow the FIFO rules for such special get request.
yield Store_item.get()
I tried following this question. However, I'm unable to create a subclass that suits this requirement.
I want something like this:(but this is an example of priority resource and not store resource).
def resource_user(name, env, resource, wait, prio):
yield env.timeout(wait)
with resource.request(priority=prio) as req:
print('%s requesting at %s with priority=%s'% (name,env.now,prio))
yield req
print('%s got resource at %s' % (name, env.now))
yield env.timeout(3)
However, I need it for store resource class and not a generic get for store.
The outcome will be:
yield Store_item.priority_get()