In script evaluators how element variables work?
The following Element Variables are available:
Does "fromEdge" mean the previous edge and "toEdge" the next edge? Is there any documentation for Element Functions such as ToAzimuth, FromPositin, PositionAlongObject etc?
The network element script evaluators are based on the ArcObjects API. To explain some of the sections of the dialog in your screenshot:
I hope this was helpful.
Than you very much for your reply. I m trying to promote straight lines in my solver. Each street segment has a NON UNIQUE FID value. ie Richmond Avenue's street segments have FID value = 12345. Is it possible to write a script based on the following pseudocode?
a=fromEdge.AttributeValuebyName("FID")
b=toEdge.AttributeValuebyName("FID")
If a=b then dont turn
And what type of element should i use for that, turn or edge?And last but not least the edges and the junctions are evaluated based on what value(time, length)?
If I understand correctly, you would like to discourage turns where possible. I don't think what you are proposing would work with the script evaluator.
I think some functionality that might do what you want is the Global Turn Delay Evaluator. The purpose of that evaluator is to discourage turns by applying a cost penalty that makes turning more expensive. That might be your answer.
To take a step back, though, why do you want to discourage turns? Is the vehicle that is travelling too big to make many turns? If that is the case, the Global Turn Delay Evaluator seems correct.
Or are you getting routes that leave major roads and stair-steps through communities? In this case, the best answer is probably to adjust the travel times along the roads that you prefer.