Conveyor agent crossing allowed gap - anylogic

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

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?

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?

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.

Strange behaviour in Road Traffic Library

I am noticing some "strange" behaviour in the Road Traffic Library. In my model, I seize and release resources based on the position of a vehicle on the road network. The reason for this is not the issue here but in the model execution, some vehicles seemed to miss the seize step. To try and understand what was happening, I created a very simple model with a simple T-junction. Injecting a car on the vertical leg and moving it straight to the stopline at the intersection and specifying that it must stop before the line before proceeding to the next block which moves the vehicle on the horizontal, works as expected. However, if I put another stopline on the vertical road before the junction and add a carMoveTo block to first move the car to this stopline (but setting it to pass through) and then moving it to the stopline at the junction (set to stop before) the behaviour becomes inconsistent. The outer lane on a 2 lane road works as expected, but on the inner lane, the car overshoots the stopline at the junction and ends up in the intersection even before completing the block.
Can anyone explain why AnyLogic is doing this and how I can ensure that the car stop as specified?
EDIT
I have created a demonstration model in the public AnyLogic cloud at
Road Traffic Demo
Also see below screenshot for an illustration
Without the pass-through stopline the vehicle completes the block in column 2 at zero speed (stop at intersection). With the mass-through the vehicle complete the block in column 2 (carMoveTo1) at speed ~30kph (does not stop at the intersection) - I update the value of the variable "speed" on exit from the relevant block in column 2 using the car.getSpeed(KPH) method.
It seems my question was poorly formulated and what I thought was a self-explanatory example wasn't. However, I think Benjamin actually answered it in his first comment. It seems AnyLogic calculates the vehicle physics one block at a time thus it allows the car to accelerate up to its preferred speed at the pass-through StopLine and then only in the next block determines that it needs to stop at the next line and therefore needs to decelerate. If the pass-through line is too close to the stop line then the car cannot decelerate fast enough and "overshoots" the stop line. I have tested this in the example model by moving the pass-through line further away from the stop line and when far enough away, the car stops as expected with or without the pass-through block.

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 :-)