Commit 16cfd91d authored by Fabien Grzeskowiak's avatar Fabien Grzeskowiak

Merge branch 'master' into 56-ConfigfFilesAsArguments

parents 017eab82 e4930f5a
......@@ -5,7 +5,6 @@ cmake-build-debug
build/
/.vs
/bin
/release
# Prerequisites
*.d
......@@ -36,7 +35,6 @@ build/
*.lib
# Executables
*.exe
*.out
*.app
......
#define DLL_EXPORT
#include "APIFunctions.h"
#include <core/crowdSimulator.h>
#include <algorithm>
extern "C" {
CrowdSimulator* cs;
AgentData* agentData;
size_t agentDataSize;
API_FUNCTION bool StartSimulation(const char* configFileName)
{
// initialize a new crowd simulation with the given config file
cs = new CrowdSimulator();
cs->loadMasterConfigFile(std::string(configFileName));
// prepare the agentData array
agentDataSize = std::max((size_t)4, cs->getWorld()->getAgents().size() * 2);
agentData = new AgentData[agentDataSize];
return true;
}
API_FUNCTION bool GetSimulationTimeStep(float& result_dt)
{
if (cs == nullptr)
return false;
result_dt = cs->getWorld()->getDeltaTime();
return true;
}
API_FUNCTION bool DoSimulationSteps(int nrSteps)
{
if (cs == nullptr)
return false;
cs->runWorld(nrSteps);
return true;
}
API_FUNCTION bool GetAgentPositions(AgentData*& result_agentData, int& result_nrAgents)
{
if (cs == nullptr)
return false;
const auto& agents = cs->getWorld()->getAgents();
// check if the AgentData array is large enough; resize it if necessary
if (agents.size() > agentDataSize)
{
delete[] agentData;
agentDataSize *= 2;
agentData = new AgentData[agentDataSize];
}
else if (agents.size() * 4 < agentDataSize)
{
delete[] agentData;
agentDataSize /= 4;
agentData = new AgentData[agentDataSize];
}
// fill the AgentData array with the current agent data
int i = 0;
for (const auto& agent : agents)
{
agentData[i].id = agent->getID();
agentData[i].x = agent->getPosition().x();
agentData[i].y = agent->getPosition().y();
++i;
}
// store references to these results, for the client program to use
result_agentData = agentData;
result_nrAgents = (int)agents.size();
return true;
}
API_FUNCTION bool CleanUp()
{
if (cs == nullptr)
return false;
delete cs;
delete[] agentData;
return true;
}
}
\ No newline at end of file
#ifdef DLL_EXPORT
#ifdef WIN32
#define API_FUNCTION __declspec(dllexport)
#else
#define API_FUNCTION __attribute__((visibility("default")))
#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 OCSR library and external applications.</summary>
struct AgentData
{
/// The unique ID of the agent.
int id;
/// The x coordinate of the agent at the current time.
float x;
/// The y coordinate of the agent at the current time.
float y;
};
/// <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 bool StartSimulation(const char* configFileName);
/// <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 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 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,
/// where each object describes the status of a single agent.</param>
/// <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 bool GetAgentPositions(AgentData*& result_agentData, int& result_nrAgents);
/// <summary>Cleans up some objects related to the simulation. Call this method just before you finish using the OCSR 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 bool CleanUp();
}
\ No newline at end of file
# Crowd Simulator Engine
# Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
# Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak
#
# Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
# Alicia Nics Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
#
# Contact: crowd_group@inria.fr
cmake_minimum_required( VERSION 2.8 )
project( CrowdSimulator )
set (CMAKE_CXX_STANDARD 14)
......@@ -41,17 +40,29 @@ link_directories( ./lib/${CMAKE_BUILD_TYPE} )
file( GLOB_RECURSE source_files src/* include/*)
file( GLOB_RECURSE 3rd_party 3rd-party/tinyxml/* 3rd-party/nanoflann/*)
add_executable(my_app main.cpp ${source_files} ${3rd_party})
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
else()
#linux compatibility compiler option
add_definitions(-fPIC)
endif()
add_library(Engine STATIC ${source_files} ${3rd_party})
add_executable(OCSR_ConsoleApplication main.cpp)
target_link_libraries(OCSR_ConsoleApplication Engine)
#add_executable(test_xmlparser ./test/test_xmlparser.cpp ${source_files} ${3rd_party})
#add_executable(test_socialforces ./test/SocialForcesExample.cpp ${source_files} ${3rd_party})
#add_executable(test_socialforces ./test/SocialForcesExample.cpp ${source_files} ${tinyxml_src})
#add_executable(test_ttcaDca ./test/DcaTtcaExample.cpp ${source_files} ${3rd_party})
add_executable(test_localSearch ./test/TestLocalSearch.cpp ${source_files} ${3rd_party})
#add_executable(test_localSearch ./test/TestLocalSearch.cpp ${source_files} ${3rd_party})
add_library(OCSR_Library SHARED "APIFunctions.h" "APIFunctions.cpp")
target_link_libraries(OCSR_Library Engine)
target_link_libraries(my_app)
#target_link_libraries(my_app)
#target_link_libraries(test_xmlparser)
#target_link_libraries(test_socialforces)
#target_link_libraries(test_ttcaDca)
target_link_libraries(test_localSearch)
#target_link_libraries(test_localSearch)
#message(${Boost_LIBRARIES})
#message(${Boost_LIBRARY_DIRS})
......
This diff is collapsed.
......@@ -3,7 +3,7 @@ Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
......@@ -12,15 +12,12 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
Alicia Nicás Miquel
Alicia Nicás Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
Contact: crowd_group@inria.fr
================================================================================
================================================================================
\ No newline at end of file
......@@ -48,7 +48,7 @@ class FOEAvoidance : public CostFunction
* Return the values to the policy to update the agent.
*/
virtual CostFunctionValues GetCostFunctionGradient(Agent* agent, WorldBase * world);
void parseParameters(tinyxml2::XMLElement* v) override;
void parseParameters(const CostFunctionParameters & params) override;
virtual ~FOEAvoidance();
};
......
/* Crowd Simulator Engine
** Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** as published by the Free Software Foundation; either version 3
** of the License, or (at your option) any later version.
**
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
**
** You should have received a copy of the GNU General Public License
** along with this program.If not, see < https://www.gnu.org/licenses/>.
**
** Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak
**
** Contact: crowd_group@inria.fr
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
** Alicia Nicás Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
**
** Contact : crowd_group@inria.fr
*/
#ifndef LIB_GENERIC_COST_H
#define LIB_GENERIC_COST_H
......@@ -46,7 +45,7 @@ class GenericCost : public CostFunction
* Return the values to the policy to update the agent.
*/
virtual CostFunctionValues GetCostFunctionGradient(Agent* agent, WorldBase * world);
void parseParameters(tinyxml2::XMLElement* v) override;
void parseParameters(const CostFunctionParameters & params) override;
virtual ~GenericCost();
};
......
/* Crowd Simulator Engine
** Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** as published by the Free Software Foundation; either version 3
** of the License, or (at your option) any later version.
**
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
**
** You should have received a copy of the GNU General Public License
** along with this program.If not, see < https://www.gnu.org/licenses/>.
**
** Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak
**
** Contact: crowd_group@inria.fr
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
** Alicia Nicás Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
**
** Contact : crowd_group@inria.fr
*/
#ifndef LIB_POWER_LAW_H
......@@ -32,15 +30,16 @@
/*
* Deviates the trajectory of the agent to prevent collisions.
* Uses FOE to detect and prevent collisions.
* Parameters: tau0
*/
class PowerLaw : public CostFunction
{
private:
float tau0 = 3;
public:
const static std::string GetName() { return "PowerLaw"; }
float tau0 = 3;
const static std::string Name;
PowerLaw();
......@@ -50,7 +49,7 @@ class PowerLaw : public CostFunction
* Return the values to the policy to update the agent.
*/
virtual CostFunctionValues GetCostFunctionGradient(Agent* agent, WorldBase * world);
void parseParameters(tinyxml2::XMLElement* v) override;
void parseParameters(const CostFunctionParameters & params) override;
virtual ~PowerLaw();
};
......
/* Crowd Simulator Engine
** Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** as published by the Free Software Foundation; either version 3
** of the License, or (at your option) any later version.
**
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
**
** You should have received a copy of the GNU General Public License
** along with this program.If not, see < https://www.gnu.org/licenses/>.
**
** Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak
**
** Contact: crowd_group@inria.fr
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
** Alicia Nicás Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
**
** Contact : crowd_group@inria.fr
*/
#ifndef LIB_RANDOM_FUNCTION_H
#define LIB_RANDOM_FUNCTION_H
......@@ -50,7 +49,7 @@ class RandomFunction : public CostFunction
* Return the values to the policy to update the agent.
*/
virtual CostFunctionValues GetCostFunctionGradient(Agent* agent, WorldBase * world);
void parseParameters(tinyxml2::XMLElement* v) override;
void parseParameters(const CostFunctionParameters & params) override;
virtual ~RandomFunction();
};
......
/* Crowd Simulator Engine
** Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** as published by the Free Software Foundation; either version 3
** of the License, or (at your option) any later version.
**
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
**
** You should have received a copy of the GNU General Public License
** along with this program.If not, see < https://www.gnu.org/licenses/>.
**
** Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak
**
** Contact: crowd_group@inria.fr
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
** Alicia Nicás Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
**
** Contact : crowd_group@inria.fr
*/
#ifndef LIB_SOCIAL_FORCES_AVOIDANCE_H
#define LIB_SOCIAL_FORCES_AVOIDANCE_H
#include <core/costFunction.h>
/*
* Implements social forces algorithm.
* Implements social forces algorithm for collision avoidance only.
* Paramters: sigma
*/
class SocialForcesAvoidance : public CostFunction
{
......@@ -46,7 +46,7 @@ class SocialForcesAvoidance : public CostFunction
* Return the values to the policy to update the agent.
*/
virtual CostFunctionValues GetCostFunctionGradient(Agent* agent, WorldBase * world);
void parseParameters(tinyxml2::XMLElement* v) override;
void parseParameters(const CostFunctionParameters & params) override;
virtual ~SocialForcesAvoidance();
};
......
/* Crowd Simulator Engine
** Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** as published by the Free Software Foundation; either version 3
** of the License, or (at your option) any later version.
**
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
**
** You should have received a copy of the GNU General Public License
** along with this program.If not, see < https://www.gnu.org/licenses/>.
**
** Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak
**
** Contact: crowd_group@inria.fr
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
** Alicia Nicás Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
**
** Contact : crowd_group@inria.fr
*/
#ifndef LIB_SOCIAL_FORCES_GOAL_H
#define LIB_SOCIAL_FORCES_GOAL_H
......@@ -46,7 +45,7 @@ class SocialForcesGoalReaching : public CostFunction
* Return the values to the policy to update the agent.
*/
virtual CostFunctionValues GetCostFunctionGradient(Agent* agent, WorldBase * world);
void parseParameters(tinyxml2::XMLElement* v) override;
void parseParameters(const CostFunctionParameters & params) override;
virtual ~SocialForcesGoalReaching();
};
......
/* Crowd Simulator Engine
** Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** as published by the Free Software Foundation; either version 3
** of the License, or (at your option) any later version.
**
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
**
** You should have received a copy of the GNU General Public License
** along with this program.If not, see < https://www.gnu.org/licenses/>.
**
** Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak
**
** Contact: crowd_group@inria.fr
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
** Alicia Nicás Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
**
** Contact : crowd_group@inria.fr
*/
#ifndef LIB_TTCADCA_H
#define LIB_TTCADCA_H
......@@ -40,20 +39,20 @@
* distance from each other, called dca.
*
* This cost function maximise those 2 metrics together.
* Parameters: sigmaTtca, sigmaDca
*/
class TtcaDca : public CostFunction
{
/*
* Parameters of the cost function
*/
float sigTtca_ = 2;
float sigDca_ = 0.5;
private:
Vector2D GradDca();
Vector2D GradTtca();
float Cost(float ttca, float dca);
/*
* Parameters of the cost function
*/
float sigTtca_ = 2;
float sigDca_ = 0.5;
public:
......@@ -76,7 +75,7 @@ class TtcaDca : public CostFunction
* Return the values to the policy to update the agent.
*/
virtual CostFunctionValues GetCostFunctionGradient(Agent* agent, WorldBase * world);
void parseParameters(tinyxml2::XMLElement* v) override;
void parseParameters(const CostFunctionParameters & params) override;
};
#endif //LIB_TTCADCA_H
/* Crowd Simulator Engine
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 3
** of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program.If not, see < https://www.gnu.org/licenses/>.
**
** Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
** Alicia Nicás Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
**
** Contact : crowd_group@inria.fr
*/
#ifndef LIB_COSTFUNCTIONREGISTRATION_H
#define LIB_COSTFUNCTIONREGISTRATION_H
void RegisterCostFunctions();
#endif //LIB_COSTFUNCTIONREGISTRATION_H
......@@ -48,7 +48,7 @@ class DirGoalReaching : public CostFunction
* Return the values to the policy to update the agent.
*/
virtual CostFunctionValues GetCostFunctionGradient(Agent* agent, WorldBase * world);
void parseParameters(tinyxml2::XMLElement* v) override;
void parseParameters(const CostFunctionParameters & params) override;
virtual ~DirGoalReaching();
};
......
/* Crowd Simulator Engine
** Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** as published by the Free Software Foundation; either version 3
** of the License, or (at your option) any later version.
**
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
**
** You should have received a copy of the GNU General Public License
** along with this program.If not, see < https://www.gnu.org/licenses/>.
**
** Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak
**
** Contact: crowd_group@inria.fr
** Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
** Alicia Nicás Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
**
** Contact : crowd_group@inria.fr
*/
#ifndef LIB_GOAL_REACHING_H
#define LIB_GOAL_REACHING_H
......@@ -48,7 +47,7 @@ class GoalReaching : public CostFunction
* Return the values to the policy to update the agent.
*/
virtual CostFunctionValues GetCostFunctionGradient(Agent* agent, WorldBase * world);
void parseParameters(tinyxml2::XMLElement* v) override;
void parseParameters(const CostFunctionParameters & params) override;
virtual ~GoalReaching();
};
......
/* Crowd Simulator Engine
** Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** as published by the Free Software Foundation; either version 3
** of the License, or (at your option) any later version.