PDA

View Full Version : Set reset position


Martijn van Oostenbrugge
02-25-2008, 07:54 AM
I'm working on an object in which I can dynamically set the location of a network node. To test it, I made a simple example where I set the location on the OnReset Trigger of the Network Node. However, the 'modified' variable of the DefaultNetworkNavigator is not set to one and thus Dijkstra's algorithm is not re-evaluated to determine the shortest path. I've adjusted the OnReset (and toggled it as Flexscript) of the DefaultNetworkNavigator to always set this variable to one. So, it works, but still I have to reset twice to make sure the new location is used in the algorithm. Is there a better way to solve this?

Thanks,
Martijn

Paul Toone
02-25-2008, 10:48 AM
Martijn,

Call the optimizenetwork(); command from the OnRunStart trigger. (Tools | Model Triggers | On Run Start)

That will update the Dijkstra's algorithm and hopefully solve the issue you are having.

Thanks,

Paul