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