Commit 05980c28 authored by Arne Graf's avatar Arne Graf

added ffRouter to EventManager

parent 49873bc1
......@@ -1050,6 +1050,7 @@ bool IniFileParser::ParseRoutingStrategies(TiXmlNode* routingNode, TiXmlNode* ag
}
}
}
_config->set_has_specific_goals(hasSpecificGoals);
for (TiXmlElement* e = routingNode->FirstChildElement("router"); e;
e = e->NextSiblingElement("router")) {
......
......@@ -49,6 +49,7 @@
#include "../routing/global_shortest/GlobalRouter.h"
#include "../routing/quickest/QuickestPathRouter.h"
#include "../routing/ai_router/AIRouter.h"
#include "../routing/ff_router/ffRouter.h"
#include "EventManager.h"
#include "Event.h"
......@@ -666,26 +667,33 @@ Router * EventManager::CreateRouter(const RoutingStrategy& strategy)
switch(strategy)
{
case ROUTING_LOCAL_SHORTEST:
rout = new GlobalRouter(ROUTING_LOCAL_SHORTEST, ROUTING_LOCAL_SHORTEST);
break;
case ROUTING_LOCAL_SHORTEST:
rout = new GlobalRouter(ROUTING_LOCAL_SHORTEST, ROUTING_LOCAL_SHORTEST);
break;
case ROUTING_GLOBAL_SHORTEST:
rout = new GlobalRouter(ROUTING_GLOBAL_SHORTEST, ROUTING_GLOBAL_SHORTEST);
break;
case ROUTING_QUICKEST:
rout = new QuickestPathRouter(ROUTING_QUICKEST, ROUTING_QUICKEST);
break;
case ROUTING_GLOBAL_SHORTEST:
rout = new GlobalRouter(ROUTING_GLOBAL_SHORTEST, ROUTING_GLOBAL_SHORTEST);
break;
case ROUTING_AI:
rout = new AIRouter(ROUTING_AI, ROUTING_AI);
break;
case ROUTING_QUICKEST:
rout = new QuickestPathRouter(ROUTING_QUICKEST, ROUTING_QUICKEST);
break;
case ROUTING_FF_GLOBAL_SHORTEST:
rout = new FFRouter(ROUTING_FF_GLOBAL_SHORTEST, ROUTING_FF_GLOBAL_SHORTEST, _building->GetConfig()->get_has_specific_goals(), _building->GetConfig());
break;
case ROUTING_AI:
rout = new AIRouter(ROUTING_AI, ROUTING_AI);
break;
case ROUTING_FF_QUICKEST:
rout = new FFRouter(ROUTING_FF_QUICKEST, ROUTING_FF_QUICKEST, _building->GetConfig()->get_has_specific_goals(), _building->GetConfig());
default:
Log->Write("ERROR: \twrong value for routing strategy [%d]!!!\n", strategy );
exit(EXIT_FAILURE);
break;
default:
Log->Write("ERROR: \twrong value for routing strategy [%d]!!!\n", strategy );
exit(EXIT_FAILURE);
break;
}
return rout;
......
......@@ -106,6 +106,9 @@ public:
//ff router quickest
_recalc_interval = 5;
//ff router
_has_specific_goals = false;
}
int GetSolver() const { return _solver; };
......@@ -241,6 +244,10 @@ public:
void set_recalc_interval(double recalc_interval) { _recalc_interval = recalc_interval; }
bool get_has_specific_goals() const {return _has_specific_goals;}
void set_has_specific_goals(bool has_specific_goals) { _has_specific_goals = has_specific_goals;}
const std::string& GetHostname() const { return _hostname; };
void SetHostname(std::string hostname) { _hostname = hostname; };
......@@ -343,6 +350,9 @@ private:
//ff router quickest
double _recalc_interval;
//ff router
bool _has_specific_goals;
std::string _hostname;
std::string _trajectoriesFile;
std::string _errorLogFile;
......
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