Agent enters node.closed() and causes runtime exception in Anylogic - 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?

Related

Agents' detour behaviours in Anylogic

I'm building a pedestrian model using Anylogic. I have set my agents move in several groups between S2/S3/S4 and S1 (the movement direction is indicated by the blue two-way arrow in the figure).
Background picture for problem statement:
One group of my agents should have appeared from any position in S2(line) and moved toward S1(line), but in fact, I found several agents with obvious abnormal detour behaviour appeared. Their trajectories are shown as the red line with arrows. I have checked there was no interference of other agents at the same time.
May I ask what causes such a small amount of agents to produce this abnormal behaviour since I have set the same behaviour for the whole group? And how to fix this behaviour?

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

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

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.

How to simulate a pickup process happening in the parking lot in AnyLogic?

I am modeling a warehouse yard where trucks arrive, get loaded/offloaded and leave the site. The complexity arises when modeling the drop trailers. Those vehicles consist of two parts: tractor and trailer. Tractor and trailer enter the yard as one entity and move to the parking lot. There, the tractor drops the trailer (turquoise colored rectangles in the picture below) and then then leaves the yard. After some time another tractor (pink colored in the picture below) comes to pick up one of those trailers. When there is no free space in the parking lot, model throws an error, because I use carMoveTo block to send it to the parkingLot. Therefore it requires additional space to move the tractor. How can I avoid this issue? In fact, I do not want that pink tractor to seize a free parking lot, but to pick up one of those trailers. I tried suppressing the error by using "on the way not found" option in the carMoveTo block, but I need to get a close-to-reality animation of the yard.
I would not advise mixing the road traffic library blocks with the Process Modelling Library (PML) Blocks, unless you really need to.
You can get near-perfect animation by making use of a network-type model and just the PML blocks. You will start by replacing your Car Move To block with just a MoveTo block
You can check the WholeSale Warehouse example in AnyLogic.
There they make use of a network diagram and PML blocks to simulation all the relative parking movements of trucks and trailers.
You can do something similar by creating the correct network and node points that indicate how a truck must move when it is parking a trailer and when it is picking up a trailer.
If this solution is not scalable and you cant draw lines, you can always simply just specify the X,Y, Z coordinates.
You might then need multiple MoveTo blocks for the entire movement or you can create some sort of loop where you give a truck a list of locations to move to, the truck will go through the loop and simply execute moving to the next location in the list, until it is done and then continue with the flow chart

How can I control individual pedestrian type agents behavior using statechart in anylogic?

I am trying to do a pedestrian modeling where individual pedestrian agent behavior needs to be controlled. Can I do that using the pedestrian agent's statechart?
Update: Sorry that my initial question wasn't clear enough
main
jaywalker (agent)statechart
runtime screenshot
jaywalker agent from padsource
In the first picture (main) I have a simple pedestrian model where jaywalker (pedestrian agent) moves through 2 road crossing. Initially all the jaywalker agents are in "walking" state & colored yellow (pic: 2), but whenever some agents are near another agent (near means within the triangular shown in jaywalker agent representation), they send the message "HI" to them & socialize. If someone is socialized, then they move from "walker" state to "socializing" state (and turn red) & send messages to others who are within his triangular range("field of vision" triangle). The first 11 socializing is done directly by a message from main (on model startup) & 11 jaywalker agents are receiving it & moving to "socializing" state. The problem is in my graph it's showing the first 11 socializing but during model runtime the agent's color is not changing. Secondly, after those 11 socializing, agents aren't socializing or sending any message to others who are within his triangle.
So, I am confused about how I can make my agents move from one statechart to another while modeling the movement behavior using the pedestrian library. Am I missing any step to connect the pedestrian library & agent statechart?
It looks like you did not tell PedSource to create your custom ped agents of type "JayWalker". Try this:
Delete your population, not needed
Make sure your JayWalker agent type is defined as pedestrians in its properties:
In your PedSource, make sure it creates "JayWalker" agents as below. (You should select JayWalker where my screen selects "MyPed")
Optionally, you can make the PedSource add the created "MyPed" agents to a custom population, but likely not necessary for you.
PS: Please understand that PedSource is creating agents, do not use your population for that. Read some more about PedSource and populations and do some tutorials to understand these basic concepts better :-)