BWAPI
Static Public Member Functions
PFFunctions Class Reference

#include <PFFunctions.h>

List of all members.

Static Public Member Functions

static float getDistance (Position p1, Position p2)
static float getDistance (Position pos, Unit *unit)
static float calcOwnUnitP (float d, Unit *unit, Unit *otherOwnUnit)
static float calcAvoidWorkerP (float d, BaseAgent *unit, BaseAgent *oUnit)
static float calcMineP (float d, Unit *unit)
static float calcOwnUnitMedicP (float d, Unit *unit, Unit *otherOwnUnit)
static float calcNavigationP (float d)
static float getNavigationP (Position cPos, Position goal)
static float calcAttackingUnitP (float d, Unit *attacker, Unit *enemy, bool defensive)
static float calcDefensiveUnitP (float d, Unit *ownUnit, Unit *enemy)
static bool canAttack (Unit *ownUnit, Unit *target)

Detailed Description

Helper class for the PFManager. Contains methods to calculate the potentials generated by own units, enemy units and neutral objects in specific points.

Author: Johan Hagelback (johan.hagelback@gmail.com)


Member Function Documentation

float PFFunctions::calcAttackingUnitP ( float  d,
Unit attacker,
Unit enemy,
bool  defensive 
) [static]

Calculates the potential an attacking unit generates at distance d around an enemy unit.

Here is the call graph for this function:

float PFFunctions::calcAvoidWorkerP ( float  d,
BaseAgent unit,
BaseAgent oUnit 
) [static]

Calculates the potential own workers generate around themselves. Used to avoid collision at chokepoints.

Here is the call graph for this function:

float PFFunctions::calcDefensiveUnitP ( float  d,
Unit ownUnit,
Unit enemy 
) [static]

Calculates the potential a defensive unit generates at distance d around an enemy unit.

Here is the call graph for this function:

float PFFunctions::calcMineP ( float  d,
Unit unit 
) [static]

Calculates the potential a Spider Mine generates around unit at distance d.

Here is the call graph for this function:

float PFFunctions::calcNavigationP ( float  d) [static]

Calculates the general potential field value at distance d used when moving towards a point.

Here is the caller graph for this function:

float PFFunctions::calcOwnUnitMedicP ( float  d,
Unit unit,
Unit otherOwnUnit 
) [static]

Calculates the potential a Medic unit generates around otherOwnUnit at distance d.

Here is the call graph for this function:

float PFFunctions::calcOwnUnitP ( float  d,
Unit unit,
Unit otherOwnUnit 
) [static]

Calculates the potential otherOwnUnit generates around unit at distance d.

Here is the call graph for this function:

bool PFFunctions::canAttack ( Unit ownUnit,
Unit target 
) [static]

Returns true if the own unit can attack the target.

Here is the call graph for this function:

Here is the caller graph for this function:

float PFFunctions::getDistance ( Position  p1,
Position  p2 
) [static]

Returns the distance between two positions.

Here is the call graph for this function:

Here is the caller graph for this function:

float PFFunctions::getDistance ( Position  pos,
Unit unit 
) [static]

Returns the distance between a unit and a position.

Here is the call graph for this function:

float PFFunctions::getNavigationP ( Position  cPos,
Position  goal 
) [static]

Returns the total potential for navigating from cPos to goal.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines