X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d6eb772e45cc853fc204bb5aebeb411cdfa7c929..fe4080b8dd04acb2074ca72d36e3019acddea455:/src/mc/explo/udpor/EventSet.hpp diff --git a/src/mc/explo/udpor/EventSet.hpp b/src/mc/explo/udpor/EventSet.hpp index 54c00c8f47..32be66f70a 100644 --- a/src/mc/explo/udpor/EventSet.hpp +++ b/src/mc/explo/udpor/EventSet.hpp @@ -8,10 +8,12 @@ #include "src/mc/explo/udpor/udpor_forward.hpp" +#include #include #include #include #include +#include namespace simgrid::mc::udpor { @@ -25,9 +27,12 @@ public: EventSet& operator=(const EventSet&) = default; EventSet& operator=(EventSet&&) = default; EventSet(EventSet&&) = default; - explicit EventSet(Configuration&& config); - explicit EventSet(std::vector&& raw_events) : events_(raw_events.begin(), raw_events.end()) {} - explicit EventSet(std::unordered_set&& raw_events) : events_(raw_events) {} + explicit EventSet(const Configuration& config); + explicit EventSet(const std::vector& raw_events) + : events_(raw_events.begin(), raw_events.end()) + { + } + explicit EventSet(std::unordered_set&& raw_events) : events_(std::move(raw_events)) {} explicit EventSet(std::initializer_list event_list) : events_(std::move(event_list)) {} auto begin() const { return this->events_.begin(); } @@ -48,17 +53,22 @@ public: EventSet make_union(const UnfoldingEvent*) const; EventSet make_union(const EventSet&) const; EventSet make_union(const Configuration&) const; + EventSet make_intersection(const EventSet&) const; EventSet get_local_config() const; size_t size() const; bool empty() const; + bool contains(const UnfoldingEvent*) const; bool contains(const History&) const; + bool contains_equivalent_to(const UnfoldingEvent*) const; + bool intersects(const EventSet&) const; bool intersects(const History&) const; bool is_subset_of(const EventSet&) const; bool operator==(const EventSet& other) const { return this->events_ == other.events_; } bool operator!=(const EventSet& other) const { return this->events_ != other.events_; } + std::string to_string() const; /** * @brief Whether or not this set of events could @@ -104,6 +114,12 @@ public: */ bool is_conflict_free() const; + /** + * @brief Produces the largest subset of this + * set of events which is maximal + */ + EventSet get_largest_maximal_subset() const; + /** * @brief Orders the events of the set such that * "more recent" events (i.e. those that are farther down in