28 std::vector<T> m1_sorted = m1;
29 std::vector<T> m2_sorted = m2;
30 std::sort(m1_sorted.begin(), m1_sorted.end());
31 std::sort(m2_sorted.begin(), m2_sorted.end());
32 return m1_sorted == m2_sorted;
52 const std::vector<T>& goal_marking) {
53 if (goal_marking.empty()) {
56 auto unique = goal_marking;
57 std::sort(unique.begin(), unique.end());
58 auto last = std::unique(unique.begin(), unique.end());
59 unique.erase(last, unique.end());
61 return std::all_of(std::begin(unique), std::end(unique), [&](
const auto& p) {
62 return std::count(marking.begin(), marking.end(), p) ==
63 std::count(goal_marking.begin(), goal_marking.end(), p);
bool MarkingEquality(const std::vector< T > &m1, const std::vector< T > &m2)
Checks if the markings are exactly the same. Note that this uses a different type for Marking compare...
Definition utilities.hpp:27
bool MarkingReached(const std::vector< T > &marking, const std::vector< T > &goal_marking)
Checks if marking is at least a subset of goal_marking. Note that this uses a different type for Mark...
Definition utilities.hpp:51