#include <psi_cylinder_world.h>
kjb::psi::Simple_simulator::Simple_simulator |
( |
| ) |
|
|
inline |
void kjb::psi::Simple_simulator::execute_action |
( |
size_t |
time, |
|
|
Action_context & |
context |
|
) |
| |
|
inlineprotected |
Run an action for N time-steps. Saves the state at every time-step in the state log, and updates the time counter.
- Parameters
-
time | The time index to start running the action. After returning, time will be updated to be the time index for the next action to start running. |
- Precondition
- All states for entity at previous times have already been computed.
void kjb::psi::Simple_simulator::execute_follow_action |
( |
size_t |
time, |
|
|
Action_context & |
context |
|
) |
| |
|
protected |
Handler for "follow" action.
- Parameters
-
time | The time index to start running the action. After returning, time will be updated to be the time index for the next action to start running. Must be > 0. |
entity_1 | the actor that is being followed |
entity_2 | the actor is following entity_1 |
- Returns
- Amount to add to next action's duration, to account for time discretization over/underrun error.
- Precondition
- All states for entity at previous times have already been computed.
- See Also
- execute_action
void kjb::psi::Simple_simulator::execute_null_action |
( |
size_t |
time, |
|
|
Action_context & |
context |
|
) |
| |
|
protected |
void kjb::psi::Simple_simulator::execute_walk_action |
( |
size_t |
time, |
|
|
Action_context & |
context |
|
) |
| |
|
protected |
Handler for "walk" action.
- Precondition
- All previous states for all entities have been computed.
-
Current states for all dependency entities have been computed.
- See Also
- execute_action
void kjb::psi::Simple_simulator::execute_walk_in_arc_action |
( |
size_t |
time, |
|
|
Action_context & |
context |
|
) |
| |
|
protected |
Handler for "walk-and-turn" action
- Parameters
-
time | The time index to start running the action. After returning, time will be updated to be the time index for the next action to start running. Must be > 0. |
void kjb::psi::Simple_simulator::execute_walk_through_points_action |
( |
size_t |
time, |
|
|
Action_context & |
context |
|
) |
| |
|
protected |
Handler for "walk_though_points" action.
- Parameters
-
time | The time index to start running the action. After returning, time will be updated to be the time index for the next action to start running. Must be > 0. |
- Returns
- Amount to add to next action's duration, to account for time discretization over/underrun error.
- Precondition
- All states for entity at previous times have already been computed.
- See Also
- execute_action
double kjb::psi::Simple_simulator::get_actions_length |
( |
const std::vector< Action > & |
actions | ) |
|
|
protected |
return the length of simulation, as defined by a sequence of extended actions
If multiple cylinders, and one's actions take longer than another's, this adds a null action to the shorter one so they're all the same length.
- Precondition
- total duration of all actions is <= duration
const std::vector<std::vector<std::vector<Entity_state> > >& kjb::psi::Simple_simulator::get_entity_states |
( |
| ) |
const |
|
inline |
returns 2d array or entity states, indexed by states[actor][frame]
std::vector< size_t > kjb::psi::Simple_simulator::quantize_action_durations |
( |
const std::vector< Action > & |
actions | ) |
|
|
protected |
Convert action durations from seconds (float point) to sample counts (integers). Takes care to not accumulate drift over long trajectories.
std::vector<double> kjb::psi::Simple_simulator::quantize_walk_through_points_action |
( |
const std::vector< double > & |
parameters | ) |
|
|
protected |
Document soon... Quantize the WALK_THROUGH_POINTS_ACTION into
void kjb::psi::Simple_simulator::set_sampling_rate |
( |
double |
r | ) |
|
|
inline |
bool kjb::psi::Simple_simulator::simulate |
( |
const std::vector< std::vector< Start_state > > & |
start_state, |
|
|
const std::vector< std::vector< std::vector< Action > > > & |
actions |
|
) |
| |
The documentation for this class was generated from the following files: