Storm
A Modern Probabilistic Model Checker
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StateActionPair.h
Go to the documentation of this file.
1#ifndef STATEACTIONPAIR_H
2#define STATEACTIONPAIR_H
3
4#include <memory>
5
6namespace storm {
7namespace storage {
9 std::pair<uint_fast64_t, uint_fast64_t> stateActionPair;
10
11 public:
12 StateActionPair(std::pair<uint_fast64_t, uint_fast64_t> const& sap) : stateActionPair(sap) {}
13 StateActionPair(uint_fast64_t state, uint_fast64_t action) : stateActionPair(std::make_pair(state, action)) {}
14
15 uint_fast64_t getState() const {
16 return stateActionPair.first;
17 }
18
19 uint_fast64_t getAction() const {
20 return stateActionPair.second;
21 }
22
23 friend bool operator==(StateActionPair const& p1, StateActionPair const& p2) {
24 return p1.stateActionPair == p2.stateActionPair;
25 }
26
27 friend bool operator!=(StateActionPair const& p1, StateActionPair const& p2) {
28 return p1.stateActionPair != p2.stateActionPair;
29 }
30
31 friend bool operator<(StateActionPair const& p1, StateActionPair const& p2) {
32 return p1.getState() < p2.getState() || (p1.getState() == p2.getState() && p1.getAction() < p2.getAction());
33 }
34};
35} // namespace storage
36} // namespace storm
37
38namespace std {
39template<>
40struct hash<storm::storage::StateActionPair> {
42 return (sap.getState() << 3 ^ sap.getAction());
43 }
44};
45
46} // namespace std
47
48#endif /* STATEACTIONPAIR_H */
uint_fast64_t getState() const
friend bool operator==(StateActionPair const &p1, StateActionPair const &p2)
friend bool operator<(StateActionPair const &p1, StateActionPair const &p2)
friend bool operator!=(StateActionPair const &p1, StateActionPair const &p2)
StateActionPair(std::pair< uint_fast64_t, uint_fast64_t > const &sap)
uint_fast64_t getAction() const
StateActionPair(uint_fast64_t state, uint_fast64_t action)
LabParser.cpp.
Definition cli.cpp:18
size_t operator()(storm::storage::StateActionPair const &sap) const