I am very new to anylogic and neither am I experienced in Java. I have tried solving this problem for a couple of days now and I feel like there should be a solution without needing to code or maybe I am using the wrong blocks.
Situation: I am trying to create a simulation where cars drive along a road and parks in a parking lot with two spaces along the road. I manage to make the cars park when the parking space is free and then drive away after a certain time.
For now, my "carMoveTo1" tells the cars to park in the free spaces and if its full the car should move to the stop line closest to the right of the parking lot via "carMoveTo3". The issue is that the car does not check if the parking lot is full until after it has passed the stopline hence if it is full they cannot turn back and queue by the stopline. I also want it to be only one lane each way so that the queue to the parking lot can be visualised.
Goal: I want to make the cars stop in a queue on the road before the parking lot if the parking lot is full.