question

Beatriz Aof avatar image
0 Likes"
Beatriz Aof asked Jeanette F commented

Distancetotravel() error

I am trying to simulate an ambulance dispatch policy. My model has priority 1 and priority 3 emergencies and dispatches the ambulance closest to the emergency location (red dots) regardless of priority. The ambulances depart from their bases, which are the blue dots. An ambulance that is on its way to its base can interrupt this activity and go to an emergency. What I am trying to accomplish is to send the ambulance in the "Go Back to Base" activity to priority 1 emergencies instead of the ambulance that is already on its way (in the "Travel to Emergency - P1" activity) if its driving distance is less than the actual driving distance. I tried to do this via a "Release Token - "Reevaluation policy" activity, however, when I run I still get distancetotravel() error and I don't know how to fix it.


Model file: https://we.tl/t-ZIT3LkybIT

FlexSim 22.2.0
distancetotravelambulancetask executor dispatching strategies
· 1
5 |100000

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

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Beatriz Aof, was Kavika F's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Kavika F avatar image
0 Likes"
Kavika F answered

Hey @Beatriz Aof, your errors come from this activity block you have for Releasing Tokens.

1660259341752.png

Because you release them so often, sometimes they get destroyed before they can be used elsewhere when they're pulled from the list while in transit heading home. I changed it a little bit to have 1 token spawn at the beginning and Delay for 1000 seconds (rather than 2) to allow more time for Task Executers to travel on the GIS.

1660259415140.png

This cleared up the travel errors. See if this solution works for you.


1660259341752.png (5.8 KiB)
1660259415140.png (18.8 KiB)
5 |100000

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