Difference between revisions of "LavishNav:lnavpathfinder (Object Type)"

From Lavish Software Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Description ==
 
== Description ==
 +
{{ObjectType-Vitals|lnavpathfinder|[[LavishNav]]|none|NULL|
 +
; See
 +
* [[LavishNav:dijkstrapathfinder (Object Type)|dijkstrapathfinder]]
 +
* [[LavishNav:astarpathfinder (Object Type)|astarpathfinder]]|no|LNavPathfinder *}}
  
 
== Members ==
 
== Members ==
*[[ObjectType:string|string]] '''Type''':
+
*[[ObjectType:string|string]] '''Type''': Type of pathfinder (Dijkstra or AStar)
*[[ObjectType:float|float]] '''Distance['''region id''']''':
+
*[[ObjectType:float|float]] '''Distance['''from region search''','''to region search''']''': Distance from one region to another (see the pathfinder types for efficiency notes on distance)
*... LastStart:
+
*... '''LastStart''': Last <tt>from</tt> region used
*... LastGoal:
+
*... '''LastGoal''': Last <tt>to</tt> region used
 +
*... '''NearestConnectedRegion['''from region search''','''to X''','''to Y''','''to Z''']''': Nearest connected region to the given (to) X,Y,Z
 +
*... '''NearestConnectedRegion['''from region search''','''to X''','''to Y''','''to Z''','''[[LavishNav:lnavpath (Object Type)|lnavpath]] object''']''': Nearest connected region to the given (to) X,Y,Z. Additionally appends the given lnavpath object with the shortest path to the returned region.
 +
*... '''NearestConnectedRegion['''from region search''','''to X''','''to Y''','''to Z''','''[[LavishNav:lnavpath (Object Type)|lnavpath]] object''','''maximum cost''']''': Nearest connected region to the given (to) X,Y,Z, bound by a maximum cost. Additionally appends the given lnavpath object with the shortest path to the returned region.
  
 
== Methods ==
 
== Methods ==
*'''SelectPath['''from region id''','''to region id''']''':
+
*'''SelectPath['''from region search''','''to region search''','''[[LavishNav:lnavpath (Object Type)|lnavpath]] object''']''': Selects a path, if any, from one region to another, appending the given lnavpath object with the result.  Note that the first hop of the selected path will be the start region, and there will be no connection
*'''Reset''':
+
*'''SelectPath['''from region search''','''to region search''','''[[LavishNav:lnavpath (Object Type)|lnavpath]] object''','''maximum cost cost''']''': Selects a path, if any, from one region to another, bound by a maximum cost, appending the given lnavpath object with the result.  Note that the first hop of the selected path will be the start region, and there will be no connection
 +
*'''Reset''': Resets the current pathfinding data.  Note that the pathfinder is automatically reset when necessary, you do not generally need to use this method.
  
== Inherits ==
+
== Maximum Cost behavior ==
''none''
+
Maximum cost ensures that the calculated shortest path to the goal falls within the given maximum travel cost from the origin. In other words, any connection with a total cost heuristic greater than the maximum cost is ignored. For Dijkstra pathfinders, the total cost heuristic means only the distance from the origin. For A* pathfinders, the total cost heuristic means the distance from the origin, plus the distance to the goal -- in LavishNav A*, the distance to the goal is calculated by the length of a line segment from the X,Y,Z in question to the goal X,Y,Z (as opposed to e.g. the Manhattan style of distance to goal heuristic).
 
 
== Returns ==
 
''NULL''
 
 
 
== Creating Variables ==
 
See dijkstrapathfinder and astarpathfinder object types
 
  
 
== Examples ==
 
== Examples ==

Latest revision as of 14:19, 17 January 2008

Description

Object Type Vitals
lnavpathfinder
Defined By LavishNav
Inherits none
Reduces To NULL
Variable Object Type
See
Uses Sub-Types no
C/C++ Type LNavPathfinder *

Members

  • string Type: Type of pathfinder (Dijkstra or AStar)
  • float Distance[from region search,to region search]: Distance from one region to another (see the pathfinder types for efficiency notes on distance)
  • ... LastStart: Last from region used
  • ... LastGoal: Last to region used
  • ... NearestConnectedRegion[from region search,to X,to Y,to Z]: Nearest connected region to the given (to) X,Y,Z
  • ... NearestConnectedRegion[from region search,to X,to Y,to Z,lnavpath object]: Nearest connected region to the given (to) X,Y,Z. Additionally appends the given lnavpath object with the shortest path to the returned region.
  • ... NearestConnectedRegion[from region search,to X,to Y,to Z,lnavpath object,maximum cost]: Nearest connected region to the given (to) X,Y,Z, bound by a maximum cost. Additionally appends the given lnavpath object with the shortest path to the returned region.

Methods

  • SelectPath[from region search,to region search,lnavpath object]: Selects a path, if any, from one region to another, appending the given lnavpath object with the result. Note that the first hop of the selected path will be the start region, and there will be no connection
  • SelectPath[from region search,to region search,lnavpath object,maximum cost cost]: Selects a path, if any, from one region to another, bound by a maximum cost, appending the given lnavpath object with the result. Note that the first hop of the selected path will be the start region, and there will be no connection
  • Reset: Resets the current pathfinding data. Note that the pathfinder is automatically reset when necessary, you do not generally need to use this method.

Maximum Cost behavior

Maximum cost ensures that the calculated shortest path to the goal falls within the given maximum travel cost from the origin. In other words, any connection with a total cost heuristic greater than the maximum cost is ignored. For Dijkstra pathfinders, the total cost heuristic means only the distance from the origin. For A* pathfinders, the total cost heuristic means the distance from the origin, plus the distance to the goal -- in LavishNav A*, the distance to the goal is calculated by the length of a line segment from the X,Y,Z in question to the goal X,Y,Z (as opposed to e.g. the Manhattan style of distance to goal heuristic).

Examples

See Also