diff --git a/legacy_header_files/forces.h b/legacy_header_files/forces.h deleted file mode 100644 index f6287eb..0000000 --- a/legacy_header_files/forces.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once -#include -#include - -// Params -// TODO: change this -// $\tau$ -const double TAU = 1.0; // time to reach desired speed in s - -// TODO: change this -// $V^0_{\alpha \beta}$ -const double V0_AB = 2.1; - -// TODO: change this -// $\sigma$ -const double SIGMA = 0.3; - -// TODO: change this -// $U^0_{\alpha B}$ -const double U0_AB = 10.0; - -// TODO: change this -// $R$ -const double R = 0.2; - -// TODO: change this -// $C$ -const double C = 0.2; - -// TODO: change this -// $\phi$ -// Field of view -const double PHI_DEG = 200.0; - -// TODO: change this -const double DISTANCE = 2.0; - -// Helper functions - -Vector2d get_desired_direction(Pedestrian &p); - -Vector2d get_actual_direction(Pedestrian &p); - -double w(Vector2d e, Vector2d f); - -// Force functions - -void compute_acceleration_term(Pedestrian *p); - -void compute_repulsive_effects_from_pedestrians(Pedestrian *P, Pedestrian *p, int N); - -void compute_repulsive_effects_from_borders(Sidewalk &S, Pedestrian *p); diff --git a/legacy_header_files/pedestrian.h b/legacy_header_files/pedestrian.h deleted file mode 100644 index d95c426..0000000 --- a/legacy_header_files/pedestrian.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include - -struct Pedestrian { - Pedestrian() : curr_pos(), next_pos(), curr_vel(), next_vel(), destination(), desired_next_node(), actual_next_node(), F_i(), desired_v0(1.34), actual_v0(1.34), vMax(1.34 * 1.3) {} - Pedestrian(Vector2d c_p, Vector2d n_p, Vector2d c_v, Vector2d n_v, Vector2d d, Vector2d d_n_n, Vector2d a_n_n, Vector2d f) : curr_pos(c_p), next_pos(n_p), curr_vel(c_v), next_vel(n_v), destination(d), desired_next_node(d_n_n), actual_next_node(a_n_n), F_i(f) {} - Vector2d curr_pos; // $\vectorarrow{r}_\alpha(t)$ - Vector2d next_pos; // $\vectorarrow{r}_\alpha(t+1)$ position, curr_pos is needed because when calculating the force on pedestrian j, we need the old pos, not the updated - Vector2d curr_vel; - Vector2d next_vel; // velocity - Vector2d destination; // $\vectorarrow{r}^0_\alpha$ - Vector2d desired_next_node; // $\vectorarrow{r}^k_\alpha$ - Vector2d actual_next_node; // $\vectorarrow{r}^k_\alpha$ should be the same as desired_next_node but with obstacles it changes - Vector2d F_i; // social force - double desired_v0; // $v_\alpha^0$ desired speed in m/s e.g. 1.34 - double actual_v0; - double vMax; // vMax = v0 * 1.3 - // direction Vector2d e = (dest - curr.position).norm() --> calculate on the fly or part of struct? - void update() { - curr_pos = next_pos; - curr_vel = next_vel; - } -}; \ No newline at end of file diff --git a/legacy_header_files/sidewalk.h b/legacy_header_files/sidewalk.h deleted file mode 100644 index 7419191..0000000 --- a/legacy_header_files/sidewalk.h +++ /dev/null @@ -1,10 +0,0 @@ -# pragma once -# include - -// initialize map -struct Sidewalk{ - double length, width; - Vector2d* obstacles; // array containing the position of each obstacle - int n_obstacles; // number of obstacles - Sidewalk(double l, double w, int n, Vector2d* obs) : length(l), width(w), n_obstacles(n), obstacles(obs) {} -}; \ No newline at end of file diff --git a/legacy_header_files/vector2d.h b/legacy_header_files/vector2d.h deleted file mode 100644 index d20bda1..0000000 --- a/legacy_header_files/vector2d.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once -#include - -struct Vector2d { - double x, y; - Vector2d(double a, double b) : x(a), y(b) {} - Vector2d() : x(.0), y(.0) {} - Vector2d operator+(Vector2d v) const { return Vector2d(v.x + x, v.y + y); } - Vector2d operator-(Vector2d v) const { return Vector2d(x - v.x, y - v.y); } - Vector2d operator-(double a) const { return Vector2d(x - a, y - a); } - Vector2d operator+(double a) const { return Vector2d(x + a, y + a); } - Vector2d operator/(double a) const { return Vector2d(x / a, y / a); } - Vector2d operator*(double a) const { return Vector2d(x * a, y * a); } - Vector2d operator+=(const Vector2d &v) { - *this = *this + v; - return *this; - } - double norm() { return sqrt(x * x + y * y); } - double dot(Vector2d v) { return x * v.x + y * v.y; } - void reset() { - x = 0; - y = 0; - } -}; \ No newline at end of file