121 lines
2.5 KiB
C++
121 lines
2.5 KiB
C++
#pragma once
|
|
#include <cmath>
|
|
#include <new>
|
|
|
|
//
|
|
// $\frac{1}{\tau_{\alpha}}$; $\tau_{\alpha} = 0.5s$
|
|
//
|
|
const float tau_alpha_inv = 2.0;
|
|
|
|
// $V^0_{\alpha \beta}$
|
|
const float V0_AB = 2.1;
|
|
|
|
// $\sigma$
|
|
const float SIGMA = 0.3;
|
|
|
|
//
|
|
// $\frac{-1}{2\sigma}$
|
|
//
|
|
const float NEG_TWO_SIGMA_INV = -1.0 / (2 * SIGMA);
|
|
|
|
//
|
|
// $\frac{-V^0_{\alpha\beta}}{2\sigma}$
|
|
//
|
|
const float NEG_V0_AB_div_TWO_SIGMA = V0_AB * NEG_TWO_SIGMA_INV;
|
|
|
|
// $U^0_{\alpha B}$
|
|
const float U0_AB = 10.0;
|
|
|
|
// $R$
|
|
const float R = 0.2;
|
|
|
|
//
|
|
// $\frac{-1}{R}$
|
|
//
|
|
const float NEG_R_INV = -1.0 / R;
|
|
|
|
//
|
|
// $\frac{-U^0_{\alpha B}}{R}$
|
|
//
|
|
const float NEG_U0_AB_div_R = -U0_AB / R;
|
|
|
|
// $-c$
|
|
const float c_neg = -0.5;
|
|
|
|
// $\varphi$
|
|
const float phi = 100.0 / 180.0 * M_PI;
|
|
|
|
// $cos(\varphi)$
|
|
const float cos_phi = cos(phi);
|
|
|
|
//
|
|
// $\frac{1}{cos(\varphi)}$
|
|
//
|
|
const float cos_phi_inv = 1 / cos(phi);
|
|
|
|
// $<v^0>$
|
|
const float v0_mean = 1.34;
|
|
|
|
// $\sqrt{\theta}$
|
|
const float v0_std_dev = 0.26;
|
|
|
|
// $\varDelta_{t}$
|
|
const float delta_t = 2;
|
|
|
|
// $\varDelta_{t}^2$
|
|
const float delta_t_sq = delta_t * delta_t;
|
|
|
|
// $dt$
|
|
const float dt = 0.02;
|
|
|
|
// $-dt$
|
|
const float dt_neg = -dt;
|
|
|
|
// $-c \cdot dt$
|
|
const float c_neg_times_dt = c_neg * dt;
|
|
|
|
//
|
|
// $\frac{1}{\tau_{\alpha}} \cdot dt$
|
|
//
|
|
const float dt_times_tau_alpha_inv = dt * tau_alpha_inv;
|
|
|
|
const float cost_add = 1;
|
|
const float cost_mult = 1;
|
|
const float cost_div = 1;
|
|
|
|
// https://acl.inf.ethz.ch/teaching/fastcode/knowledgebase/#:~:text=How%20do%20exp(x)%2C%20sin(x)%2C%20etc.%20count%20in%20the%20flopcount%20of%20an%20algorithm%3F
|
|
const float cost_exp = 30;
|
|
|
|
// -O3 maps each sqrt() call to an instruction
|
|
const float cost_sqrt = 1;
|
|
|
|
// Numerical tolerance used to avoid division by zero and unstable operations
|
|
// when distances or norms are extremely small.
|
|
const float EPS = 1e-9;
|
|
|
|
// Squared numerical tolerance
|
|
const float EPS_SQ = EPS * EPS;
|
|
|
|
// Cutoff for pedestrian-pedestrian repulsion
|
|
const float CUTOFF = 12.0;
|
|
const float CUTOFF_SQ = CUTOFF * CUTOFF;
|
|
|
|
const float cos_phi_sq = cos_phi * cos_phi;
|
|
|
|
const size_t CACHE_BLOCK_SIZE = std::hardware_destructive_interference_size;
|
|
|
|
const float c0_scalar = 1.0 / 1;
|
|
const float c1_scalar = 1.0 / 1;
|
|
const float c2_scalar = 1.0 / 2;
|
|
const float c3_scalar = 1.0 / 6;
|
|
const float c4_scalar = 1.0 / 24;
|
|
const float c5_scalar = 1.0 / 120;
|
|
const float c6_scalar = 1.0 / 720;
|
|
const float c7_scalar = 1.0 / 5040;
|
|
const float c8_scalar = 1.0 / 40320;
|
|
const float c9_scalar = 1.0 / 362880;
|
|
const float c10_scalar = 1.0 / 3628800;
|
|
const float c11_scalar = 1.0 / 39916800;
|
|
const float c12_scalar = 1.0 / 479001600;
|
|
const float c13_scalar = 1.0 / 6227020800;
|