VIPRA Documentation
Loading...
Searching...
No Matches
Goals Modules

Required Methods

In addition to the Base Module requirements Goals require the following:

VIPRA_GOALS_INIT_STEP {}
VIPRA_GOALS_UPDATE_STEP {}
VIPRA_GOALS_NEXT_GOAL {}
VIPRA_GOALS_CHANGE_GOAL {}

Required Method Details

VIPRA_GOALS_INIT_STEP {}
// aka
void init_step(VIPRA::Modules::Pedestrians const& pedset, VIPRA::Modules::Map const& map, VIPRA::Random::Engine& engine);
Base Map Module Class.
Definition map.hpp:23
Base Pedestrians module.
Definition pedestrians.hpp:35
Psuedo Random number engine.
Definition random.hpp:22

Parameters

  • pedset - Pedestrians module implementation
  • obstalces - Obstalces module implementation

Returns

NONE

Expected Effects

Each pedestrian has their goals initialized and ready for the first timestep of the simulation


VIPRA_GOALS_UPDATE_STEP {}
// aka
void update_step(VIPRA::Modules::Pedestrians const& pedset, VIPRA::Modules::Map const& map, VIPRA::delta_t deltaT);

Called each timestep

Parameters

  • pedset - Pedestrians module implementation
  • obstalces - Obstalces module implementation
  • deltaT : VIPRA::f_pnt - amount of time since last time step

Returns

NONE

Expected Effects

Each pedestrian has their current goals updated, if not already handled in VIPRA_GOALS_NEXT_GOAL


VIPRA_GOALS_NEXT_GOAL
// aka
bool next_goal(VIPRA::idx pedIdx, VIPRA::Modules::Pedestrians const& pedset, VIPRA::Modules::Map const& map, VIPRA::delta_t deltaT);

Called when a pedestrian reaches their current goal

Parameters

  • pedIdx : VIPRA::idx - ID of pedestrian that has reached their current goal
  • pedset - Pedestrians module implementation
  • obstalces - Obstalces module implementation
  • deltaT : VIPRA::f_pnt - amount of time since last time step

Returns

bool: true if the pedestrian has reached their final goal, false if not

Expected Effects

Pedestrian # pedIdx has their current goal updated, if not already handled in VIPRA_GOALS_UPDATE_STEP


VIPRA_GOALS_CHANGE_GOAL
// aka
void change_end_goal(VIPRA::idx pedIdx, VIPRA::f3d currPos, VIPRA::f3d goalPos);
Definition f3d.hpp:27

Called from Behaviors

Parameters

  • pedIdx : VIPRA::idx - ID of pedestrian to update
  • currPos : VIPRA::f3d - the current position of the pedestrian to update
  • goalPos : VIPRA::f3d - the position of the new end goal

Returns

NONE

Expected Effects

Pedestrian # pedIdx has their end goal changed to goalPos