root/ggpa/StateActionCmp.h

Revision 1, 0.6 kB (checked in by pantley2, 4 years ago)

GGPA code from the good old days of SIGART

Line 
1 #ifndef STATEACTIONCMP_H
2 #define STATEACTIONCMP_H
3
4 #include "State.h"
5 #include "Action.h"
6
7
8 class StateActionCmp
9 {
10 public:
11
12     /*
13      * operator()
14      * Parameters: Two Action/State pairs to compare
15      * Returns type: bool
16      * Returns true if p1 is "less than" p2.  This will be determined by
17      *    state first, and then action.
18      */
19     bool operator()(pair<State, Action> p1, pair<State, Action> p2) const {
20         State s1 = (p1.first), s2 = (p2.first);
21         Action a1 = (p1.second), a2 = (p2.second);
22         if (s1 == s2) {
23             return a1 < a2;
24         }
25
26         return s1 < s2;
27        
28     }
29 };
30
31 #endif
32
Note: See TracBrowser for help on using the browser.