A* Pathfinding Project  3.1.4
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Enumerations Properties Groups Pages
AlternativePath Class Reference

Applies penalty to the paths it processes telling other units to avoid choosing the same path. More...

+ Inheritance diagram for AlternativePath:
+ Collaboration diagram for AlternativePath:

Public Member Functions

override void Apply (Path p, ModifierData source)
 Main Post-Processing function.
 
- Public Member Functions inherited from MonoModifier
virtual Vector3[] Apply (Node[] path, Vector3 start, Vector3 end, int startIndex, int endIndex, NavGraph graph)
 
virtual Vector3[] Apply (Vector3[] path, Vector3 start, Vector3 end)
 
virtual void ApplyOriginal (Path p)
 
void Awake ()
 Alerts the Seeker that this modifier exists.
 
void OnDestroy ()
 
void OnDisable ()
 
void OnEnable ()
 
virtual void PreProcess (Path p)
 
- Public Member Functions inherited from IPathModifier
void Apply (Path p, ModifierData source)
 
void ApplyOriginal (Path p)
 
void PreProcess (Path p)
 

Public Attributes

int penalty = 1000
 How much penalty (weight) to apply to nodes.
 
int randomStep = 10
 Max number of nodes to skip in a row.
 
- Public Attributes inherited from MonoModifier
int priority = 0
 Higher priority modifiers are executed first.
 
Seeker seeker
 

Properties

override ModifierData input [get]
 
override ModifierData output [get]
 
- Properties inherited from MonoModifier
abstract ModifierData input [get]
 
abstract ModifierData output [get]
 
int Priority [get, set]
 
- Properties inherited from IPathModifier
ModifierData input [get]
 
ModifierData output [get]
 
int Priority [get, set]
 

Private Member Functions

void ApplyNow (Path somePath)
 

Private Attributes

System.Object lockObject = new System.Object ()
 
Node[] prevNodes
 The previous path.
 
int prevPenalty = 0
 The previous penalty used.
 
int prevSeed
 Previous seed.
 
System.Random rnd = new System.Random ()
 A random object.
 
System.Random seedGenerator = new System.Random ()
 A random object generating random seeds for other random objects.
 
Node[] toBeApplied
 The nodes waiting to have their penalty changed.
 
bool waitingForApply = false
 

Detailed Description

Applies penalty to the paths it processes telling other units to avoid choosing the same path.

Member Data Documentation

int prevPenalty = 0
private

The previous penalty used.

Stored just in case it changes during operation

int prevSeed
private

Previous seed.

Used to figure out which nodes to revert penalty on without storing them in an array


The documentation for this class was generated from the following file: