Commit 07d8e115 authored by Erik Andresen's avatar Erik Andresen

rename cognitive map router into AIRouter (artificial intelligence)

parent 5f3a2e7e
......@@ -310,35 +310,35 @@ set(source_files
routing/quickest/QuickestPathRouter.cpp
#AI router
routing/AI_router/CognitiveMapRouter.cpp
routing/AI_router/GraphNetwork.cpp
routing/AI_router/NavigationGraph.cpp
routing/AI_router/BrainStorage.cpp
routing/AI_router/navigation_graph/GraphEdge.cpp
routing/AI_router/navigation_graph/GraphVertex.cpp
routing/AI_router/sensor/RoomToFloorSensor.cpp
routing/AI_router/sensor/SensorManager.cpp
routing/AI_router/sensor/AbstractSensor.cpp
routing/AI_router/sensor/DiscoverDoorsSensor.cpp
routing/AI_router/sensor/JamSensor.cpp
routing/AI_router/sensor/LastDestinationsSensor.cpp
routing/AI_router/sensor/SmokeSensor.cpp
routing/AI_router/sensor/locater.cpp
routing/AI_router/fire_mesh/FireMesh.cpp
routing/AI_router/fire_mesh/Knot.cpp
routing/AI_router/fire_mesh/FireMeshStorage.cpp
routing/AI_router/cognitiveMap/associations.cpp
routing/AI_router/cognitiveMap/connection.cpp
routing/AI_router/cognitiveMap/cognitivemap.cpp
routing/AI_router/cognitiveMap/landmark.cpp
routing/AI_router/cognitiveMap/region.cpp
routing/AI_router/cognitiveMap/youareherepointer.cpp
routing/AI_router/cognitiveMap/cogmapoutputhandler.cpp
routing/AI_router/cognitiveMap/landmarknetwork.cpp
routing/AI_router/perception/perception.cpp
routing/AI_router/perception/visibleenvironment.cpp
routing/AI_router/Brain.cpp
routing/AI_router/cognitiveMap/internnavigationnetwork.cpp
routing/ai_router/AIRouter.cpp
routing/ai_router/GraphNetwork.cpp
routing/ai_router/NavigationGraph.cpp
routing/ai_router/BrainStorage.cpp
routing/ai_router/navigation_graph/GraphEdge.cpp
routing/ai_router/navigation_graph/GraphVertex.cpp
routing/ai_router/sensor/RoomToFloorSensor.cpp
routing/ai_router/sensor/SensorManager.cpp
routing/ai_router/sensor/AbstractSensor.cpp
routing/ai_router/sensor/DiscoverDoorsSensor.cpp
routing/ai_router/sensor/JamSensor.cpp
routing/ai_router/sensor/LastDestinationsSensor.cpp
routing/ai_router/sensor/SmokeSensor.cpp
routing/ai_router/sensor/locater.cpp
routing/ai_router/fire_mesh/FireMesh.cpp
routing/ai_router/fire_mesh/Knot.cpp
routing/ai_router/fire_mesh/FireMeshStorage.cpp
routing/ai_router/cognitiveMap/associations.cpp
routing/ai_router/cognitiveMap/connection.cpp
routing/ai_router/cognitiveMap/cognitivemap.cpp
routing/ai_router/cognitiveMap/landmark.cpp
routing/ai_router/cognitiveMap/region.cpp
routing/ai_router/cognitiveMap/youareherepointer.cpp
routing/ai_router/cognitiveMap/cogmapoutputhandler.cpp
routing/ai_router/cognitiveMap/landmarknetwork.cpp
routing/ai_router/perception/perception.cpp
routing/ai_router/perception/visibleenvironment.cpp
routing/ai_router/Brain.cpp
routing/ai_router/cognitiveMap/internnavigationnetwork.cpp
visiLibity/source_code/visilibity.cpp
......@@ -375,35 +375,35 @@ set(header_files
routing/quickest/QuickestPathRouter.h
#AI router
routing/AI_router/CognitiveMapRouter.h
routing/AI_router/GraphNetwork.h
routing/AI_router/NavigationGraph.h
routing/AI_router/BrainStorage.h
routing/AI_router/navigation_graph/GraphEdge.h
routing/AI_router/navigation_graph/GraphVertex.h
routing/AI_router/sensor/AbstractSensor.h
routing/AI_router/sensor/RoomToFloorSensor.h
routing/AI_router/sensor/SensorManager.h
routing/AI_router/sensor/DiscoverDoorsSensor.h
routing/AI_router/sensor/JamSensor.h
routing/AI_router/sensor/LastDestinationsSensor.h
routing/AI_router/sensor/SmokeSensor.h
routing/AI_router/sensor/locater.h
routing/AI_router/fire_mesh/FireMesh.h
routing/AI_router/fire_mesh/Knot.h
routing/AI_router/fire_mesh/FireMeshStorage.h
routing/AI_router/cognitiveMap/associations.h
routing/AI_router/cognitiveMap/connection.cpp
routing/AI_router/cognitiveMap/cognitivemap.h
routing/AI_router/cognitiveMap/landmark.h
routing/AI_router/cognitiveMap/region.h
routing/AI_router/cognitiveMap/youareherepointer.h
routing/AI_router/cognitiveMap/cogmapoutputhandler.h
routing/AI_router/cognitiveMap/landmarknetwork.h
routing/AI_router/perception/perception.h
routing/AI_router/perception/visibleenvironment.h
routing/AI_router/Brain.h
routing/AI_router/cognitiveMap/internnavigationnetwork.h
routing/ai_router/AIRouter.h
routing/ai_router/GraphNetwork.h
routing/ai_router/NavigationGraph.h
routing/ai_router/BrainStorage.h
routing/ai_router/navigation_graph/GraphEdge.h
routing/ai_router/navigation_graph/GraphVertex.h
routing/ai_router/sensor/AbstractSensor.h
routing/ai_router/sensor/RoomToFloorSensor.h
routing/ai_router/sensor/SensorManager.h
routing/ai_router/sensor/DiscoverDoorsSensor.h
routing/ai_router/sensor/JamSensor.h
routing/ai_router/sensor/LastDestinationsSensor.h
routing/ai_router/sensor/SmokeSensor.h
routing/ai_router/sensor/locater.h
routing/ai_router/fire_mesh/FireMesh.h
routing/ai_router/fire_mesh/Knot.h
routing/ai_router/fire_mesh/FireMeshStorage.h
routing/ai_router/cognitiveMap/associations.h
routing/ai_router/cognitiveMap/connection.cpp
routing/ai_router/cognitiveMap/cognitivemap.h
routing/ai_router/cognitiveMap/landmark.h
routing/ai_router/cognitiveMap/region.h
routing/ai_router/cognitiveMap/youareherepointer.h
routing/ai_router/cognitiveMap/cogmapoutputhandler.h
routing/ai_router/cognitiveMap/landmarknetwork.h
routing/ai_router/perception/perception.h
routing/ai_router/perception/visibleenvironment.h
routing/ai_router/Brain.h
routing/ai_router/cognitiveMap/internnavigationnetwork.h
visiLibity/source_code/visilibity.hpp
pedestrian/Pedestrian.h
......
......@@ -40,7 +40,7 @@
#include "../math/VelocityModel.h"
#include "../routing/global_shortest/GlobalRouter.h"
#include "../routing/quickest/QuickestPathRouter.h"
#include "../routing/AI_router/CognitiveMapRouter.h"
#include "../routing/ai_router/AIRouter.h"
#include "../routing/ff_router/ffRouter.h"
IniFileParser::IniFileParser(Configuration* config)
......@@ -1068,13 +1068,13 @@ bool IniFileParser::ParseRoutingStrategies(TiXmlNode* routingNode, TiXmlNode* ag
Router *r = new QuickestPathRouter(id, ROUTING_QUICKEST);
_config->GetRoutingEngine()->AddRouter(r);
}
else if ((strategy == "cognitive_map") &&
else if ((strategy == "AI") &&
(std::find(usedRouter.begin(), usedRouter.end(), id) != usedRouter.end()) ) {
//pRoutingStrategies.push_back(make_pair(id, ROUTING_COGNITIVEMAP));
Router *r = new CognitiveMapRouter(id, ROUTING_COGNITIVEMAP);
Router *r = new AIRouter(id, ROUTING_AI);
_config->GetRoutingEngine()->AddRouter(r);
Log->Write("\nINFO: \tUsing CognitiveMapRouter");
Log->Write("\nINFO: \tUsing AIRouter");
///Parsing additional options
if (!ParseCogMapOpts(e))
return false;
......@@ -1151,8 +1151,8 @@ bool IniFileParser::ParseCogMapOpts(TiXmlNode* routingNode)
return false;
}
/// static_cast to get access to the method 'addOption' of the CognitiveMapRouter
CognitiveMapRouter* r = static_cast<CognitiveMapRouter*>(_config->GetRoutingEngine()->GetAvailableRouters().back());
/// static_cast to get access to the method 'addOption' of the AIRouter
AIRouter* r = static_cast<AIRouter*>(_config->GetRoutingEngine()->GetAvailableRouters().back());
std::vector<std::string> sensorVec;
for (TiXmlElement* e = sensorNode->FirstChildElement("sensor"); e;
......
......@@ -45,7 +45,7 @@
#include "routing/DirectionStrategy.h"
#include "routing/RoutingEngine.h"
#include "pedestrian/PedDistributor.h"
#include "routing/AI_router/CognitiveMapRouter.h"
#include "routing/ai_router/AIRouter.h"
#include "events/EventManager.h"
#include "pedestrian/AgentsSourcesManager.h"
#include "general/Configuration.h"
......
......@@ -48,7 +48,7 @@
#include "../routing/RoutingEngine.h"
#include "../routing/global_shortest/GlobalRouter.h"
#include "../routing/quickest/QuickestPathRouter.h"
#include "../routing/AI_router/CognitiveMapRouter.h"
#include "../routing/ai_router/AIRouter.h"
#include "EventManager.h"
#include "Event.h"
......@@ -675,8 +675,8 @@ Router * EventManager::CreateRouter(const RoutingStrategy& strategy)
rout = new QuickestPathRouter(ROUTING_QUICKEST, ROUTING_QUICKEST);
break;
case ROUTING_COGNITIVEMAP:
rout = new CognitiveMapRouter(ROUTING_COGNITIVEMAP, ROUTING_COGNITIVEMAP);
case ROUTING_AI:
rout = new AIRouter(ROUTING_AI, ROUTING_AI);
break;
default:
......
......@@ -47,7 +47,7 @@
#include "../pedestrian/AgentsParameters.h"
#include "../routing/global_shortest/GlobalRouter.h"
#include "../routing/quickest/QuickestPathRouter.h"
#include "../routing/AI_router/CognitiveMapRouter.h"
#include "../routing/ai_router/AIRouter.h"
#include "../IO/IniFileParser.h"
#include <sys/stat.h>
......
......@@ -119,10 +119,7 @@ enum RoutingStrategy {
ROUTING_GLOBAL_SHORTEST,
ROUTING_QUICKEST,
ROUTING_FROM_FILE,
ROUTING_NAV_MESH,
ROUTING_DUMMY,
ROUTING_SAFEST,
ROUTING_COGNITIVEMAP,
ROUTING_AI,
ROUTING_FLOORFIELD,
ROUTING_FF_GLOBAL_SHORTEST,
ROUTING_FF_LOCAL_SHORTEST,
......
/**
* \file AbstractCognitiveMapCreator.cpp
* \date Feb 1, 2014
* \version v0.7
* \copyright <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved.
*
* \section License
* This file is part of JuPedSim.
*
* JuPedSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* JuPedSim 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 Lesser General Public License
* along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
*
* \section Description
*
*
**/
#include "AbstractCognitiveMapCreator.h"
AbstractCognitiveMapCreator::~AbstractCognitiveMapCreator()
{
}
/**
* \file AbstractCognitiveMapCreator.h
* \date Feb 1, 2014
* \version v0.7
* \copyright <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved.
*
* \section License
* This file is part of JuPedSim.
*
* JuPedSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* JuPedSim 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 Lesser General Public License
* along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
*
* \section Description
*
*
**/
#ifndef ABSTRACTCOGNITIVEMAPCREATOR_H
#define ABSTRACTCOGNITIVEMAPCREATOR_H 1
class Building;
class Pedestrian;
class CognitiveMap;
class AbstractCognitiveMapCreator {
public:
AbstractCognitiveMapCreator(const Building * b) : _building(b) {}
virtual ~AbstractCognitiveMapCreator();
virtual CognitiveMap * CreateCognitiveMap(const Pedestrian * ped) = 0;
protected:
const Building * const _building;
};
#endif // ABSTRACTCOGNITIVEMAPCREATOR_H
/**
* \file CompleteCognitiveMapCreator.cpp
* \date Feb 1, 2014
* \version v0.7
* \copyright <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved.
*
* \section License
* This file is part of JuPedSim.
*
* JuPedSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* JuPedSim 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 Lesser General Public License
* along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
*
* \section Description
*
*
**/
#include "CompleteCognitiveMapCreator.h"
#include "./cognitiveMap/cognitivemap.h"
#include <vector>
#include <map>
#include "../../geometry/Room.h"
#include "../../geometry/SubRoom.h"
#include "../../geometry/Building.h"
#include "../../geometry/Crossing.h"
#include "../../geometry/Transition.h"
#include "../../pedestrian/Pedestrian.h"
CompleteCognitiveMapCreator::~CompleteCognitiveMapCreator()
{
}
CognitiveMap * CompleteCognitiveMapCreator::CreateCognitiveMap(const Pedestrian * ped)
{
CognitiveMap * cm = new CognitiveMap(_building, ped);
//adding all SubRooms as Vertex
for(auto&& itr_room: _building->GetAllRooms())
{
for(auto&& itr_subroom: itr_room.second->GetAllSubRooms())
{
cm->GetGraphNetwork()->Add(itr_subroom.second.get());
}
}
//Add crossings as edges
for(auto&& itr_cross: _building->GetAllCrossings())
{
cm->GetGraphNetwork()->Add(itr_cross.second);
}
//Add transitions as edges
for(auto&& itr_trans: _building->GetAllTransitions())
{
if(itr_trans.second->IsExit())
{
cm->GetGraphNetwork()->AddExit(itr_trans.second);
}
else
{
cm->GetGraphNetwork()->Add(itr_trans.second);
}
}
//RouteKnowlegde
// Remembered routes and assoziations between rooms and doors
//cm->CreateRouteKnowlegde(ped);
return cm;
}
/**
* \file CompleteCognitiveMapCreator.h
* \date Feb 1, 2014
* \version v0.7
* \copyright <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved.
*
* \section License
* This file is part of JuPedSim.
*
* JuPedSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* JuPedSim 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 Lesser General Public License
* along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
*
* \section Description
*
*
**/
#ifndef COMPLETECOGNITIVEMAPCREATOR_H
#define COMPLETECOGNITIVEMAPCREATOR_H 1
#include "AbstractCognitiveMapCreator.h"
class Building;
class CompleteCognitiveMapCreator : public AbstractCognitiveMapCreator {
public:
CompleteCognitiveMapCreator(const Building * b) : AbstractCognitiveMapCreator(b) { }
virtual ~CompleteCognitiveMapCreator();
CognitiveMap * CreateCognitiveMap(const Pedestrian * ped);
private:
};
#endif // COMPLETECOGNITIVEMAPCREATOR_H
/**
* \file EmptyCognitiveMapCreator.cpp
* \date Feb 1, 2014
* \version v0.7
* \copyright <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved.
*
* \section License
* This file is part of JuPedSim.
*
* JuPedSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* JuPedSim 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 Lesser General Public License
* along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
*
* \section Description
*
*
**/
#include "EmptyCognitiveMapCreator.h"
#include "./cognitiveMap/cognitivemap.h"
#include <vector>
#include <map>
#include "../../geometry/Room.h"
#include "../../geometry/SubRoom.h"
#include "../../geometry/Building.h"
#include "../../geometry/Crossing.h"
#include "../../geometry/Transition.h"
#include "../../pedestrian/Pedestrian.h"
EmptyCognitiveMapCreator::~EmptyCognitiveMapCreator()
{
return;
}
CognitiveMap * EmptyCognitiveMapCreator::CreateCognitiveMap(const Pedestrian * ped)
{
CognitiveMap * cm = new CognitiveMap(_building, ped);
return cm;
}
/**
* \file EmptyCognitiveMapCreator.h
* \date Feb 1, 2014
* \version v0.7
* \copyright <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved.
*
* \section License
* This file is part of JuPedSim.
*
* JuPedSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* JuPedSim 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 Lesser General Public License
* along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
*
* \section Description
*
*
**/
#ifndef EMPTYCOGNITIVEMAPCREATOR_H
#define EMPTYCOGNITIVEMAPCREATOR_H 1
#include "AbstractCognitiveMapCreator.h"
class Building;
class EmptyCognitiveMapCreator : public AbstractCognitiveMapCreator {
public:
EmptyCognitiveMapCreator(const Building * b) : AbstractCognitiveMapCreator(b) { }
virtual ~EmptyCognitiveMapCreator();
CognitiveMap * CreateCognitiveMap(const Pedestrian * ped);
private:
};
#endif // EMPTYCOGNITIVEMAPCREATOR_H
/**
* \file CognitiveMapRouter.cpp
* \file AIRouter.cpp
* \date Feb 1, 2014
* \version v0.7
* \copyright <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved.
......@@ -26,7 +26,7 @@
**/
#include "CognitiveMapRouter.h"
#include "AIRouter.h"
#include "../Router.h"
#include "BrainStorage.h"
......@@ -41,7 +41,7 @@
#include "../../pedestrian/Pedestrian.h"
#include "../../tinyxml/tinyxml.h"
CognitiveMapRouter::CognitiveMapRouter()
AIRouter::AIRouter()
{
building=nullptr;
// cm_storage=nullptr;
......@@ -49,21 +49,21 @@ CognitiveMapRouter::CognitiveMapRouter()
}
CognitiveMapRouter::CognitiveMapRouter(int id, RoutingStrategy s) : Router(id, s)
AIRouter::AIRouter(int id, RoutingStrategy s) : Router(id, s)
{
building=nullptr;
// cm_storage=nullptr;
// sensor_manager=nullptr;
}
CognitiveMapRouter::~CognitiveMapRouter()
AIRouter::~AIRouter()
{
//delete brain_storage;
delete sensor_manager;
}
int CognitiveMapRouter::FindExit(Pedestrian * p)
int AIRouter::FindExit(Pedestrian * p)
{
//check for former goal.
if((*brain_storage)[p]->GetCognitiveMap().GetGraphNetwork()->HadNoDestination()) {
......@@ -108,7 +108,7 @@ int CognitiveMapRouter::FindExit(Pedestrian * p)
return 1;
}
int CognitiveMapRouter::FindDestination(Pedestrian * p)
int AIRouter::FindDestination(Pedestrian * p)
{
// Discover doors
sensor_manager->execute(p, SensorManager::NO_WAY);
......@@ -177,7 +177,7 @@ int CognitiveMapRouter::FindDestination(Pedestrian * p)
bool CognitiveMapRouter::Init(Building * b)
bool AIRouter::Init(Building * b)
{
Log->Write("INFO:\tInit the Cognitive Map Router Engine");
building = b;
......@@ -200,17 +200,17 @@ bool CognitiveMapRouter::Init(Building * b)
}
const optStorage &CognitiveMapRouter::getOptions() const
const optStorage &AIRouter::getOptions() const
{
return options;
}
void CognitiveMapRouter::addOption(const std::string &key, const std::vector<std::string> &value)
void AIRouter::addOption(const std::string &key, const std::vector<std::string> &value)
{
options.insert(std::make_pair(key, value));
}
bool CognitiveMapRouter::LoadRoutingInfos(const std::string &filename)
bool AIRouter::LoadRoutingInfos(const std::string &filename)
{
if(filename=="") return true;
......@@ -285,7 +285,7 @@ bool CognitiveMapRouter::LoadRoutingInfos(const std::string &filename)
return true;
}
std::string CognitiveMapRouter::GetRoutingInfoFile()
std::string AIRouter::GetRoutingInfoFile()
{
TiXmlDocument doc(building->GetProjectFilename());
......
......@@ -27,8 +27,8 @@
**/
#ifndef COGNITIVEMAPROUTER_H_
#define COGNITIVEMAPROUTER_H_
#ifndef AIROUTER_H_
#define AIROUTER_H_
#include "../Router.h"
#include <string>
......@@ -43,7 +43,7 @@ class NavLine;
/**
* @brief Routing Engine for Cognitive Map
* @brief Routing Engine for Cognitive Map/ Smoke Sensor / Perception Abilities
*
*
*/
......@@ -52,11 +52,11 @@ class NavLine;
//c++11 alias: Container to store options for the router (i. a. sensors)
using optStorage = std::unordered_map<std::string,std::vector<std::string> >;
class CognitiveMapRouter: public Router {
class AIRouter: public Router {
public:
CognitiveMapRouter();
CognitiveMapRouter(int id, RoutingStrategy s);
virtual ~CognitiveMapRouter();
AIRouter();
AIRouter(int id, RoutingStrategy s);
virtual ~AIRouter();
virtual int FindExit(Pedestrian* p);
......
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