22 #ifndef PSI_VERSION_1_ACTION_H
23 #define PSI_VERSION_1_ACTION_H
31 #include <boost/function.hpp>
104 std::vector<std::string> param_names_,
105 std::vector<Unit_type> param_units_,
106 boost::function1<double, const Action&> get_duration_,
109 boost::function1<bool, const Action&> validator_) :
160 const std::vector<std::vector<double> >&
points
239 return (param_size - 1) / 3;
245 return (1 + (3 * i + 0));
251 return (1 + (3 * i + 1));
257 return (1 + (3 * i + 2));
261 std::ostream&
operator<<(std::ostream& ost,
const Action& action);
264 std::istream&
operator>>(std::istream& ist, Action& action);
Action_type type
Definition: psi_action.h:122
Unit_type get_units(Action_type a, size_t i)
Definition: psi_action.cpp:322
boost::function1< double, const Action & > get_duration
Definition: psi_action.h:128
bool is_relative
Definition: psi_action.h:145
Action make_follow_action(double duration, size_t parent_type, size_t parent_index, double time_behind)
Definition: psi_action.h:168
std::ostream & operator<<(std::ostream &ost, const Action &action)
serialize an action
Definition: psi_action.cpp:333
std::vector< double > parameters
Definition: psi_action.h:85
std::istream & operator>>(std::istream &ist, Action &action)
unserialize an action
Definition: psi_action.cpp:346
Unit_type
Definition: psi_units.h:30
size_t to_x_index(size_t i)
Get the x index of the i'th point.
Definition: psi_action.h:243
Definition: psi_action.h:58
Definition: psi_action.h:96
int parent_type
Definition: psi_action.h:88
Action_descriptor()
Definition: psi_action.h:98
Definition: psi_action.h:58
int parent_index
Definition: psi_action.h:89
Action_type
Definition: psi_action.h:58
size_t to_z_index(size_t i)
Get the z index of the i'th point.
Definition: psi_action.h:249
const std::string & get_name(Action_type t)
Convert Action_type to string.
Definition: psi_action.cpp:198
size_t num_params
Definition: psi_action.h:124
Action()
Definition: psi_action.h:78
std::vector< std::string > param_names
Definition: psi_action.h:125
Definition: psi_action.h:59
Action_type type
Definition: psi_action.h:84
size_t to_time_index(size_t i)
Get the time point index of the i'th point.
Definition: psi_action.h:255
Action make_walk_through_points_action(const std::vector< std::vector< double > > &points)
Construct a walk along the trajectory specified by the points.
Definition: psi_action.cpp:251
bool fixed_length
Definition: psi_action.h:138
boost::function1< bool, const Action & > validator
Definition: psi_action.h:147
Definition: psi_action.h:76
Definition: tracking_entity.h:43
std::string name
Definition: psi_action.h:123
Action parse_cli_action(const std::string &str)
read an action that is specified using command-line-interface format
Definition: psi_action.cpp:382
void validate(Action_type a)
check that action_type represents an actual descriptor.
Definition: psi_action.cpp:238
get the indices of edges in each direction for i
Definition: APPgetLargeConnectedEdges.m:48
Action make_null_action(double duration)
Construct a null action.
Definition: psi_action.h:220
Action_descriptor(Action_type type_, std::string name_, size_t num_params_, std::vector< std::string > param_names_, std::vector< Unit_type > param_units_, boost::function1< double, const Action & > get_duration_, bool fixed_length_, bool is_relative_, boost::function1< bool, const Action & > validator_)
Definition: psi_action.h:100
Support for error handling exception classes in libKJB.
Definition: psi_action.h:58
struct memorypool points
Definition: triangle.c:637
std::vector< Unit_type > param_units
Definition: psi_action.h:126
Definition: psi_action.h:58
double get_action_duration(const Action &action)
Definition: psi_action.cpp:232
Action make_walk_action(double duration, double speed)
Construct a walk action.
Definition: psi_action.h:188
Action_type action_name_to_type(const std::string &name)
Convert string to Action_type.
Definition: psi_action.cpp:212
size_t get_num_waypoints(size_t param_size)
Get the number of waypoints from the size of the parameters parameters is in size of 3*num_waypoints+...
Definition: psi_action.h:237
Action make_walk_in_arc_action(double duration, double speed, double angular_speed)
Construct a walk-in-arc action.
Definition: psi_action.h:202