Go to the documentation of this file.00001
00013 #ifndef LGL_PURSUIT_GRAPH_NODE_HPP
00014 #define LGL_PURSUIT_GRAPH_NODE_HPP
00015
00016 #include <lgl/CellID.hpp>
00017
00018 #include <set>
00019 #include <vector>
00020 #include <boost/shared_ptr.hpp>
00021 #include <boost/weak_ptr.hpp>
00022
00023
00024
00025 namespace jafar {
00026 namespace lgl {
00027
00028
00029
00030 typedef enum { SEEN,
00031 RISK,
00032 DANGER_HIDDEN,
00033 DANGER_LOST,
00034
00035 DANGER_UNSEEN,
00036 DANGER_DISAPPEARED
00037 } RISK_LEVEL;
00043 class PursuitGNode {
00045
00046 private :
00047 std::vector< boost::weak_ptr<PursuitGNode> > children;
00048
00049 public :
00051 Cell_ID robotPos;
00052
00054 RISK_LEVEL risk;
00055
00057 std::set<Cell_ID> targetPos;
00058
00060 unsigned int time;
00061
00063 unsigned int riskTerm;
00064
00066 PursuitGNode() :
00067 robotPos (0),
00068 risk (SEEN),
00069 time(0),
00070 riskTerm(0)
00071 { }
00072
00077 PursuitGNode( Cell_ID _robotPos, RISK_LEVEL _risk, unsigned long int _time=0, unsigned long int _riskTerm=0 ) :
00078 robotPos(_robotPos),
00079 risk(_risk),
00080 time(_time),
00081 riskTerm(_riskTerm)
00082 { }
00083
00089 PursuitGNode(Cell_ID _robotPos, RISK_LEVEL _risk, std::set<Cell_ID> _targetPos, unsigned long int _time=0, unsigned long int _riskTerm=0 ) :
00090 robotPos(_robotPos),
00091 risk(_risk),
00092 targetPos(_targetPos),
00093 time(_time),
00094 riskTerm(_riskTerm)
00095 { }
00096
00097 ~PursuitGNode() { }
00098
00101 void setChildren ( const std::vector< boost::shared_ptr<PursuitGNode> > &newChildren ) ;
00102
00105 void noMoreChildren() ;
00106
00109 void addChild ( const boost::shared_ptr<PursuitGNode> & newChild ) ;
00110
00111 void addChild ( const boost::weak_ptr<PursuitGNode> & newChild ) ;
00112
00114 const std::vector< boost::weak_ptr<PursuitGNode> > & getChildren () const ;
00115
00119 bool operator== (const PursuitGNode &rhs) const ;
00120
00124 bool equal (const PursuitGNode &rhs) const ;
00125
00126 };
00127
00128
00129 bool before( const boost::weak_ptr<PursuitGNode> &lhs, const boost::weak_ptr<PursuitGNode> &rhs) ;
00130
00131
00132 std::ostream& operator<<(std::ostream& out, PursuitGNode const &rhs);
00133
00134 }
00135 }
00136
00137 #endif