Commit 9cf17046 authored by Andrijana Brkic's avatar Andrijana Brkic

Put my functions in a separate .h and .cpp file in the folder voronoi-boost

parent b0d69e25
......@@ -42,7 +42,7 @@
#include <chrono>
#include "AgentsQueue.h"
#include "../voronoi-boost/VoronoiPositionGenerator.h"
//a.brkic begin
#include "../geometry/SubRoom.h"
#include <stdlib.h>
......@@ -116,7 +116,7 @@ void AgentsSourcesManager::Run()
//it might be better to use a timer
_isCompleted = false;
bool finished = false;
long updateFrequency = 4; // 1 = second
long updateFrequency = 5; // 1 = second
do
{
int current_time = Pedestrian::GetGlobalTime();
......@@ -154,7 +154,7 @@ bool AgentsSourcesManager::ProcessAllSources() const
//ComputeBestPositionRandom(src.get(), peds);
//todo: compute the optimal position for insertion using voronoi
if( !ComputeBestPositionVoronoiBoost(src.get(), peds) )
if( !ComputeBestPositionVoronoiBoost(src.get(), peds, _building) )
Log->Write("INFO:\t there was no place for some pedestrians");
//ComputeBestPositionDummy( src.get(), peds );
/*for (auto&& ped : peds)
......@@ -309,7 +309,7 @@ void AgentsSourcesManager::ComputeBestPositionVoronoi(AgentsSource* src,
//exit(0);
}
*/
/*
bool AgentsSourcesManager::IsEnoughInSubroom( SubRoom* subroom, Point& pt ) const
{
vector<Wall> walls = subroom->GetAllWalls();
......@@ -613,7 +613,7 @@ void AgentsSourcesManager::VoronoiBestVertexRand (const std::vector<Point>& disc
dis = distances[i];
}
*/
void AgentsSourcesManager::ComputeBestPositionRandom(AgentsSource* src,
std::vector<Pedestrian*>& peds) const
......
......@@ -134,44 +134,44 @@ private:
*/
void ComputeBestPositionVoronoi(AgentsSource* src, Pedestrian* agent) const;
bool IsEnoughInSubroom( SubRoom* subroom, Point& pt ) const;
/*bool IsEnoughInSubroom( SubRoom* subroom, Point& pt ) const; */
/**
* Position incoming pedestrian using voronoi from boost library
* @param src
* @param ped
*/
void ComputeBestPositionVoronoiBoost(AgentsSource* src,Pedestrian* ped) const;
/* void ComputeBestPositionVoronoiBoost(AgentsSource* src,Pedestrian* ped) const;*/
/**
* Position incoming pedestrian using voronoi from boost library
* @param src
* @param peds
*/
bool ComputeBestPositionVoronoiBoost(AgentsSource* src, std::vector<Pedestrian*>& peds) const;
/*bool ComputeBestPositionVoronoiBoost(AgentsSource* src, std::vector<Pedestrian*>& peds) const;*/
void ComputeBestPositionDummy(AgentsSource* src, std::vector<Pedestrian*>& peds) const;
/**Position incoming pedestrian on the vertex with the greatest distance
*
*/
void VoronoiBestVertexMax (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis ) const ;
/*void VoronoiBestVertexMax (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis ) const ; */
/**Position incoming pedestrian on the vertex with greater probability for greater distances
*
*/
void VoronoiBestVertexRandMax (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis ) const ;
/*void VoronoiBestVertexRandMax (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis ) const ;*/
/**Position incoming pedestrian on a random vertex
*
*/
void VoronoiBestVertexRand (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis ) const ;
/*void VoronoiBestVertexRand (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis ) const ;*/
void VoronoiAdjustVelocityNeighbour( const voronoi_diagram<double>& vd, voronoi_diagram<double>::const_vertex_iterator& chosen_it,
Pedestrian* ped, const std::vector<Point>& velocities_vector ) const;
/* void VoronoiAdjustVelocityNeighbour( const voronoi_diagram<double>& vd, voronoi_diagram<double>::const_vertex_iterator& chosen_it,
Pedestrian* ped, const std::vector<Point>& velocities_vector ) const;*/
/**
* Position incoming pedestrians randomly
......
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