Commit 79d3e39b authored by Ulrich Kemloh's avatar Ulrich Kemloh

few comments and todos

parent 482d587a
......@@ -51,7 +51,6 @@ JPSclient::~JPSclient()
void JPSclient::ProcessAgentQueue(Building* building)
{
std::vector<Pedestrian*> peds;
//cout<<"size:"<<AgentsQueueOut::Size()<<endl;
AgentsQueueOut::GetandClear(peds);
for (auto && ped:peds)
{
......
......@@ -72,8 +72,7 @@ void JPSserver::RunSimulation()
_jpsClient->NotifyEndOfSimulation();
}
//Log->Write("INFO:\tRPC::JPSserver idle for 3 seconds");
//std::this_thread::sleep_for(std::chrono::milliseconds(500));
}while(!_shutdown);
_SimManager.RunFooter();
......@@ -85,6 +84,7 @@ Status JPSserver::reqMATSim2ExternHasSpace(ServerContext* context __attribute__(
{
string nodeID=request->nodeid();
//Log->Write("INFO:\tRPC::JPSserver I have space on node " + nodeID);
//TODO: call the voronoi implementation and check if there is a spot
response->set_hasspace(true);
return Status::OK;
}
......
......@@ -50,6 +50,7 @@ message Extern2MATSimTrajectories {
}
optional double time = 1;
//
repeated Agent agent = 15;
}
......
......@@ -32,7 +32,6 @@
#include "StartDistribution.h"
#include "PedDistributor.h"
#include "AgentsSource.h"
//#include "../voronoi/VoronoiDiagramGenerator.h"
#include "../geometry/Building.h"
#include "../geometry/Point.h"
......@@ -156,6 +155,7 @@ void AgentsSourcesManager::ComputeBestPositionCompleteRandom(AgentsSource* src,
auto subroom = _building->GetRoom(dist->GetRoomId())->GetSubRoom(dist->GetSubroomID());
vector<Point> positions = PedDistributor::PossiblePositions(*subroom);
//TODO: get the seed from the simulation
srand (time(NULL));
for (auto& ped : peds)
......
#!/bin/sh
old_version='v0.7'
new_version='v0.7'
new_version='v0.8'
#old_version='http://134.94.2.137/jps_ini_core.xsd'
......
......@@ -64,7 +64,6 @@ using namespace std;
//TODO: refactor the function
bool IsEnoughInSubroom( SubRoom* subroom, Point& pt, double radius )
{
//TODO: code refactoring:
for (const auto& wall: subroom->GetAllWalls())
if(wall.DistTo(pt)<radius)
return false;
......@@ -185,6 +184,8 @@ bool ComputeBestPositionVoronoiBoost(AgentsSource* src, std::vector<Pedestrian*>
no++;
}
//TODO: dividing by 0 when existing_peds is empty
// sum up the weighted velocity in the loop
v = v/no; //this is the mean of all velocities
//adding fake people to the vector for constructing voronoi diagram
......@@ -386,7 +387,7 @@ void VoronoiBestVertexRand (const std::vector<Point>& discrete_positions, const
}
}
//now we have all the possible vertices and their distances and we can choose one randomly
//TODO: get the seed from the simulation/argumentparser
srand (time(NULL));
unsigned int i = rand() % possible_vertices.size();
chosen_it = possible_vertices[i];
......
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