C# 클래스 RVO.Simulator

Defines the simulation.
파일 보기 프로젝트 열기: snape/RVO2-CS 1 사용 예제들

공개 메소드들

메소드 설명
Clear ( ) : void

Clears the simulation.

GetNumWorkers ( ) : int

Returns the count of workers.

SetNumWorkers ( int numWorkers ) : void

Sets the number of workers.

addAgent ( Vector2 position ) : int

Adds a new agent with default properties to the simulation. *

addAgent ( Vector2 position, float neighborDist, int maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, Vector2 velocity ) : int

Adds a new agent to the simulation.

addObstacle ( IList vertices ) : int

Adds a new obstacle to the simulation.

To add a "negative" obstacle, e.g. a bounding polygon around * the environment, the vertices should be listed in clockwise order. *

doStep ( ) : float

Performs a simulation step and updates the two-dimensional * position and two-dimensional velocity of each agent.

getAgentAgentNeighbor ( int agentNo, int neighborNo ) : int

Returns the specified agent neighbor of the specified agent. *

getAgentMaxNeighbors ( int agentNo ) : int

Returns the maximum neighbor count of a specified agent. *

getAgentMaxSpeed ( int agentNo ) : float

Returns the maximum speed of a specified agent.

getAgentNeighborDist ( int agentNo ) : float

Returns the maximum neighbor distance of a specified agent. *

getAgentNumAgentNeighbors ( int agentNo ) : int

Returns the count of agent neighbors taken into account to * compute the current velocity for the specified agent.

getAgentNumObstacleNeighbors ( int agentNo ) : int

Returns the count of obstacle neighbors taken into account * to compute the current velocity for the specified agent.

getAgentObstacleNeighbor ( int agentNo, int neighborNo ) : int

Returns the specified obstacle neighbor of the specified * agent.

getAgentOrcaLines ( int agentNo ) : IList

Returns the ORCA constraints of the specified agent. *

The halfplane to the left of each line is the region of * permissible velocities with respect to that ORCA constraint. *

getAgentPosition ( int agentNo ) : Vector2

Returns the two-dimensional position of a specified agent. *

getAgentPrefVelocity ( int agentNo ) : Vector2

Returns the two-dimensional preferred velocity of a * specified agent.

getAgentRadius ( int agentNo ) : float

Returns the radius of a specified agent.

getAgentTimeHorizon ( int agentNo ) : float

Returns the time horizon of a specified agent.

getAgentTimeHorizonObst ( int agentNo ) : float

Returns the time horizon with respect to obstacles of a * specified agent.

getAgentVelocity ( int agentNo ) : Vector2

Returns the two-dimensional linear velocity of a specified * agent.

getGlobalTime ( ) : float

Returns the global time of the simulation.

getNextObstacleVertexNo ( int vertexNo ) : int

Returns the number of the obstacle vertex succeeding the * specified obstacle vertex in its polygon.

getNumAgents ( ) : int

Returns the count of agents in the simulation.

getNumObstacleVertices ( ) : int

Returns the count of obstacle vertices in the simulation. *

getObstacleVertex ( int vertexNo ) : Vector2

Returns the two-dimensional position of a specified obstacle * vertex.

getPrevObstacleVertexNo ( int vertexNo ) : int

Returns the number of the obstacle vertex preceding the * specified obstacle vertex in its polygon.

getTimeStep ( ) : float

Returns the time step of the simulation.

processObstacles ( ) : void

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.

queryVisibility ( Vector2 point1, Vector2 point2, float radius ) : bool

Performs a visibility query between the two specified points * with respect to the obstacles.

setAgentDefaults ( float neighborDist, int maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, Vector2 velocity ) : void

Sets the default properties for any new agent that is added. *

setAgentMaxNeighbors ( int agentNo, int maxNeighbors ) : void

Sets the maximum neighbor count of a specified agent. *

setAgentMaxSpeed ( int agentNo, float maxSpeed ) : void

Sets the maximum speed of a specified agent.

setAgentNeighborDist ( int agentNo, float neighborDist ) : void

Sets the maximum neighbor distance of a specified agent. *

