44 | | During the simulation each agent receives target coordinates (see [wiki:/doc/app/agtpar#at_x at_x] and [wiki:/doc/app/agtpar#at_y at_y]). Each agent must then find a path from its current position to its target using the visibility graph. This is accomplished using the '''A^*^(A-star)-algorithm''' which is a well-known fast pathfinding algorithm (click [#http://theory.stanford.edu/~amitp/GameProgramming/ here] for a thorough explanation). |
| 44 | During the simulation each agent receives target coordinates (see [wiki:/doc/app/agtpar#at_x at_x] and [wiki:/doc/app/agtpar#at_y at_y]). Each agent must then find a path from its current position to its target using the visibility graph. This is accomplished using the '''A^*^(A-star)-algorithm''' which is a well-known fast pathfinding algorithm (click [#http://theory.stanford.edu/~amitp/GameProgramming/ here] for a thorough explanation). For this, \\ |
| 45 | * the agent's current position and its target are added to the visibility graph, \\ |
| 46 | * the shortest path between these two points is calculated, \\ |
| 47 | * the navigation points are shifted outward from the obstacle corner to a random position along a "gate" (see [wiki:/doc/app/agtpar#corner_gate_start corner_gate_start] and [wiki:/doc/app/agtpar#corner_gate_width corner_gate_width]) to avoid collisions with obstacles or other agents,\\ |
| 48 | * pathfinding is run again with each successive pair of navigation points along the path to avoid intersection of path sections with obstacles resulting from the outward shift,\\ |
| 49 | * finally, the resulting path is stored in the agent object as a series of intermittent targets.\\ |
| 50 | Each agent calculates the direction toward its next intermittet target during each agent time step. It will accelerate toward those coordinates. Once the agent has come close enough ([wiki:/doc/app/agtpar#dist_to_int_target dist_to_int_target]) to them, the next intermittent target is chosen. When the final target is reached, the agent is deleted.\\\\ |
| 51 | '''Recalculation''' of an agent's path occurs when\\ |
| 52 | * the agent has deviated too far ([wiki:/doc/app/agtpar#max_dist_from_path max_dist_from_path]) from its current path or |
| 53 | * the path counter has reached its maximum and the target is not yet reached. This can occur because for the purpose of conservation of memory each agent can store a maximum of 15 intermittent targets. |
| 54 | |
| 55 | While pathfinding is run on the visibility graph, |
125 | | * [=#hershberger1994] '''Hershberger J, Snoeyink J''' 1994. An O(''n''log''n'') implementation of the Douglas-Peucker algorithm for line simplification. SCG '94 Proceedings of the tenth annual symposium on Computational geometry. 383-384. [https://doi.org/10.1145/177424.178097 doi] |
126 | | * [=#detering1985] '''Detering HW, Etling D.''' 1985. Application of the ''E''-''ε'' turbulence model to the atmospheric boundary layer. Bound.-Lay. Meteorol. 33: 113–133. |
| 136 | * [=#helbig1995] '''Helbing, D., Molnar, P.''' (1995). Social force model for pedestrian dynamics. Physical review E, 51(5), 4282. [https://doi.org/10.1103/PhysRevE.51.4282 doi] |
| 137 | * [=#hershberger1994] '''Hershberger, J., Snoeyink, J.''' 1994. An O(''n''log''n'') implementation of the Douglas-Peucker algorithm for line simplification. SCG '94 Proceedings of the tenth annual symposium on Computational geometry. 383-384. [https://doi.org/10.1145/177424.178097 doi] |