A* Pathfinding Project  3.0.9
The A* Pathfinding Project for Unity
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:

List of all members.

Public Member Functions

override void Apply (Path p, ModifierData source)  Main Post-Processing function.

Public Variables

int penalty = 1000  How much penalty (weight) to apply to nodes.
int randomStep = 10  Max number of nodes to skip in a row.

Properties

override ModifierData input [get]  
override ModifierData output [get]  

Private Member Functions

void ApplyNow (Path somePath)  

Private Variables

Node[] prevNodes  The previous path.
int prevSeed  Previous seed.
int prevPenalty = 0  The previous penalty used.
bool waitingForApply = false  
System.Object lockObject = new System.Object ()  
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.

Detailed Description

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


Member Function Documentation

override void Apply ( Path  p,
ModifierData  source 
) [virtual]

Main Post-Processing function.

Implements MonoModifier.


Member Data Documentation

int penalty = 1000

How much penalty (weight) to apply to nodes.

Node [] prevNodes [private]

The previous path.

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

int randomStep = 10

Max number of nodes to skip in a row.

System.Random rnd = new System.Random () [private]

A random object.

System.Random seedGenerator = new System.Random () [private]

A random object generating random seeds for other random objects.

Node [] toBeApplied [private]

The nodes waiting to have their penalty changed.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations Properties