setAgentPosition ( int agentNo, Vector2 position ) : void

Sets the two-dimensional position of a specified agent. *

setAgentPrefVelocity ( int agentNo, Vector2 prefVelocity ) : void

Sets the two-dimensional preferred velocity of a specified * agent.

setAgentRadius ( int agentNo, float radius ) : void

Sets the radius of a specified agent.

setAgentTimeHorizon ( int agentNo, float timeHorizon ) : void

Sets the time horizon of a specified agent with respect to * other agents.

setAgentTimeHorizonObst ( int agentNo, float timeHorizonObst ) : void

Sets the time horizon of a specified agent with respect to * obstacles.

setAgentVelocity ( int agentNo, Vector2 velocity ) : void

Sets the two-dimensional linear velocity of a specified * agent.

setGlobalTime ( float globalTime ) : void

Sets the global time of the simulation.

setTimeStep ( float timeStep ) : void

Sets the time step of the simulation.

비공개 메소드들

메소드 설명
Simulator ( ) : System

Constructs and initializes a simulation.

메소드 상세

Clear() 공개 메소드

Clears the simulation.
public Clear ( ) : void
리턴 void

GetNumWorkers() 공개 메소드

Returns the count of workers.
public GetNumWorkers ( ) : int
리턴 int

SetNumWorkers() 공개 메소드

Sets the number of workers.
public SetNumWorkers ( int numWorkers ) : void
numWorkers int The number of workers.
리턴 void

addAgent() 공개 메소드

Adds a new agent with default properties to the simulation. *
public addAgent ( Vector2 position ) : int
position Vector2 The two-dimensional starting position of this * agent.
리턴 int

addAgent() 공개 메소드

Adds a new agent to the simulation.
public addAgent ( Vector2 position, float neighborDist, int maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, Vector2 velocity ) : int
position Vector2 The two-dimensional starting position of this * agent.
neighborDist float 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 int 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 float 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 float 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 float The radius of this agent. Must be non-negative. *
maxSpeed float The maximum speed of this agent. Must be * non-negative.
velocity Vector2 The initial two-dimensional linear velocity of * this agent.
리턴 int

addObstacle() 공개 메소드

Adds a new obstacle to the simulation.
To add a "negative" obstacle, e.g. a bounding polygon around * the environment, the vertices should be listed in clockwise order. *
public addObstacle ( IList vertices ) : int
vertices IList List of the vertices of the polygonal obstacle * in counterclockwise order.
리턴 int

doStep() 공개 메소드

Performs a simulation step and updates the two-dimensional * position and two-dimensional velocity of each agent.
public doStep ( ) : float
리턴 float

getAgentAgentNeighbor() 공개 메소드

Returns the specified agent neighbor of the specified agent. *
public getAgentAgentNeighbor ( int agentNo, int neighborNo ) : int
agentNo int The number of the agent whose agent neighbor is * to be retrieved.
neighborNo int The number of the agent neighbor to be * retrieved.
리턴 int

getAgentMaxNeighbors() 공개 메소드

Returns the maximum neighbor count of a specified agent. *
public getAgentMaxNeighbors ( int agentNo ) : int
agentNo int The number of the agent whose maximum neighbor * count is to be retrieved.
리턴 int

getAgentMaxSpeed() 공개 메소드

Returns the maximum speed of a specified agent.
public getAgentMaxSpeed ( int agentNo ) : float
agentNo int The number of the agent whose maximum speed is * to be retrieved.
리턴 float

getAgentNeighborDist() 공개 메소드

Returns the maximum neighbor distance of a specified agent. *
public getAgentNeighborDist ( int agentNo ) : float
agentNo int The number of the agent whose maximum neighbor * distance is to be retrieved.
리턴 float

getAgentNumAgentNeighbors() 공개 메소드

Returns the count of agent neighbors taken into account to * compute the current velocity for the specified agent.
public getAgentNumAgentNeighbors ( int agentNo ) : int
agentNo int The number of the agent whose count of agent * neighbors is to be retrieved.
리턴 int

