#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; } };