Commit ffc59926 authored by Oliver Schmidts's avatar Oliver Schmidts

fixing little bugs and karthiks memory error

parent 95086b3f
......@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <cstdlib>
#include <cmath>
using namespace std;
......@@ -56,8 +57,7 @@ int OutputHandler::GetErrors()
void OutputHandler::Write(const string& str)
{
if (this != NULL)
cout << str << endl;
cout << str << endl;
}
void OutputHandler::ProgressBar(double TotalPeds, double NowPeds)
......@@ -68,7 +68,7 @@ void OutputHandler::ProgressBar(double TotalPeds, double NowPeds)
int totaldotz=40;
double fraction = NowPeds / TotalPeds;
// part of the progressmeter that's already "full"
int dotz = round(fraction * totaldotz);
int dotz = static_cast<int>(round(fraction * totaldotz));
// create the "meter"
int ii=0;
......
......@@ -33,8 +33,17 @@
#include <vector>
OutputHandler* Log;
BOOST_AUTO_TEST_SUITE(SubRoomTest)
struct Handler {
Handler() {Log = new STDIOHandler();}
~ Handler() {delete Log;}
};
BOOST_GLOBAL_FIXTURE(Handler)
BOOST_AUTO_TEST_CASE(JTol_WallGap_test)
{
BOOST_MESSAGE("starting small gap between wall test");
......
......@@ -91,7 +91,7 @@ Pedestrian::Pedestrian()
_agentsCreated++;//increase the number of object created
}
Pedestrian::Pedestrian(const StartDistribution& agentsParameters, const Building& building)
Pedestrian::Pedestrian(const StartDistribution& agentsParameters, Building& building)
: _age(agentsParameters.GetAge()),
_gender(agentsParameters.GetGender()),
_height(agentsParameters.GetHeight()),
......
......@@ -135,7 +135,7 @@ private:
public:
// constructors
Pedestrian();
explicit Pedestrian(const StartDistributionSubroom& agentsParameters, const Building& building);
explicit Pedestrian(const StartDistribution& agentsParameters, Building& building);
virtual ~Pedestrian();
// Setter-Funktionen
......
......@@ -71,13 +71,13 @@ private:
double _yMax;
//pre movement time distribution
std::normal_distribution<double> _premovementTime;
mutable std::normal_distribution<double> _premovementTime;
//risk tolerance distribution
std::normal_distribution<double> _riskTolerance;
mutable std::normal_distribution<double> _riskTolerance;
//random number generator engine
std::default_random_engine _generator;
mutable std::default_random_engine _generator;
public:
StartDistribution(int seed);
......
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