Assignment Search Framework
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
single_goal_test.h
Go to the documentation of this file.
1 /*
2  * single_goal_test.h
3  *
4  * LICENSE HERE
5  *
6  * Created on: 2016-08-18
7  * Author: Rick Valenzano
8  */
9 
10 #ifndef SINGLEGOALTEST_H_
11 #define SINGLEGOALTEST_H_
12 
13 #include "goal_test_function.h"
14 
20 template<class state_t>
21 class SingleGoalTest: public GoalTestFunction<state_t>
22 {
23 public:
29  SingleGoalTest(const state_t &g);
30 
34  virtual ~SingleGoalTest();
35 
36  virtual bool isGoal(const state_t &state) const;
37 
43  virtual void setGoal(const state_t &g);
44 
50  state_t getCurrentGoal() const;
51 
52 protected:
53  state_t goal;
54 };
55 
56 template<class state_t>
57 SingleGoalTest<state_t>::SingleGoalTest(const state_t& goal_state)
58  : goal(goal_state)
59 {
60 }
61 
62 template<class state_t>
64 {
65 }
66 
67 template<class state_t>
68 bool SingleGoalTest<state_t>::isGoal(const state_t& state) const
69 {
70  return (goal == state);
71 }
72 
73 template<class state_t>
74 void SingleGoalTest<state_t>::setGoal(const state_t& g)
75 {
76  goal = g;
77 }
78 
79 template<class state_t>
81 {
82  return goal;
83 }
84 
85 #endif /* SINGLEGOALTEST_H_ */
state_t goal
The stored goal state.
Definition: single_goal_test.h:53
virtual bool isGoal(const state_t &state) const
Definition: single_goal_test.h:68
SingleGoalTest(const state_t &g)
Definition: single_goal_test.h:57
virtual void setGoal(const state_t &g)
Definition: single_goal_test.h:74
Definition: goal_test_function.h:19
state_t getCurrentGoal() const
Definition: single_goal_test.h:80
virtual ~SingleGoalTest()
Definition: single_goal_test.h:63
Definition: single_goal_test.h:21