Defines the simulation. More...
Public Member Functions | |
int | addAgent (Vector2 position) |
Adds a new agent with default properties to the simulation. More... | |
int | addAgent (Vector2 position, float neighborDist, int maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, Vector2 velocity) |
Adds a new agent to the simulation. More... | |
int | addObstacle (IList< Vector2 > vertices) |
Adds a new obstacle to the simulation. More... | |
void | Clear () |
Clears the simulation. More... | |
float | doStep () |
Performs a simulation step and updates the two-dimensional position and two-dimensional velocity of each agent. More... | |
int | getAgentAgentNeighbor (int agentNo, int neighborNo) |
Returns the specified agent neighbor of the specified agent. More... | |
int | getAgentMaxNeighbors (int agentNo) |
Returns the maximum neighbor count of a specified agent. More... | |
float | getAgentMaxSpeed (int agentNo) |
Returns the maximum speed of a specified agent. More... | |
float | getAgentNeighborDist (int agentNo) |
Returns the maximum neighbor distance of a specified agent. More... | |
int | getAgentNumAgentNeighbors (int agentNo) |
Returns the count of agent neighbors taken into account to compute the current velocity for the specified agent. More... | |
int | getAgentNumObstacleNeighbors (int agentNo) |
Returns the count of obstacle neighbors taken into account to compute the current velocity for the specified agent. More... | |
int | getAgentObstacleNeighbor (int agentNo, int neighborNo) |
Returns the specified obstacle neighbor of the specified agent. More... | |
IList< Line > | getAgentOrcaLines (int agentNo) |
Returns the ORCA constraints of the specified agent. More... | |
Vector2 | getAgentPosition (int agentNo) |
Returns the two-dimensional position of a specified agent. More... | |
Vector2 | getAgentPrefVelocity (int agentNo) |
Returns the two-dimensional preferred velocity of a specified agent. More... | |
float | getAgentRadius (int agentNo) |
Returns the radius of a specified agent. More... | |
float | getAgentTimeHorizon (int agentNo) |
Returns the time horizon of a specified agent. More... | |
float | getAgentTimeHorizonObst (int agentNo) |
Returns the time horizon with respect to obstacles of a specified agent. More... | |
Vector2 | getAgentVelocity (int agentNo) |
Returns the two-dimensional linear velocity of a specified agent. More... | |
float | getGlobalTime () |
Returns the global time of the simulation. More... | |
int | getNumAgents () |
Returns the count of agents in the simulation. More... | |
int | getNumObstacleVertices () |
Returns the count of obstacle vertices in the simulation. More... | |
int | GetNumWorkers () |
Returns the count of workers. More... | |
Vector2 | getObstacleVertex (int vertexNo) |
Returns the two-dimensional position of a specified obstacle vertex. More... | |
int | getNextObstacleVertexNo (int vertexNo) |
Returns the number of the obstacle vertex succeeding the specified obstacle vertex in its polygon. More... | |
int | getPrevObstacleVertexNo (int vertexNo) |
Returns the number of the obstacle vertex preceding the specified obstacle vertex in its polygon. More... | |
float | getTimeStep () |
Returns the time step of the simulation. More... | |
void | processObstacles () |
Processes the obstacles that have been added so that they are accounted for in the simulation. More... | |
bool | queryVisibility (Vector2 point1, Vector2 point2, float radius) |
Performs a visibility query between the two specified points with respect to the obstacles. More... | |
void | setAgentDefaults (float neighborDist, int maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, Vector2 velocity) |
Sets the default properties for any new agent that is added. More... | |
void | setAgentMaxNeighbors (int agentNo, int maxNeighbors) |
Sets the maximum neighbor count of a specified agent. More... | |
void | setAgentMaxSpeed (int agentNo, float maxSpeed) |
Sets the maximum speed of a specified agent. More... | |
void | setAgentNeighborDist (int agentNo, float neighborDist) |
Sets the maximum neighbor distance of a specified agent. More... | |
void | setAgentPosition (int agentNo, Vector2 position) |
Sets the two-dimensional position of a specified agent. More... | |
void | setAgentPrefVelocity (int agentNo, Vector2 prefVelocity) |
Sets the two-dimensional preferred velocity of a specified agent. More... | |
void | setAgentRadius (int agentNo, float radius) |
Sets the radius of a specified agent. More... | |
void | setAgentTimeHorizon (int agentNo, float timeHorizon) |
Sets the time horizon of a specified agent with respect to other agents. More... | |
void | setAgentTimeHorizonObst (int agentNo, float timeHorizonObst) |
Sets the time horizon of a specified agent with respect to obstacles. More... | |
void | setAgentVelocity (int agentNo, Vector2 velocity) |
Sets the two-dimensional linear velocity of a specified agent. More... | |
void | setGlobalTime (float globalTime) |
Sets the global time of the simulation. More... | |
void | SetNumWorkers (int numWorkers) |
Sets the number of workers. More... | |
void | setTimeStep (float timeStep) |
Sets the time step of the simulation. More... | |
Properties | |
static Simulator | Instance [get] |
Defines the simulation.
|
inline |
Adds a new agent with default properties to the simulation.
position | The two-dimensional starting position of this agent. |
|
inline |
Adds a new agent to the simulation.
position | The two-dimensional starting position of this agent. |
neighborDist | The maximum distance (center point to center point) to other agents this agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe. Must be non-negative. |
maxNeighbors | The maximum number of other agents this agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe. |
timeHorizon | The minimal amount of time for which this agent's velocities that are computed by the simulation are safe with respect to other agents. The larger this number, the sooner this agent will respond to the presence of other agents, but the less freedom this agent has in choosing its velocities. Must be positive. |
timeHorizonObst | The minimal amount of time for which this agent's velocities that are computed by the simulation are safe with respect to obstacles. The larger this number, the sooner this agent will respond to the presence of obstacles, but the less freedom this agent has in choosing its velocities. Must be positive. |
radius | The radius of this agent. Must be non-negative. |
maxSpeed | The maximum speed of this agent. Must be non-negative. |
velocity | The initial two-dimensional linear velocity of this agent. |
|
inline |
Adds a new obstacle to the simulation.
vertices | List of the vertices of the polygonal obstacle in counterclockwise order. |
To add a "negative" obstacle, e.g. a bounding polygon around the environment, the vertices should be listed in clockwise order.
|
inline |
Clears the simulation.
|
inline |
Performs a simulation step and updates the two-dimensional position and two-dimensional velocity of each agent.
|
inline |
Returns the specified agent neighbor of the specified agent.
agentNo | The number of the agent whose agent neighbor is to be retrieved. |
neighborNo | The number of the agent neighbor to be retrieved. |
|
inline |
Returns the maximum neighbor count of a specified agent.
agentNo | The number of the agent whose maximum neighbor count is to be retrieved. |
|
inline |
Returns the maximum speed of a specified agent.
agentNo | The number of the agent whose maximum speed is to be retrieved. |
|
inline |
Returns the maximum neighbor distance of a specified agent.
agentNo | The number of the agent whose maximum neighbor distance is to be retrieved. |
|
inline |
Returns the count of agent neighbors taken into account to compute the current velocity for the specified agent.
agentNo | The number of the agent whose count of agent neighbors is to be retrieved. |
|
inline |
Returns the count of obstacle neighbors taken into account to compute the current velocity for the specified agent.
agentNo | The number of the agent whose count of obstacle neighbors is to be retrieved. |
|
inline |
Returns the specified obstacle neighbor of the specified agent.
agentNo | The number of the agent whose obstacle neighbor is to be retrieved. |
neighborNo | The number of the obstacle neighbor to be retrieved. |
|
inline |
Returns the ORCA constraints of the specified agent.
agentNo | The number of the agent whose ORCA constraints are to be retrieved. |
The halfplane to the left of each line is the region of permissible velocities with respect to that ORCA constraint.
|
inline |
Returns the two-dimensional position of a specified agent.
agentNo | The number of the agent whose two-dimensional position is to be retrieved. |
|
inline |
Returns the two-dimensional preferred velocity of a specified agent.
agentNo | The number of the agent whose two-dimensional preferred velocity is to be retrieved. |
|
inline |
Returns the radius of a specified agent.
agentNo | The number of the agent whose radius is to be retrieved. |
|
inline |
Returns the time horizon of a specified agent.
agentNo | The number of the agent whose time horizon is to be retrieved. |
|
inline |
Returns the time horizon with respect to obstacles of a specified agent.
agentNo | The number of the agent whose time horizon with respect to obstacles is to be retrieved. |
|
inline |
Returns the two-dimensional linear velocity of a specified agent.
agentNo | The number of the agent whose two-dimensional linear velocity is to be retrieved. |
|
inline |
Returns the global time of the simulation.
|
inline |
Returns the number of the obstacle vertex succeeding the specified obstacle vertex in its polygon.
vertexNo | The number of the obstacle vertex whose successor is to be retrieved. |
|
inline |
Returns the count of agents in the simulation.
|
inline |
Returns the count of obstacle vertices in the simulation.
|
inline |
Returns the count of workers.
|
inline |
Returns the two-dimensional position of a specified obstacle vertex.
vertexNo | The number of the obstacle vertex to be retrieved. |
|
inline |
Returns the number of the obstacle vertex preceding the specified obstacle vertex in its polygon.
vertexNo | The number of the obstacle vertex whose predecessor is to be retrieved. |
|
inline |
Returns the time step of the simulation.
|
inline |
Processes the obstacles that have been added so that they are accounted for in the simulation.
Obstacles added to the simulation after this function has been called are not accounted for in the simulation.
Performs a visibility query between the two specified points with respect to the obstacles.
point1 | The first point of the query. |
point2 | The second point of the query. |
radius | The minimal distance between the line connecting the two points and the obstacles in order for the points to be mutually visible (optional). Must be non-negative. |
|
inline |
Sets the default properties for any new agent that is added.
neighborDist | The default maximum distance (center point to center point) to other agents a new agent takes into account in the navigation. The larger this number, the longer he running time of the simulation. If the number is too low, the simulation will not be safe. Must be non-negative. |
maxNeighbors | The default maximum number of other agents a new agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe. |
timeHorizon | The default minimal amount of time for which a new agent's velocities that are computed by the simulation are safe with respect to other agents. The larger this number, the sooner an agent will respond to the presence of other agents, but the less freedom the agent has in choosing its velocities. Must be positive. |
timeHorizonObst | The default minimal amount of time for which a new agent's velocities that are computed by the simulation are safe with respect to obstacles. The larger this number, the sooner an agent will respond to the presence of obstacles, but the less freedom the agent has in choosing its velocities. Must be positive. |
radius | The default radius of a new agent. Must be non-negative. |
maxSpeed | The default maximum speed of a new agent. Must be non-negative. |
velocity | The default initial two-dimensional linear velocity of a new agent. |
|
inline |
Sets the maximum neighbor count of a specified agent.
agentNo | The number of the agent whose maximum neighbor count is to be modified. |
maxNeighbors | The replacement maximum neighbor count. |
|
inline |
Sets the maximum speed of a specified agent.
agentNo | The number of the agent whose maximum speed is to be modified. |
maxSpeed | The replacement maximum speed. Must be non-negative. |
|
inline |
Sets the maximum neighbor distance of a specified agent.
agentNo | The number of the agent whose maximum neighbor distance is to be modified. |
neighborDist | The replacement maximum neighbor distance. Must be non-negative. |
|
inline |
Sets the two-dimensional position of a specified agent.
agentNo | The number of the agent whose two-dimensional position is to be modified. |
position | The replacement of the two-dimensional position. |
|
inline |
Sets the two-dimensional preferred velocity of a specified agent.
agentNo | The number of the agent whose two-dimensional preferred velocity is to be modified. |
prefVelocity | The replacement of the two-dimensional preferred velocity. |
|
inline |
Sets the radius of a specified agent.
agentNo | The number of the agent whose radius is to be modified. |
radius | The replacement radius. Must be non-negative. |
|
inline |
Sets the time horizon of a specified agent with respect to other agents.
agentNo | The number of the agent whose time horizon is to be modified. |
timeHorizon | The replacement time horizon with respect to other agents. Must be positive. |
|
inline |
Sets the time horizon of a specified agent with respect to obstacles.
agentNo | The number of the agent whose time horizon with respect to obstacles is to be modified. |
timeHorizonObst | The replacement time horizon with respect to obstacles. Must be positive. |
|
inline |
Sets the two-dimensional linear velocity of a specified agent.
agentNo | The number of the agent whose two-dimensional linear velocity is to be modified. |
velocity | The replacement two-dimensional linear velocity. |
|
inline |
Sets the global time of the simulation.
globalTime | The global time of the simulation. |
|
inline |
Sets the number of workers.
numWorkers | The number of workers. |
|
inline |
Sets the time step of the simulation.
timeStep | The time step of the simulation. Must be positive. |