1

If you have two different transporter types in your model. And you want to have a variable that counts the amount of time they are close to each other (say within 0.5meter) and blocking each other. Is there a way in anylogic to code this?

So that you can say during a day the transport type is 300 times blocked by another transporter type?

I've no clue how to do this.

Thanks.

Jaco-Ben Vosloo
  • 3,770
  • 2
  • 16
  • 33
Aron T.
  • 448
  • 2
  • 7
  • 1
    This is almost an exact duplicate of [https://stackoverflow.com/questions/64428058](https://stackoverflow.com/questions/64428058) and [https://stackoverflow.com/questions/69971364](https://stackoverflow.com/questions/69971364). The latter of these is a more usefully worded and answered question (although I would say that since I answered it :-)). – Stuart Rossiter Dec 16 '21 at 23:22

1 Answers1

2

Since there are no other answers here is a potential solution, which might be very resource-intensive, but it will at least give you something to work with.

You can write an event that records the distance to any other transporter if the distance is less than a specific value.

You can then post-process this by analyzing the events and checking that if it was closer than the threshold for more than 2 seconds you assume it was being blocked

enter image description here

Jaco-Ben Vosloo
  • 3,770
  • 2
  • 16
  • 33