Agents unable to leave "Conveyor Enter" block. How to wait for "space" on the conveyor before sending agent into flowchart? - anylogic

In my model, there are pickers moving along a picking aisle. They pick up "Box" agents from a "picking slot", and then transfer those "Box" agents into a conveyor flowchart using the enter.take() method. The specific conveyor and entry point on that conveyor are dynamically defined according to the picker's current location.
A simple flowchart like so:
It works most of the time, but when traffic gets high, I end up with the following error.
An agent was not able to leave the port root.enter_convey.out at time
784.505 / date Mar 8, 2021, 12:12:04 AM (current model time is 785.088). Consider increasing capacities and/or throughputs of the subsequent object(s) or using PULL protocol
I suspect it is due to a presentation of the "Box" agent existing within the entry area of the ConveyorPath during the time the following agent is slated to enter. Is that correct? If not, what is the issue?
If my suspicions are correct, how would I go about finding out whether the entry zone of the conveyor I am trying to place agents on is occupied? And how would I go about writing a condition in order to only send agents into the conveying flowchart if the space is free?
EDIT - Additional details, follow up to Yashar's answer:
I have multiple conveyor/picking aisles, and within each of those are multiple pickers.
Let's say picker 1 is dropping off Box X at offset A, and there is currently no space. Box X enters and stays in the queue.
At the same moment, picker 2 is dropping off Box Y at offset B, and there is also no space. Box Y enters and stays in the queue behind Box X.
Now according to the Queue block functions, even if a space frees up at offset B for Box Y, Box Y would still have to wait for Box X to enter the conveyor before it can enter itself. That would not be the behavior I am looking for. Am I correct in my understanding of the Queue block?
Thank you.

You can add a queue block after enter_convey. Don't forget to tick the maximum capacity there. If your conveyor system has a maximum number of units it can accommodate, then it is natural that after that limit, no units can enter the system. You can either do that or keep them in the previous station (using a delay block with "stopDelay ()" option) and whenever you have empty space in the conveyor you can send a signal to stop the delay and send it over to the conveyor system.

Related

Conveyor agent crossing allowed gap

Update: link to simplified model with replicated error added
In simulation model of conveyor technology, we are using a conveyor object type roller and we are moving our custom agents of transporter type by convey block always to the next position on a conveyor (imagine this as a exit or entry point on conveyor). It happens in some random seeds, that our agents cross allowed gap and Anylogic shows following error.
It always happens when some agent enters convey block, but the error occurs on two other transporters, when the one behind crosses the gap. - THIS IS NO LONGER TRUE. Today it happened when there was no agent entering convey block. We did not find any way to ignore this error or to find a workaround. Anyone has any ideas how to resolve it ? Picture of actual situation added, pink conveyors are breaking gap, and error pops up. We also found out that gap is broken also before, but error does not pop up.
link to simple mode file with replicated error: https://cloud.anylogic.com/model/ceafcc2a-9a05-4bb9-a56f-a1c018698b16?mode=SETTINGS&tab=GENERAL

Agent enters node.closed() and causes runtime exception in Anylogic

I have a rather huge model of a production system in anylogic with two agv fleets, which transport material between stations. My problem is solely with one of the fleets.
My product enters the system through a conveyor, seizes a transport agent, then waits on the agent and then drives off to the first station.
My problem is with the conveyor and my transport agent. After a while of simulating, I get error message and is what the console says.
Now I thoug myself clever:
If the agent is not on the conveyor (or does not care) it might not throw this error. So I put in the "on new transporter" of the transporter fleet an unit.ignoreCollisions(true);
But that did not help.
Then I made a restricted area around the conveyor (on a scale of 1000 % one of rectangles of the grid to small, then exactly the size, then one row of rectangles too big), but it still goes into the restricted area and then throws me this error.
I do not even understand how the agent can (a) care about this (it ignores collisions) and (b) how it can enter the restricted/forbidden area.
Does anyone else experience the same? How did you solve it?

Selecting a set of attractors among available attractors

i want to make Pedestrians to select a specific attractors once they enter a waiting area where this area is a waiting area , this area has many attractors , how that can be done ?
The pedWait block has that option clearly defined:
you can choose a customer attractor choice and use areaNode local variable in the attractor choice in order to get the attractor you want. In this example i choose the first attractor (with index 0), but you will have to create your own logic in order to decide what is the suitable attractor for your incoming agent.

Make agent face other agent upon MoveTo arrival?

I have a warehouse model where "Picker" agents move along the Y-axis to reach the front of a "picking slot" agent.
I would like to make it so that upon arrival in front of the picking slot, the Picker agents face the picking slot.
I am aware of the "Set rotation upon arrival" feature of the MoveTo blocks, but I am having trouble making sense out of it. What sort of value should I input here?
Is it possible to dynamically define the rotation according the the agents' relative location to each other? If so, how should I go about it? Some of the slots are on the left of the picker, and others on the right.
Thank you.
Please have a look at the Wholesale Warehouse example in the sample models (help section of AnyLogic). There they use agent.agent_image.setRotation(-PI) and then turn it into initial position with agent_image.setRotation(0) You can use this dynamically and with if conditions in your blocks.

How to make pedestrians appear at AreaNode with attractors from a pedSource

I am working on an evacuation project for a floor and would like to create a distribution of pedestrians from the pedSource block. These pedestrians will already appear in an area when I run the simulation. I want to obtain a fixed number of pedestrians in one area while the rest is distributed to other areas.
I have made a collection of areas that pedestrians will appear using allLocations (area, area1, area2 and OfficeArea). The event is triggered by an event and using a delay block. The max amount of pedestrians at the given floor is 100
Image of block flowchart
Image of floor layout plan
This is the code I tried where pedestrians would appear in the areas:
allLocations.get(uniform_discr(0, allLocations.size()-1))
I expect a fixed 10 number of pedestrians in the office area and positioned where I set the attractors, but the actual result shows more than 10 number of pedestrians and do not appear at the set attractor.
Image of actual result
Setting an attractor as a target for pedestrians is according to the documentation only working for the blocks pedWait and pedGoTo (I could actually only get it to work with pedWait, not with pedGoTo). Therefore you cannot initialize agents directly onto attractors using the initial location or the jumpTo() function.
You have several options as a workaround:
Extract the x,y coordinates of the attractor, and use the type point(x,y) to define the initial location or the location for the jumpTo()
Instead of using (graphical) attractors consider just defining points by code directly
Use very small individual areas instead of one large area with attractors
Use a pedWait block in your process flow and let your pedestrians 'walk' to their initial positions. Give the model a short time until everybody is on the desired location before starting your evacuation. You can also run the model in super fast mode during this initial phase, so that it will barely be visible.