0

I am currently working on a parking place simulation. Before entering the parking place, a car has to cross a border. To simulate that, I added a "carMoveToBorder" block, where the car moves to a stopline. Then I added a service block to simulate the time getting served by the borderService. Now that I am having a car network, I dont really know how to specify the location of the delay or the queue inside the service block. I tried specifying the location of the delay by entering the name of the stopLine but I got an error message saying: Type mismatch: cannot convert from Agent to AnimationStaticLocationProvider

Pictures are below. Help is appreciated.

Thank you for your time.

borderServicePicture1 borderServicePicture2

TomF77
  • 13
  • 2
  • **DO NOT post images of code, data, error messages, etc.** - copy or type the text into the question. [ask] – Rob Jan 15 '21 at 02:47

1 Answers1

0

why dont you try to use Delay instead of Service. One of the difference between them is that Service has embedded queue. But maybe in your case the car will never use that queue, i mean if its right in front of border but not quite there, it means its still in CarMoveToBorder block. And i guess in Delay you just dont have to set any agent location. (btw, what happens if you leave agent location blank in Service?)

  • Thank you for your answer. I managed to add a delay and a service. But the cars never enter the queue, they just pass it because there is no location defined for it. I could just calculate the queue by myself but it would be much easier having a working queue block – TomF77 Jan 17 '21 at 20:35
  • the reason they pass through the queue is NOT because there is no location defined. That location is only needed for animation purposes. If you want to calculate the amount of cars that are waiting before border try to use another technique. For example count the cars based on their position(or the current road) and the speed. For example you may say that the car is queueing iff its located on roadX and has speed < 20 KMH. – yuriy pidvalny Jan 17 '21 at 21:25
  • Alright, I will do it like that. Thank you for your help! – TomF77 Jan 19 '21 at 14:14