Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The K-Nearest query class. More...
#include <KNearestQuery.h>
Public Member Functions | |
KNearestQuery () | |
default Constructor. | |
void | filterAgent (const BaseAgent *agent, float distSq) |
filters an agent and determines if it is within the set of k-nearest neighbors More... | |
void | filterObstacle (const Obstacle *obstacle, float distSq) |
filters an obstacle and determines if it is within the set of k-nearest neighbors More... | |
void | setMaxAgentResults (size_t results) |
sets the max number of agent results for this query to store More... | |
void | setMaxObstacleResults (size_t results) |
sets the max number of obstacle results for this query to store More... | |
void | setQueryPoint (Vector2 point) |
sets the query point More... | |
void | setQueryRangeSq (float range) |
sets the query point More... | |
size_t | maxAgentResults () |
gets the max number of agent results for this query to store More... | |
size_t | maxObstacleResults () |
gets the max number of obstacle results for this query to store More... | |
size_t | agentResultCount () |
gets the number of agent results stored currently More... | |
size_t | obstacleResultCount () |
gets the number of obstacle results stored currently More... | |
void | startQuery () |
clears the result vectors. Resets the query | |
virtual Vector2 | getQueryPoint () |
gets the start point for the query More... | |
NearAgent | getAgentResult (size_t i) |
gets the ith agent result More... | |
NearObstacle | getObstacleResult (size_t i) |
gets the ith obstacle result More... | |
virtual float | getMaxAgentRange () |
updates the max agent query range if conditions inside the query are met typically, we don't shrink the query range until the result set is full More... | |
virtual float | getMaxObstacleRange () |
updates the max query obstacle range if conditions inside the query are met typically, we don't shrink the query range until the result set is full More... | |
Public Member Functions inherited from Menge::Agents::ProximityQuery | |
ProximityQuery () | |
default Constructor. | |
Protected Attributes | |
size_t | _maxAgentResults |
the max number of agent results to store | |
size_t | _maxObstacleResults |
the max number of obstacle results to store | |
float | _maxAgentResultDistance |
the max distance to an agent result. Useful for informing the spatial query to stop searching further | |
float | _maxObstacleResultDistance |
the max distance to an obstacle result. Useful for informing the spatial query to stop searching further | |
std::vector< NearAgent > | _agentResults |
vector of pairs. Each pair contains a distance to an agent, and the agent | |
std::vector< NearObstacle > | _obstacleResults |
vector of pairs. Each pair contains a distance to an obstacle, and the obstacle | |
Vector2 | _queryPoint |
the start point for the query | |
float | _initialRange |
the base max range of queries | |
Additional Inherited Members | |
Protected Member Functions inherited from Menge::Agents::ProximityQuery | |
virtual | ~ProximityQuery () |
Virtual destructor. | |
The K-Nearest query class.
A spatial query which returns the k nearest agents and obstacles in the spatial query The query doesn't know where the point it, it is given distances in this case, K is set to the maxAgentResults and maxObstacleResults
|
inline |
gets the number of agent results stored currently
|
virtual |
filters an agent and determines if it is within the set of k-nearest neighbors
agent | the agent to consider |
distSq | the distance to the agent |
Implements Menge::Agents::ProximityQuery.
|
virtual |
filters an obstacle and determines if it is within the set of k-nearest neighbors
obstacle | the obstacle to consider |
distSq | the distance to the obstacle |
Implements Menge::Agents::ProximityQuery.
|
inline |
gets the ith agent result
i | the index of the agent to get |
|
virtual |
updates the max agent query range if conditions inside the query are met typically, we don't shrink the query range until the result set is full
Implements Menge::Agents::ProximityQuery.
|
inlinevirtual |
updates the max query obstacle range if conditions inside the query are met typically, we don't shrink the query range until the result set is full
Implements Menge::Agents::ProximityQuery.
|
inline |
gets the ith obstacle result
i | the index of the obstacle to get |
|
inlinevirtual |
gets the start point for the query
Implements Menge::Agents::ProximityQuery.
|
inline |
gets the max number of agent results for this query to store
|
inline |
gets the max number of obstacle results for this query to store
|
inline |
gets the number of obstacle results stored currently
|
inline |
sets the max number of agent results for this query to store
results | the number of agent results to store |
|
inline |
sets the max number of obstacle results for this query to store
results | the number of obstacle results to store |
|
inline |
sets the query point
point | the query point to be stored |
|
inline |
sets the query point
range | the squared range to search for nearby candidates |