Public Member Functions |
function | GetAuthor () |
function | GetName () |
function | GetShortName () |
function | GetDescription () |
function | GetVersion () |
function | GetDate () |
function | CreateInstance () |
function | GetCategory () |
function | InitializePath (sources, goals) |
| Initialize a path search between sources and goals.
|
function | FindPath (iterations) |
| Try to find the path as indicated with InitializePath with the lowest cost.
|
function | _GetBridgeNumSlopes (end_a, end_b) |
function | _Cost (self, path, new_tile, new_direction) |
function | _Estimate (self, cur_tile, cur_direction, goal_tiles) |
function | _Neighbours (self, path, cur_node) |
function | _CheckDirection (self, tile, existing_direction, new_direction) |
function | _GetDirection (from, to, is_bridge) |
function | _GetTunnelsBridges (last_node, cur_node, bridge_dir) |
| Get a list of all bridges and tunnels that can be build from the current tile.
|
function | _IsSlopedRoad (start, middle, end) |
function | _CheckTunnelBridge (current_tile, new_tile) |
Public Attributes |
| _aystar_class = "graph.aystar" |
| _max_cost = null |
| The maximum cost for a route.
|
| _cost_tile = null |
| The cost for a single tile.
|
| _cost_no_existing_road = null |
| The cost that is added to _cost_tile if no road exists yet.
|
| _cost_turn = null |
| The cost that is added to _cost_tile if the direction changes.
|
| _cost_slope = null |
| The extra cost if a road tile is sloped.
|
| _cost_bridge_per_tile = null |
| The cost per tile of a new bridge, this is added to _cost_tile.
|
| _cost_tunnel_per_tile = null |
| The cost per tile of a new tunnel, this is added to _cost_tile.
|
| _cost_coast = null |
| The extra cost for a coast tile.
|
| _pathfinder = null |
| A reference to the used AyStar object.
|
| _max_bridge_length = null |
| The maximum length of a bridge that will be build.
|
| _max_tunnel_length = null |
| The maximum length of a tunnel that will be build.
|
| cost = null |
| Used to change the costs.
|
| _running = null |
A Road Pathfinder.
This road pathfinder tries to find a buildable / existing route for road vehicles. You can changes the costs below using for example roadpf.cost.turn = 30. Note that it's not allowed to change the cost between consecutive calls to FindPath. You can change the cost before the first call to FindPath and after FindPath has returned an actual route. To use only existing roads, set cost.no_existing_road to cost.max_cost.