Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add some strategies and fix the semantics of Max/MinMatch
[simgrid.git] / src / mc / explo / DFSExplorer.hpp
index 3e8a45b..27194a8 100644 (file)
 
 #include <list>
 #include <memory>
+#include <set>
 #include <string>
 #include <vector>
 
 namespace simgrid::mc {
 
-typedef std::list<std::shared_ptr<State>> stack_t;
-
-/* Used to compare two stacks and decide which one is better to backtrack,
- * 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)
-  {
-    return lhs->next_transition_guided().second < rhs->next_transition_guided().second;
-  }
-};
+using stack_t = std::list<std::shared_ptr<State>>;
 
 class XBT_PRIVATE DFSExplorer : public Exploration {
-
   XBT_DECLARE_ENUM_CLASS(ReductionMode, none, dpor);
 
   ReductionMode reduction_mode_;
@@ -56,7 +46,6 @@ public:
   explicit DFSExplorer(const std::vector<char*>& args, bool with_dpor, bool need_memory_info = false);
   void run() override;
   RecordTrace get_record_trace() override;
-  std::vector<std::string> get_textual_trace() override;
   void log_state() override;
 
   /** Called once when the exploration starts */
@@ -113,7 +102,8 @@ 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::vector<std::shared_ptr<State>> opened_states_;
+  std::shared_ptr<State> best_opened_state();
 
   /** 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