|
A* Pathfinding Project
3.0.9
The A* Pathfinding Project for Unity
|
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:| override void | Apply (Path p, ModifierData source) | Main Post-Processing function. |
| int | penalty = 1000 | How much penalty (weight) to apply to nodes. | |
| int | randomStep = 10 | Max number of nodes to skip in a row. |
| override ModifierData | input [get] |
||
| override ModifierData | output [get] |
| void | ApplyNow (Path somePath) |
| 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. |
Applies penalty to the paths it processes telling other units to avoid choosing the same path.
Main Post-Processing function.
Implements MonoModifier.
| int penalty = 1000 |
How much penalty (weight) to apply to nodes.
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.