-2

Info: The question was updated with more explanation

I want to transport a agent (e.g. bananas) with a moving agent (e.g. truck) from place A to place B, where, for example, place A is where the bananas where plucked and place B is some storage for the bananas. So the bananas are simply being transported by the truck. Especially, the agent to be moved (the bananas) are not a resource (in the sense of Anylogic PLM) and have no upper amount limit.

There are various ways to solve this problem, but most of them either require some element in the model that I don't need or want (for example, a rack/pallet system in the case of the block 'Rack Store') or require the agents to be Anylogic resources.

As described in this answer, it kinda makes sense to use pickup and dropoff for this task. The problem is that the agent to be moved is not being transported, so that answer does not solve my question. To explain further, when the agent to be moved (the bananas) are being dropped off at the target location (place B), they simply re-appear at their original location (place A), even though the truck which picked them up via the pickup block has moved to place B.

I made a minimal example of this here. enter image description here

As I described, the 'transportation' only works if I add the separate 'moveTo1' block for the dropped off agents.

Is there any simple and obvious way to handle this rather simple task of transportation in Anylogic without having multiple move blocks or other workarounds? I know there is 'ResourceAttach', but that requires the agent to be moved to be resources, and there is 'RackStore', which requires a rack/pallet system, which I don't need or want in my model.

What I want to know is what the 'standard' Anylogic way would be to do this.

Thanks a lot in advance!

kushy
  • 356
  • 2
  • 14
  • better explain it like this... I want a truck to take my bananas to some location and i want people to take the bananas from the truck to somewhere else... the way you state your problem is the opposite of what you should do... equivalent to... "I won't explain you what I want, but this is my model and it doesn't work... I dare you to guess what I want" – Felipe Jul 09 '19 at 20:07
  • on other note.. from your description, this model is exactly what you need to do... it should work in my opinion... – Felipe Jul 09 '19 at 20:09
  • @Felipe Thank you for your reply. I'm sorry that my explanation was not good. I was under the impression that I explained it well and also made a minimal example different from my actual model, but I guess my explanation was not good enough. I will try to extend the explanation. – kushy Jul 10 '19 at 07:46

2 Answers2

0

Now I understand what your problem is...

When you use dropoff, the block that comes after it needs to define the new location of the agents, otherwise they stay in the same place.. You can use the moveTo block with a jump so the agents are teleported to the location you want them to be: moveTo

In almost all the blocks of the PML you can define the agent location in the properties, and this is a case where using that property is necessary.

Felipe
  • 8,311
  • 2
  • 15
  • 31
  • I know about the jumpTo function. My problem was that I don't want to use two separate moveTo blocks for what is technically a single movement (namely, movement of a container together with its contents). Using two separate move blocks means essentially duplicate code, which is bad. – kushy Jul 11 '19 at 09:28
  • well.. I'm sorry but this is the way. If you don't like the way, that's a different story – Felipe Jul 11 '19 at 11:43
  • It's not about my personal preference, it's about general bad coding style (namely, code duplication). What I basically want is something like RackPick and RackStore where instead of a pallet rack, I can choose a network node. That's all. But apparently, Anylogic does not have such a PML block right now. That's sad. Anyways, thanks for the answer. – kushy Jul 11 '19 at 13:09
0

You can set the position of the bananas to the position of the truck.
e.g. using agent.setXY(container.getX(), container.getY()) in the "On dropoff" field.

It seems to work for a simple test model.

Azametzin
  • 5,223
  • 12
  • 28
  • 46
KatJ
  • 1