Commit 145b98a5 authored by Erik Andresen's avatar Erik Andresen

Build failed in Jenkins: JPSCore Build #15: Problem solved!!

parent c3d1cdca
......@@ -231,7 +231,7 @@ set ( source_files
routing/cognitive_map/fire_mesh/FireMesh.cpp
routing/cognitive_map/fire_mesh/Knot.cpp
routing/cognitive_map/fire_mesh/FireMeshStorage.cpp
routing/cognitive_map/map_knowlegde/routeknowlegde.cpp
poly2tri/common/shapes.cpp
poly2tri/sweep/sweep_context.cpp
......@@ -274,7 +274,7 @@ set ( header_files
routing/cognitive_map/fire_mesh/FireMesh.h
routing/cognitive_map/fire_mesh/Knot.h
routing/cognitive_map/fire_mesh/FireMeshStorage.h
routing/cognitive_map/map_knowlegde/routeknowlegde.h
pedestrian/Pedestrian.h
pedestrian/PedDistributor.h
......
......@@ -50,9 +50,6 @@ CognitiveMap::CognitiveMap(const Building * building, const Pedestrian * pedestr
{
navigation_graph = new NavigationGraph(building);
}
CognitiveMap::~CognitiveMap()
......@@ -89,23 +86,23 @@ const GraphEdge * CognitiveMap::GetDestination()
{
SubRoom * sub_room = building->GetRoom(pedestrian->GetRoomID())->GetSubRoom(pedestrian->GetSubRoomID());
///Route Knowlegde
if (!_RKnowlegde.GetRememberedRooms().empty())
{
///Room seems to be familiar?
if (!_RKnowlegde.RoomIsFamiliar((*navigation_graph)[sub_room]))
{
/// not familiar (go back or use other tactics)
return nullptr;
}
else
{
return _RKnowlegde.NextDoorOnRoute((*navigation_graph)[sub_room]);
}
}
return nullptr;
// ///Route Knowlegde
// if (!_RKnowlegde.GetRememberedRooms().empty())
// {
// ///Room seems to be familiar?
// if (!_RKnowlegde.RoomIsFamiliar((*navigation_graph)[sub_room]))
// {
// /// not familiar (go back or use other tactics)
// return nullptr;
// }
// else
// {
// return _RKnowlegde.NextDoorOnRoute((*navigation_graph)[sub_room]);
// }
// }
// return nullptr;
return (*navigation_graph)[sub_room]->GetCheapestDestinationByEdges(pedestrian->GetPos());
}
......@@ -132,14 +129,14 @@ std::vector<const GraphEdge *>& CognitiveMap::GetDestinations()
return destinations;
}
void CognitiveMap::CreateRouteKnowlegde(const Pedestrian *pedestrian)
{
SubRoom * sub_room = building->GetRoom(pedestrian->GetRoomID())->GetSubRoom(pedestrian->GetSubRoomID());
NextDoorKnowlegde ndknowlegde = (*navigation_graph)[sub_room]->GetShortestPathFromHere(pedestrian->GetPos());
//void CognitiveMap::CreateRouteKnowlegde(const Pedestrian *pedestrian)
//{
// SubRoom * sub_room = building->GetRoom(pedestrian->GetRoomID())->GetSubRoom(pedestrian->GetSubRoomID());
// NextDoorKnowlegde ndknowlegde = (*navigation_graph)[sub_room]->GetShortestPathFromHere(pedestrian->GetPos());
_RKnowlegde = RouteKnowlegde(ndknowlegde);
// _RKnowlegde = RouteKnowlegde(ndknowlegde);
}
//}
bool CognitiveMap::ChangedSubRoom() const
{
......
......@@ -31,7 +31,7 @@
#define COGNITIVEMAP_H_
#include "NavigationGraph.h"
#include "./map_knowlegde/routeknowlegde.h"
//#include "./map_knowlegde/routeknowlegde.h"
#include <vector>
class SubRoom;
......@@ -74,8 +74,8 @@ public:
bool HadNoDestination() const;
void AddDestination(const GraphEdge *);
std::vector<const GraphEdge *> & GetDestinations();
/// Route knowlegde will be created using memory (depending on probabilites) of shortest path
void CreateRouteKnowlegde(const Pedestrian * pedestrian);
// Route knowlegde will be created using memory (depending on probabilites) of shortest path
//void CreateRouteKnowlegde(const Pedestrian * pedestrian);
bool ChangedSubRoom() const;
void UpdateSubRoom();
......@@ -86,7 +86,7 @@ private:
const Pedestrian * const pedestrian;
const SubRoom * current_subroom = NULL;
std::vector<const GraphEdge *> destinations;
RouteKnowlegde _RKnowlegde;
//RouteKnowlegde _RKnowlegde;
};
......
......@@ -73,7 +73,7 @@ CognitiveMap * CompleteCognitiveMapCreator::CreateCognitiveMap(const Pedestrian
}
///RouteKnowlegde
/// Remembered routes and assoziations between rooms and doors
cm->CreateRouteKnowlegde(ped);
//cm->CreateRouteKnowlegde(ped);
return cm;
}
......@@ -2,6 +2,11 @@
#include "../../../geometry/Building.h"
FireMeshStorage::FireMeshStorage()
{
}
FireMeshStorage::FireMeshStorage(const Building * const b, const std::string &filepath, const double &updateintervall, const double &finalTime)
{
_building=b;
......
......@@ -16,6 +16,7 @@ using fireMeshContainer = std::unordered_map<std::string, FireMesh>;
class FireMeshStorage
{
public:
FireMeshStorage();
FireMeshStorage(const Building * const b, const std::string &filepath, const double &updateintervall, const double &finalTime);
~FireMeshStorage();
void CreateTimeList(const double &updateIntervall, const double &finalTime, const double &startTime=0);
......
......@@ -20,7 +20,7 @@ SmokeSensor::SmokeSensor(const Building *b, const std::string &filepath, const d
std::shared_ptr<FireMeshStorage> FMS(new FireMeshStorage(b,filepath,updateintervall,finalTime));
Log->Write("INFO:\tInitialized FireMeshStorage (Smoke Sensor)");
_FMStorage=FMS;
}
......@@ -38,7 +38,7 @@ void SmokeSensor::execute(const Pedestrian * pedestrian, CognitiveMap * cognitiv
SubRoom * sub_room = building->GetRoom(pedestrian->GetRoomID())->GetSubRoom(pedestrian->GetSubRoomID());
GraphVertex * vertex = (*cognitive_map->GetNavigationGraph())[sub_room];
const GraphVertex::EdgesContainer * edges = vertex->GetAllEdges();
/// for every egde connected to the pedestrian's current vertex (room)
for (auto &item : *edges)
{
/// first: find Mesh corresponding to current edge and current simTime. Secondly get knotvalue from that mesh depending
......@@ -46,12 +46,13 @@ void SmokeSensor::execute(const Pedestrian * pedestrian, CognitiveMap * cognitiv
double smokeFactor = _FMStorage->get_FireMesh(item->GetCrossing()->GetCentre(),
pedestrian->GetGlobalTime()).GetKnotValue(pedestrian->GetPos().GetX(),
pedestrian->GetPos().GetY());
//double smokeFactor = 1;
//std::cout << smokeFactor << std::endl;
/// Set egde factor
item->SetFactor(smokeFactor,GetName());
//std::cout << item->GetFactor() << std::endl;
}
// const GraphVertex * smoked_room = NULL;
// for(GraphVertex::EdgesContainer::const_iterator it = edges->begi bn(); it != edges->end(); ++it) {
......
......@@ -33,6 +33,7 @@ public:
private:
std::shared_ptr<FireMeshStorage> _FMStorage;
};
#endif // SMOKESENSOR_H
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