18 VIPRA_MODULE_NAME(
"Calm")
19 VIPRA_MODULE_TYPE(Model)
21 VIPRA_REGISTER_PARAMS(VIPRA_PARAM(
"meanMass", _config.meanMass),
22 VIPRA_PARAM(
"massStdDev", _config.massStdDev),
23 VIPRA_PARAM(
"meanMass", _config.meanMass),
24 VIPRA_PARAM(
"massStdDev", _config.massStdDev),
25 VIPRA_PARAM(
"meanReactionTime", _config.meanReactionTime),
26 VIPRA_PARAM(
"reactionTimeStdDev", _config.reactionTimeStdDev),
27 VIPRA_PARAM(
"meanMaxSpeed", _config.meanMaxSpeed),
28 VIPRA_PARAM(
"maxSpeedStdDev", _config.maxSpeedStdDev),
29 VIPRA_PARAM(
"meanShoulderLen", _config.meanShoulderLen),
30 VIPRA_PARAM(
"shoulderLenStdDev", _config.shoulderLenStdDev),
31 VIPRA_PARAM(
"collisionRange", _config.collisionRange),
32 VIPRA_PARAM(
"friction", _config.frictionCoef))
39 _peds.resize(pedset.num_pedestrians());
40 _collision.initialize(_config.collisionRange, pedset);
42 _peds.masses = VIPRA::Random::make_distribution(
43 std::normal_distribution<VIPRA::f_pnt>{_config.meanMass, _config.massStdDev},
44 _peds.size(), engine);
45 _peds.reactionTimes = VIPRA::Random::make_distribution<>(
46 std::normal_distribution<VIPRA::f_pnt>{_config.meanReactionTime,
47 _config.reactionTimeStdDev},
48 _peds.size(), engine);
49 _peds.maxSpeeds = VIPRA::Random::make_distribution<>(
50 std::normal_distribution<VIPRA::f_pnt>{_config.meanMaxSpeed,
51 _config.maxSpeedStdDev},
52 _peds.size(), engine);
53 _peds.shoulderLens = VIPRA::Random::make_distribution<>(
54 std::normal_distribution<VIPRA::f_pnt>{_config.meanShoulderLen,
55 _config.shoulderLenStdDev},
56 _peds.size(), engine);
62 calc_shoulders(pedset.all_coords(), goals.current_goals());
63 calc_neighbors(pedset, goals, map);
65 if ( timestep % 100 == 0 ) _collision.race_detection(pedset, goals, _peds);
67 update_state(pedset, goals, state, deltaT);
79 VIPRA::delta_t deltaT);
80 auto is_path_blocked(VIPRA::idx pedIdx,
VIPRA::f3d veloc, VIPRA::f_pnt maxDist,
83 void calc_shoulders(VIPRA::f3dVec
const&, VIPRA::f3dVec
const&);
89 auto rect_from_shoulders(VIPRA::idx,
VIPRA::f3d,
93 VIPRA_INLINE
static constexpr auto calc_beta(VIPRA::f_pnt distance) -> VIPRA::f_pnt
95 constexpr VIPRA::f_pnt VAL_A = -2.11;
96 constexpr VIPRA::f_pnt VAL_B = 0.366;
97 constexpr VIPRA::f_pnt VAL_C = 0.966;
98 return (VAL_C - std::exp(VAL_A * (distance - VAL_B)));