getAgentNumObstacleNeighbors() 공개 메소드

Returns the count of obstacle neighbors taken into account * to compute the current velocity for the specified agent.
public getAgentNumObstacleNeighbors ( int agentNo ) : int
agentNo int The number of the agent whose count of obstacle * neighbors is to be retrieved.
리턴 int

getAgentObstacleNeighbor() 공개 메소드

Returns the specified obstacle neighbor of the specified * agent.
public getAgentObstacleNeighbor ( int agentNo, int neighborNo ) : int
agentNo int The number of the agent whose obstacle neighbor * is to be retrieved.
neighborNo int The number of the obstacle neighbor to be * retrieved.
리턴 int

getAgentOrcaLines() 공개 메소드

Returns the ORCA constraints of the specified agent. *
The halfplane to the left of each line is the region of * permissible velocities with respect to that ORCA constraint. *
public getAgentOrcaLines ( int agentNo ) : IList
agentNo int The number of the agent whose ORCA constraints * are to be retrieved.
리턴 IList

getAgentPosition() 공개 메소드

Returns the two-dimensional position of a specified agent. *
public getAgentPosition ( int agentNo ) : Vector2
agentNo int The number of the agent whose two-dimensional * position is to be retrieved.
리턴 Vector2

getAgentPrefVelocity() 공개 메소드

Returns the two-dimensional preferred velocity of a * specified agent.
public getAgentPrefVelocity ( int agentNo ) : Vector2
agentNo int The number of the agent whose two-dimensional * preferred velocity is to be retrieved.
리턴 Vector2

getAgentRadius() 공개 메소드

Returns the radius of a specified agent.
public getAgentRadius ( int agentNo ) : float
agentNo int The number of the agent whose radius is to be * retrieved.
리턴 float

getAgentTimeHorizon() 공개 메소드

Returns the time horizon of a specified agent.
public getAgentTimeHorizon ( int agentNo ) : float
agentNo int The number of the agent whose time horizon is * to be retrieved.
리턴 float

getAgentTimeHorizonObst() 공개 메소드

Returns the time horizon with respect to obstacles of a * specified agent.
public getAgentTimeHorizonObst ( int agentNo ) : float
agentNo int The number of the agent whose time horizon with * respect to obstacles is to be retrieved.
리턴 float

getAgentVelocity() 공개 메소드

Returns the two-dimensional linear velocity of a specified * agent.
public getAgentVelocity ( int agentNo ) : Vector2
agentNo int The number of the agent whose two-dimensional * linear velocity is to be retrieved.
리턴 Vector2

getGlobalTime() 공개 메소드

Returns the global time of the simulation.
public getGlobalTime ( ) : float
리턴 float

getNextObstacleVertexNo() 공개 메소드

Returns the number of the obstacle vertex succeeding the * specified obstacle vertex in its polygon.
public getNextObstacleVertexNo ( int vertexNo ) : int
vertexNo int The number of the obstacle vertex whose * successor is to be retrieved.
리턴 int

getNumAgents() 공개 메소드

Returns the count of agents in the simulation.
public getNumAgents ( ) : int
리턴 int

getNumObstacleVertices() 공개 메소드

Returns the count of obstacle vertices in the simulation. *
public getNumObstacleVertices ( ) : int
리턴 int

getObstacleVertex() 공개 메소드

Returns the two-dimensional position of a specified obstacle * vertex.
public getObstacleVertex ( int vertexNo ) : Vector2
vertexNo int The number of the obstacle vertex to be * retrieved.
리턴 Vector2

getPrevObstacleVertexNo() 공개 메소드

Returns the number of the obstacle vertex preceding the * specified obstacle vertex in its polygon.
public getPrevObstacleVertexNo ( int vertexNo ) : int
vertexNo int The number of the obstacle vertex whose * predecessor is to be retrieved.
리턴 int

getTimeStep() 공개 메소드

Returns the time step of the simulation.
public getTimeStep ( ) : float
리턴 float

processObstacles() 공개 메소드

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.
public processObstacles ( ) : void
리턴 void

queryVisibility() 공개 메소드

