#include <Behavior.h>
Inheritance diagram for RobotFlow::Behavior:
Public Member Functions | |
Behavior (std::string nodeName, FD::ParameterSet params, std::string BehaviorName) | |
virtual void | calculate (int output_id, int count, FD::Buffer &out) |
virtual void | calculate_behavior (int output_id, int count, FD::Buffer &out)=0 |
int | get_behavior_id () |
virtual ObjectRef | getOutput (int output_id, int count) |
virtual void | request (int outputID, const ParameterSet &req) |
virtual void | initialize () |
virtual void | reset () |
virtual int | addOutput (const std::string &outputName) |
virtual int | addInput (const std::string &inputName) |
virtual void | initializeBuffers () |
virtual void | performRequests () |
virtual ObjectRef | getOutputNamed (const std::string &outputName, int count) |
virtual void | connectToNode (std::string in, Node *inputNode, std::string out) |
virtual bool | hasOutput (int output_id) const |
ObjectRef | getInput (int inputID, int count) |
virtual void | stop () |
virtual void | cleanupNotify () |
std::string | getName () |
virtual void | verifyConnect () |
void | printOn (std::ostream &out=std::cout) const |
void | setUINode (UINode *_uinode) |
void | ref () |
void | unref () |
int | unique () |
virtual void | destroy () |
virtual void | serialize (std::ostream &out) const |
virtual void | unserialize (std::istream &in) |
virtual void | doesNotUnderstand (std::string method) |
virtual bool | isNil () const |
virtual void | prettyPrint (std::ostream &out=std::cout) const |
virtual void | readFrom (std::istream &in=std::cin) |
virtual ObjectRef | clone () |
virtual std::string | className () const |
Static Public Member Functions | |
static int | register_behavior (const std::string &name) |
static int | find_behavior (const std::string &name) |
static bool | behavior_exists (const std::string &name) |
static int | get_behavior_size () |
static FD::Vector< std::string > & | get_behaviors () |
static void | remove_behavior (const std::string &name) |
static int | addFactory (const std::string &factoryName, _NodeFactory *const factory) |
static int | addXPM (const std::string &nodeName, char **XPMData) |
static char ** | getXPM (const std::string &nodeName) |
static _NodeFactory * | getFactoryNamed (const std::string &name) |
static std::map< std::string, _NodeFactory * > & | factoryDictionary () |
static std::vector< std::string > & | nodeInfo () |
static std::map< std::string, char ** > & | XPMDictionary () |
static int | addNodeInfo (const std::string &info) |
static ObjectRef | newObject (const std::string &objType) |
static int | addObjectType (const std::string &objType, _ObjectFactory *factory) |
static std::map< std::string, _ObjectFactory * > & | ObjectFactoryDictionary () |
static TypeMap< _ObjectFactory * > & | TypeidDictionary () |
Protected Member Functions | |
virtual void | connectToNode (unsigned int in, Node *inputNode, unsigned int out) |
virtual std::vector< NodeInput > & | getInputs () |
virtual int | translateInput (std::string inputName) |
virtual int | translateOutput (std::string inputName) |
virtual void | rt_assert (bool cond, std::string message="", char *_file="unknown", int _line=0) |
virtual void | construct_assert (bool cond, std::string message="", char *_file="unknown", int _line=0) |
virtual void | throw_error (bool send_ptr, std::string message, char *_file, int _line) |
Protected Attributes | |
int | m_activationID |
int | m_exploitationID |
int | m_last_exploitation |
int | m_behaviorID |
FD::ObjectRef | m_exploitationValue |
int | processCount |
std::vector< OutputCacheInfo > | outputs |
std::vector< InputCacheInfo > | inputsCache |
bool | inOrder |
std::string | name |
std::vector< NodeInput > | inputs |
std::vector< std::string > | outputNames |
ParameterSet | parameters |
UINode * | uinode |
AtomicCounter | ref_count |
Friends | |
friend std::ostream & | operator<< (std::ostream &out, const Object &obj) |
|
Constructor, called from the overflow core modules.
|
|
Verifies if a behavior is registered.
|
|
This function is required by the BufferedNode class. That's the core processing function called by the overflow engine. This function takes care to update the exploitation value and verifies if the Behavior is activated before calling calculate_behavior.
Implements FD::BufferedNode. Reimplemented in RobotFlow::Grasp. |
|
calculate_behavior is a pure virtual function. It should be implemented in every derived class. Processing of the behaviors is done inside this function.
Implemented in RobotFlow::Avoid, RobotFlow::AvoidPat, RobotFlow::BumperStall, RobotFlow::Direct, RobotFlow::DirectArbiter, RobotFlow::DirectPolygon, RobotFlow::DirectSquare, RobotFlow::DirectTriangle, RobotFlow::FollowWall, RobotFlow::Goto, RobotFlow::GotoPat, RobotFlow::Grasp, RobotFlow::MinimumDistance, RobotFlow::MoveAndTurn, RobotFlow::MultiSignTracking, RobotFlow::NewBehavior, RobotFlow::RandomTurn, RobotFlow::RangeFashion, RobotFlow::Rest, RobotFlow::SafeVelocity, RobotFlow::SafeVelocityPat, and RobotFlow::SignTracking. |
|
Translation of the behavior name into the behavior identification number.
|
|
Get the behavior id
|
|
Returns the number of registered behaviors.
|
|
Returns the data structure containing the registered behavior names. This function should not be used by derived classes.
|
|
This function is called by the REGISTER_BEHAVIOR macro. It should not be called from anything else.
|
|
Remove the behavior
|
|
activation vector or bool input |
|
behavior identification number |
|
exploitation output |
|
last exploitation value |
|
last exploitation output id |