vsTASKER 7 User Manual
×
Menu
Index

Cost Function

 
Cost Function
1

User code

1. User code

This function is used to return the cost for selecting a specific strip lane.
The RoadData structure given to the function can be seen at /include/engine/vt_roads.h
 
This function shall return any arbitrary value, according to any kind of conditions extracted from the strip of any other data structure.
What is important is not the value itself but its ranking regarding the other node values for one road search (per entity).
The function must return the cost for using the lane n to be used by the Dijkstra algorithm.
The lower the value, the more chance to be selected by the road finding algorithm. The higher the value, the more chance to be rejected.