Performs a visibility query between the two specified points * with respect to the obstacles.
public queryVisibility ( Vector2 point1, Vector2 point2, float radius ) : bool
point1 Vector2 The first point of the query.
point2 Vector2 The second point of the query.
radius float 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.
리턴 bool

setAgentDefaults() 공개 메소드

Sets the default properties for any new agent that is added. *
public setAgentDefaults ( float neighborDist, int maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, Vector2 velocity ) : void
neighborDist float 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 int 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 float 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 float 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 float The default radius of a new agent. Must be * non-negative.
maxSpeed float The default maximum speed of a new agent. Must * be non-negative.
velocity Vector2 The default initial two-dimensional linear * velocity of a new agent.
리턴 void

setAgentMaxNeighbors() 공개 메소드

Sets the maximum neighbor count of a specified agent. *
public setAgentMaxNeighbors ( int agentNo, int maxNeighbors ) : void
agentNo int The number of the agent whose maximum neighbor * count is to be modified.
maxNeighbors int The replacement maximum neighbor count. *
리턴 void

setAgentMaxSpeed() 공개 메소드

Sets the maximum speed of a specified agent.
public setAgentMaxSpeed ( int agentNo, float maxSpeed ) : void
agentNo int The number of the agent whose maximum speed is * to be modified.
maxSpeed float The replacement maximum speed. Must be * non-negative.
리턴 void

setAgentNeighborDist() 공개 메소드

Sets the maximum neighbor distance of a specified agent. *
public setAgentNeighborDist ( int agentNo, float neighborDist ) : void
agentNo int The number of the agent whose maximum neighbor * distance is to be modified.
neighborDist float The replacement maximum neighbor distance. * Must be non-negative.
리턴 void

setAgentPosition() 공개 메소드

Sets the two-dimensional position of a specified agent. *
public setAgentPosition ( int agentNo, Vector2 position ) : void
agentNo int The number of the agent whose two-dimensional * position is to be modified.
position Vector2 The replacement of the two-dimensional * position.
리턴 void

setAgentPrefVelocity() 공개 메소드

Sets the two-dimensional preferred velocity of a specified * agent.
public setAgentPrefVelocity ( int agentNo, Vector2 prefVelocity ) : void
agentNo int The number of the agent whose two-dimensional * preferred velocity is to be modified.
prefVelocity Vector2 The replacement of the two-dimensional * preferred velocity.
리턴 void

setAgentRadius() 공개 메소드

Sets the radius of a specified agent.
public setAgentRadius ( int agentNo, float radius ) : void
agentNo int The number of the agent whose radius is to be * modified.
radius float The replacement radius. Must be non-negative. *
리턴 void

setAgentTimeHorizon() 공개 메소드

Sets the time horizon of a specified agent with respect to * other agents.
public setAgentTimeHorizon ( int agentNo, float timeHorizon ) : void
agentNo int The number of the agent whose time horizon is * to be modified.
timeHorizon float The replacement time horizon with respect * to other agents. Must be positive.
리턴 void

setAgentTimeHorizonObst() 공개 메소드

Sets the time horizon of a specified agent with respect to * obstacles.
public setAgentTimeHorizonObst ( int agentNo, float timeHorizonObst ) : void
agentNo int The number of the agent whose time horizon with * respect to obstacles is to be modified.
timeHorizonObst float The replacement time horizon with * respect to obstacles. Must be positive.
리턴 void

setAgentVelocity() 공개 메소드

Sets the two-dimensional linear velocity of a specified * agent.
public setAgentVelocity ( int agentNo, Vector2 velocity ) : void
agentNo int The number of the agent whose two-dimensional * linear velocity is to be modified.
velocity Vector2 The replacement two-dimensional linear * velocity.
리턴 void

setGlobalTime() 공개 메소드

Sets the global time of the simulation.
public setGlobalTime ( float globalTime ) : void
globalTime float The global time of the simulation.
리턴 void

setTimeStep() 공개 메소드

Sets the time step of the simulation.
public setTimeStep ( float timeStep ) : void
timeStep float The time step of the simulation. Must be * positive.
리턴 void