Commit 0afe6dec authored by Fabien Grzeskowiak's avatar Fabien Grzeskowiak

test

parent f6b39d9f
......@@ -28,7 +28,6 @@
#include <omp.h>
#include <cstring>
#include <string>
#include <unistd.h>
extern "C"
{
......
......@@ -27,6 +27,7 @@
#endif
#endif
extern "C"{
/// <summary>A struct that describes the status of a single agent in the simulation.
/// This struct is used for communication between the UMANS library and external applications.</summary>
struct AgentData
......@@ -50,18 +51,18 @@
/// <summary>Sets up a simulation based on a configuration file.
/// After this function call, the simulation will be ready for its first time step.</summary>
/// <returns>true if the operation was successful; false otherwise, e.g. if the configuration file is invalid.</returns>
API_FUNCTION extern "C" bool StartSimulation(const char* configFileName, int nrThreads);
API_FUNCTION bool StartSimulation(const char* configFileName, int nrThreads);
/// <summary>Gets the step size of the simulation, in seconds.</summary>
/// <param ref="result_dt">[out] Will store the step size of the simulation.</param>
/// <returns>true if the operation was successful; false otherwise, i.e. if the simulation has not been initialized (correctly) yet.</returns>
API_FUNCTION extern "C" bool GetSimulationTimeStep(float& result_dt);
API_FUNCTION bool GetSimulationTimeStep(float& result_dt);
/// <summary>Performs the given number of simulation steps.
/// To obtain the resulting status of the simulation, use the GetAgentPositions() function.</summary>
/// <param ref="nrSteps">The number of steps to perform.</param>
/// <returns>true if the operation was successful; false otherwise, i.e. if the simulation has not been initialized (correctly) yet.</returns>
API_FUNCTION extern "C" bool DoSimulationSteps(int nrSteps);
API_FUNCTION bool DoSimulationSteps(int nrSteps);
/// <summary>Gets the current status of all agents in the simulation.</summary>
/// <param ref="result_agentData">[out] Will store a reference to an array of AgentData objects,
......@@ -69,13 +70,13 @@
/// <param ref="result_nrAgents">[out] Will store the number of agents in the simulation,
/// i.e. the number of useful entries in the AgentData array.</param>
/// <returns>true if the operation was successful; false otherwise, i.e. if the simulation has not been initialized (correctly) yet.</returns>
API_FUNCTION extern "C" bool GetAgentPositions(AgentData*& result_agentData, int& result_nrAgents);
API_FUNCTION bool GetAgentPositions(AgentData*& result_agentData, int& result_nrAgents);
/// <summary>Overrides the position of some or all agents in the simulation. You can decide for yourself which agents are affected.</summary>
/// <param ref="agentData">A reference to an array of AgentData objects, where each object describes the position of a single agent that you want to set.</param>
/// <param ref="nrAgents">The number of entries in the AgentData array.</param>
/// <returns>true if the operation was successful; false otherwise, i.e. if the simulation has not been initialized (correctly) yet.</returns>
API_FUNCTION extern "C" bool SetAgentPositions(AgentData* agentData, int nrAgents);
API_FUNCTION bool SetAgentPositions(AgentData* agentData, int nrAgents);
/// <summary>Tries to add a new agent to the simulation.</summary>
/// <param ref="x">The x-coordinate of the agent's starting position.</param>
......@@ -90,13 +91,13 @@
/// otherwise, the simulation will assign a different ID.</param>
/// <returns>true if the operation was successful; false otherwise,
/// i.e. if the simulation has not been initialized (correctly) yet, or if the agent with the given ID does not exist.</returns>
API_FUNCTION extern "C" bool AddAgent(float x, float y, float radius, float prefSpeed, float maxSpeed, float maxAcceleration, int policyID, int& result_id, int desiredID = -1);
API_FUNCTION bool AddAgent(float x, float y, float radius, float prefSpeed, float maxSpeed, float maxAcceleration, int policyID, int& result_id, int desiredID = -1);
/// <summary>Tries to remove a specific agent from the simulation.</summary>
/// <param ref="id">The ID of the agent to remove.</param>
/// <returns>true if the operation was successful; false otherwise,
/// i.e. if the simulation has not been initialized (correctly) yet, or if the agent with the given ID does not exist.</returns>
API_FUNCTION extern "C" bool RemoveAgent(int id);
API_FUNCTION bool RemoveAgent(int id);
/// <summary>Changes the goal of a single agent in the simulation.</summary>
/// <param ref="id">The ID of the agent to change.</param>
......@@ -104,8 +105,9 @@
/// <param ref="y">The y-coordinate of the agent's new goal.</param>
/// <returns>true if the operation was successful; false otherwise,
/// i.e. if the simulation has not been initialized (correctly) yet, or if the agent with the given ID does not exist.</returns>
API_FUNCTION extern "C" bool SetAgentGoal(int id, float x, float y);
API_FUNCTION bool SetAgentGoal(int id, float x, float y);
/// <summary>Cleans up some objects related to the simulation. Call this method just before you finish using the UMANS library.</summary>
/// <returns>true if the operation was successful; false otherwise, i.e. if the simulation has not been initialized (correctly) yet.</returns>
API_FUNCTION extern "C" bool CleanUp();
API_FUNCTION bool CleanUp();
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment