Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use a multiset to handle opened states, and ensures a reproductible order on differen...
[simgrid.git] / src / mc / explo / DFSExplorer.hpp
index 3e8a45b..dae59bb 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <list>
 #include <memory>
+#include <set>
 #include <string>
 #include <vector>
 
@@ -26,9 +27,9 @@ typedef std::list<std::shared_ptr<State>> stack_t;
  * regarding the chosen guide in the last state. */
 class OpenedStatesCompare {
 public:
-  bool operator()(std::shared_ptr<State> const& lhs, std::shared_ptr<State> const& rhs)
+  bool operator()(std::shared_ptr<State> const& lhs, std::shared_ptr<State> const& rhs) const
   {
-    return lhs->next_transition_guided().second < rhs->next_transition_guided().second;
+    return lhs->next_transition_guided().second > rhs->next_transition_guided().second;
   }
 };
 
@@ -113,7 +114,7 @@ private:
 
   /** Opened states are states that still contains todo actors.
    *  When backtracking, we pick a state from it*/
-  std::priority_queue<std::shared_ptr<State>, std::vector<std::shared_ptr<State>>, OpenedStatesCompare> opened_states_;
+  std::multiset<std::shared_ptr<State>, OpenedStatesCompare> opened_states_;
 
   /** Change current stack_ value to correspond to the one we would have
    *  had if we executed transition to get to state. This is required when