astarsearch.cpp File Reference

#include "global.hpp"
#include "astarnode.hpp"
#include "log.hpp"
#include "pathfind.hpp"
#include "util.hpp"
#include <cassert>
#include <cmath>
#include <iostream>

Include dependency graph for astarsearch.cpp:

Go to the source code of this file.

Defines

#define LOG_PF   LOG_STREAM(info, engine)
#define DBG_PF   LOG_STREAM(debug, engine)

Typedefs

typedef std::vector
< gamemap::location
vector_location
typedef std::vector
< a_star_node * > 
vector_a_star_node
typedef std::set
< gamemap::location
set_location

Functions

static bool compare_lt_a_star_node (const a_star_node *node1, const a_star_node *node2)
static void a_star_init (gamemap::location const &src, gamemap::location const &dst, vector_a_star_node &openList, a_star_world &aStarGameWorld, const size_t parWidth, const size_t parHeight, vector_location &vectLocation, std::set< gamemap::location > const *teleports, size_t &parNbTeleport)
static void a_star_explore_neighbours (gamemap::location const &dst, const double stop_at, cost_calculator const *costCalculator, const size_t parWidth, const size_t parHeight, std::set< gamemap::location > const *teleports, vector_location &vectLocation, vector_a_star_node &openList, a_star_world &aStarGameWorld, a_star_node *parCurNode, const size_t parNbTeleport)
paths::route a_star_search (gamemap::location const &src, gamemap::location const &dst, double stop_at, cost_calculator const *costCalculator, const size_t parWidth, const size_t parHeight, std::set< gamemap::location > const *teleports)
static void get_tiles_radius_internal (const gamemap::location &a, size_t radius, std::set< gamemap::location > &res, std::map< gamemap::location, int > &visited)
void get_tiles_radius (const gamemap::location &a, size_t radius, std::set< gamemap::location > &res)
 Function which, given a location, will find all tiles within 'radius' of that tile.
void get_tiles_radius (gamemap const &map, std::vector< gamemap::location > const &locs, size_t radius, std::set< gamemap::location > &res, xy_pred *pred)
 Function which, given a set of locations, will find all tiles within 'radius' of those tiles.


Define Documentation

#define DBG_PF   LOG_STREAM(debug, engine)

Definition at line 28 of file astarsearch.cpp.

Referenced by a_star_search().

#define LOG_PF   LOG_STREAM(info, engine)

Definition at line 27 of file astarsearch.cpp.

Referenced by a_star_search().


Typedef Documentation

typedef std::set<gamemap::location> set_location

Definition at line 32 of file astarsearch.cpp.

typedef std::vector<a_star_node*> vector_a_star_node

Definition at line 31 of file astarsearch.cpp.

typedef std::vector<gamemap::location> vector_location

Definition at line 30 of file astarsearch.cpp.


Function Documentation

static void a_star_explore_neighbours ( gamemap::location const &  dst,
const double  stop_at,
cost_calculator const *  costCalculator,
const size_t  parWidth,
const size_t  parHeight,
std::set< gamemap::location > const *  teleports,
vector_location vectLocation,
vector_a_star_node openList,
a_star_world aStarGameWorld,
a_star_node parCurNode,
const size_t  parNbTeleport 
) [static]

static void a_star_init ( gamemap::location const &  src,
gamemap::location const &  dst,
vector_a_star_node openList,
a_star_world aStarGameWorld,
const size_t  parWidth,
const size_t  parHeight,
vector_location vectLocation,
std::set< gamemap::location > const *  teleports,
size_t &  parNbTeleport 
) [static]

paths::route a_star_search ( gamemap::location const &  src,
gamemap::location const &  dst,
double  stop_at,
cost_calculator const *  costCalculator,
const size_t  parWidth,
const size_t  parHeight,
std::set< gamemap::location > const *  teleports 
)

static bool compare_lt_a_star_node ( const a_star_node node1,
const a_star_node node2 
) [static]

Definition at line 36 of file astarsearch.cpp.

References a_star_node::g, and a_star_node::h.

Referenced by a_star_explore_neighbours(), and a_star_search().

void get_tiles_radius ( gamemap const &  map,
std::vector< gamemap::location > const &  locs,
size_t  radius,
std::set< gamemap::location > &  res,
xy_pred pred 
)

Function which, given a set of locations, will find all tiles within 'radius' of those tiles.

Definition at line 245 of file astarsearch.cpp.

References get_adjacent_tiles(), loc, and gamemap::on_board().

void get_tiles_radius ( const gamemap::location a,
size_t  radius,
std::set< gamemap::location > &  res 
)

Function which, given a location, will find all tiles within 'radius' of that tile.

Definition at line 238 of file astarsearch.cpp.

References get_tiles_radius_internal().

Referenced by terrain_filter::get_locations(), terrain_filter::match(), and place_village().

static void get_tiles_radius_internal ( const gamemap::location a,
size_t  radius,
std::set< gamemap::location > &  res,
std::map< gamemap::location, int > &  visited 
) [static]

Definition at line 219 of file astarsearch.cpp.

References get_adjacent_tiles().

Referenced by get_tiles_radius().


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs