0
votes

I'm trying to emulate what QUEST does when a buffer is queried for a certain Part. In there if the part is not in the buffer the request is left pending and if a Part arrives to the buffer it's released to the machine requesting it. I have also seen this behavior in SimPy which is another DES engine.

I can't seem to find a simple way to do this in AL. The queue block has the following methods:

  • release(agent): Will return false and forget about the request if there's not an agent as the one specified
  • remove(agent): Will return null if there's no agent in the queue

So those methods won't do what I want... It gets a little more complicated as the queue contains agents with parameters and I want to request a specific set of parameters (let's say the agents have a number parameter that can go from 1 to 3 and I'm only interested in agents in the queue if this parameter has the value 2). Also there's a series of agents pulling this agents from the queue simultaneously and I'd like a priority to be set (let's say FIFO) so there's a couple things that I've tried and have lead me nowhere:

  1. Using a seize block instead of queue and adding the agents to the embedded queue in the seize block. -> I can't find the proper method to seize from the buffer in a different way from a buffer block (so I moved to option 2) but seize does have a promising customize resource choice that could help with the parameter down-selection
  2. Using a seize block and storing the agents in a pool as resources. issues with dynamic creation of resources, seizing the appropriate one etc...
  3. Creating a queue of requests that have returned null from a queue. This sounds like an overkill but I'll look into it

All of those appear to be a bit complex for such a simple thing in other softwares for simulation so I'm wondering if I'm missing something or if someone has come across this issue before

1
As you mentioned, Anylogic does not have a native way to deal with that type of problems. What you can do is store the requests that were not fulfilled in a population (or wait block) and every time an agent enters the queue you check through those requests whether or not the agent meets the desired parameters. That's basically what QUEST and SimPy do (automatically, though). Many features available in other software are still to be implemented in Anylogic but the object oriented programming allow you to do almost anything (with a bit of Java code)luizfvpereira

1 Answers

0
votes

Suggestion 1: may it helps you to store the agents in the queue in a collection (or different collections, according to the parameter settings). Events: "on enter" and "on exit"

Suggestion 2: may the Wait - block helps you here?