Skip to content

FLEXSIM-12843-FLEXSIM-11184-A home travel infinite loop on OnResourceAvailable* - #22

Closed
Shivi-lab wants to merge 1 commit into
release/26.0from
tiwairsh/FLEXSIM-12843-FLEXSIM-11184-Fix-Travel-Arrival-Mismatch-For-Home-Location
Closed

Shivi-lab wants to merge 1 commit into
release/26.0from
tiwairsh/FLEXSIM-12843-FLEXSIM-11184-Fix-Travel-Arrival-Mismatch-For-Home-Location

Conversation

@Shivi-lab

@Shivi-lab Shivi-lab commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Issue: With A* enabled, OnResourceAvailable → Travel to Home Location sends the operator toward Source but stops after a few steps. The event list loops on A* ArrivalEvents and Delay task completions. Without A*, travel completes normally.

Root cause: A* treats arrival as “within grid-cell threshold,” while the home picklist still sees distancetotravel > threshold and re-dispatches travel causing an infinite loop.

Fix: In Traveler::onArrival, detect the home picklist pattern (TASKTYPE_TRAVEL followed by TASKTYPE_DELAY(0)). If distancetotravel still exceeds the picklist threshold and the operator is not yet at destLoc, walk a short final leg before completing the travel task.

Fix applies to the standard “Travel to a Home Location” picklist (TRAVEL + DELAY(0)). Custom home-travel task sequences may still need separate handling.

Card: https://autodesk.atlassian.net/browse/FLEXSIM-11184 https://autodesk.atlassian.net/browse/FLEXSIM-12843
Test Model - https://github.com/flexsim-adsk/modules-Testing/pull/26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an A* + “Travel to Home Location” infinite loop by adding a targeted workaround in Traveler::onArrival() to detect the home picklist pattern and, when A* reports “arrived” but the picklist still considers the operator too far, force a short final approach leg before completing the travel task.

Changes:

  • Detect the “travel home” picklist pattern (TASKTYPE_TRAVEL followed by TASKTYPE_DELAY(0)).
  • If still outside the picklist threshold on arrival, create and navigate a short “final leg” path to destLoc to break the re-dispatch loop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AStarDLL/Traveler.cpp
Comment thread AStarDLL/Traveler.cpp
Comment thread AStarDLL/Traveler.cpp
&& nextTask->var1 == 0.0;
if (isTravelHome) {
Vec3 teLoc = te->getLocation(0.5, 0.5, 0).project(te->holder->up, model());
double threshold = objectexists(gettenetnode(te->holder))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If picklist tolerance changes in FlexSim content files, A* corrective behavior can drift unless manually updated.
Please centralize threshold computation in one shared function used by both picklist generation/runtime and A* corrective logic.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also agreed the formula is duplicated from the picklist. Full centralization would need a shared FlexScript/C++ API and picklist changes, which is more than this bugfix should carry. Happy to open a follow-up for a shared threshold helper if you think that should be prioritized.

@Shivi-lab Shivi-lab closed this Jul 27, 2026
@Shivi-lab
Shivi-lab deleted the tiwairsh/FLEXSIM-12843-FLEXSIM-11184-Fix-Travel-Arrival-Mismatch-For-Home-Location branch July 27, 2026 06:07
@Shivi-lab
Shivi-lab restored the tiwairsh/FLEXSIM-12843-FLEXSIM-11184-Fix-Travel-Arrival-Mismatch-For-Home-Location branch July 27, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants