Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename `remove()` method on `Unfolding`
[simgrid.git] / src / mc / explo / udpor / Unfolding.hpp
index 8f5848651c37c63bb7679de9e863827b2bd77094..140c893525e6211856630a9ee2ceaf940e92a353 100644 (file)
@@ -28,8 +28,17 @@ public:
   size_t size() const { return this->event_handles.size(); }
   bool empty() const { return this->event_handles.empty(); }
 
-  void remove(const UnfoldingEvent* e);
-  void remove(const EventSet& events);
+  /**
+   * @brief Moves an event from UDPOR's global set `U` to
+   * the global set `G`
+   */
+  void mark_finished(const UnfoldingEvent* e);
+
+  /**
+   * @brief Moves all events in a set from UDPOR's global
+   * set `U` to the global set `G`
+   */
+  void mark_finished(const EventSet& events);
 
   /// @brief Adds a new event `e` to the Unfolding if that
   /// event is not equivalent to any of those already contained
@@ -95,22 +104,19 @@ private:
    */
   EventSet event_handles;
 
+  /**
+   * @brief: The collection of events in the unfolding that are "important"
+   */
+  EventSet U;
+
   /**
    * @brief The "irrelevant" portions of the unfolding that do not need to be kept
    * around to ensure that UDPOR functions correctly
    *
    * The set `G` is another global variable maintained by the UDPOR algorithm which
    * is used to keep track of all events which used to be important to UDPOR.
-   *
-   * @note: The current implementation does not touch the set `G`. Its use is perhaps
-   * limited to debugging and/or model-checking acyclic state spaces
    */
   EventSet G;
-
-  auto find_equivalent(const UnfoldingEvent* e)
-  {
-    return std::find_if(begin(), end(), [=](const UnfoldingEvent* e_i) { return *e == *e_i; });
-  }
 };
 
 } // namespace simgrid::mc::udpor