-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper.hpp
28 lines (22 loc) · 873 Bytes
/
helper.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef HELPER
#define HELPER
#include "boid.hpp"
#include "config.hpp"
#include <algorithm>
#include <iostream>
#include <random>
#include <vector>
std::vector<Boid>
generateBoids(int numBoids, double xMin, double xMax, double yMin, double yMax,
double vxMin = -Config::getInstance().getVMax() / 4,
double vxMax = Config::getInstance().getVMax() / 4,
double vyMin = -Config::getInstance().getVMax() / 4,
double vyMax = Config::getInstance().getVMax() / 4);
// I've avoided calling every time vector.size() in for (int i ...) so used
// iterators
void lazyUpdateNeighbors(std::vector<Boid>& boids);
std::pair<double, double>
averageDistanceAndStdDev(std::vector<Boid> const& boids);
std::pair<std::pair<double, double>, std::pair<double, double>>
averageVelocityAndStdDev(std::vector<Boid> const& boids);
#endif