question

Maria B17 avatar image
0 Likes"
Maria B17 asked Felix Möhlmann commented

How can I count "unique" collisions

I need to do exactly what was proposed in this situation (click here) already resolved here on the forum, however this resolution is from a very old version of flexsim and no longer works, is there anything that can be done in the current version (24)



FlexSim 24.1.0
dashboardscranecountcolision
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

The old collision was superceded by the proximity behaviour of the agent system. There you can increment a counter similar to how it's done in your linked post in the On Enter Proximity trigger. This fires when two agents enter proximity, meaning they enter each others collision radius.

https://docs.flexsim.com/en/24.0/Reference/Tools/AgentSystem/ProximityBehavior/ProximityBehavior.html

This trigger would still fire for each agent, so to increment the counter by 1 for each collision, you could try incrementing it by 0.5 in the trigger. Though there are edge cases where one agent enters proximity of another one but not vice versa.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Maria B17 avatar image Maria B17 commented ·

Thank you very much for the answer Felix, I am using another trigger from the agent system in my simulation with code to avoid and prioritize the passage of one of the cranes (exactly the same as the one I got here from the network, also click here), and the problem I am facing is that if I use this collision counting code, it is not counting a single collision, but rather all the moments in which one of the cranes is prevented from operating, can you tell me what can be done in this case?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Maria B17 commented ·

The model you linked uses the "On In Proximity" trigger which fires in each interval in which the agents are in proximity.

To count the collisions use the "On Enter Proximity" trigger which only fires once until there was at least one tick where the agents were not in proximity.

1719499187799.png

0 Likes 0 ·
1719499187799.png (4.1 KiB)