LEMUR Packages: ompl_lemur or_lemur pr_bgl prpy_lemur
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Groups Pages
UtilityChecker.h
Go to the documentation of this file.
1 
7 namespace ompl_lemur
8 {
9 
16 {
17 public:
20  {
21  }
22 
25  {
26  }
27 
28  virtual ~UtilityChecker()
29  {
30  }
31 
39  virtual bool hasChanged() = 0;
40 
46  virtual bool isKnown(size_t tag) const = 0;
47 
53  virtual bool isKnownInvalid(size_t tag) const = 0;
54 
63  virtual double getPartialEvalCost(size_t tag, const ompl::base::State * state) const = 0;
64 
75  virtual bool isValidPartialEval(size_t & tag, const ompl::base::State * state) const = 0;
76 
82  virtual bool isValid(const ompl::base::State * state) const
83  {
84  size_t tag = 0;
85  while (!isKnown(tag))
86  isValidPartialEval(tag, state);
87  return !isKnownInvalid(tag);
88  }
89 };
90 
91 #ifdef OMPL_LEMUR_HAS_BOOSTSMARTPTRS
92 typedef boost::shared_ptr<UtilityChecker> UtilityCheckerPtr;
93 #else
94 typedef std::shared_ptr<UtilityChecker> UtilityCheckerPtr;
95 #endif
96 
97 
107 {
108 public:
109 
110  enum
111  {
112  TAG_UNKNOWN = 0,
113  TAG_KNOWN_VALID = 1,
114  TAG_KNOWN_INVALID = 2
115  };
116 
117  bool _has_changed;
119  double _check_cost;
120 
123  double check_cost=1.0);
126  double check_cost=1.0);
128 
129  bool hasChanged();
130  bool isKnown(size_t tag) const;
131  bool isKnownInvalid(size_t tag) const;
132  double getPartialEvalCost(size_t tag, const ompl::base::State * state) const;
133  bool isValidPartialEval(size_t & tag, const ompl::base::State * state) const;
134 };
135 
136 #ifdef OMPL_LEMUR_HAS_BOOSTSMARTPTRS
137 typedef boost::shared_ptr<BinaryUtilityChecker> BinaryUtilityCheckerPtr;
138 #else
139 typedef std::shared_ptr<BinaryUtilityChecker> BinaryUtilityCheckerPtr;
140 #endif
141 
142 } // namespace ompl_lemur
double getPartialEvalCost(size_t tag, const ompl::base::State *state) const
Determines the optimistic planning cost entailed to call isValidPartialEval().
Definition: UtilityChecker.cpp:69
bool isValidPartialEval(size_t &tag, const ompl::base::State *state) const
Conduct the optimistic set of evaluations.
Definition: UtilityChecker.cpp:83
virtual double getPartialEvalCost(size_t tag, const ompl::base::State *state) const =0
Determines the optimistic planning cost entailed to call isValidPartialEval().
virtual bool isKnownInvalid(size_t tag) const =0
Determine whether a state with tag tag is known to be invalid.
virtual bool hasChanged()=0
Determine if the underlying utility model has changed since the last call to hasChanged().
bool isKnown(size_t tag) const
Determine whether a state with tag tag is known either valid or invalid.
Definition: UtilityChecker.cpp:41
virtual bool isKnown(size_t tag) const =0
Determine whether a state with tag tag is known either valid or invalid.
bool hasChanged()
Determine if the underlying utility model has changed since the last call to hasChanged().
Definition: UtilityChecker.cpp:34
virtual bool isValid(const ompl::base::State *state) const
Tag-ignorant validity check wrapper.
Definition: UtilityChecker.h:82
Adaptor to use a basic ompl::base::StateValidityChecker as a UtilityChecker.
Definition: UtilityChecker.h:106
Type of state validity checker which enables partial evaluation of tagged states. ...
Definition: UtilityChecker.h:15
bool isKnownInvalid(size_t tag) const
Determine whether a state with tag tag is known to be invalid.
Definition: UtilityChecker.cpp:55
virtual bool isValidPartialEval(size_t &tag, const ompl::base::State *state) const =0
Conduct the optimistic set of evaluations.