#define SIMGRID_MC_BASICSTRATEGY_HPP
#include "Strategy.hpp"
+#include "src/mc/explo/Exploration.hpp"
+
+XBT_LOG_EXTERNAL_CATEGORY(mc_dfs);
namespace simgrid::mc {
/** Basic MC guiding class which corresponds to no guide. When asked for different states
* it will follow a depth first search politics to minize the number of opened states. */
class BasicStrategy : public Strategy {
- int depth_ = _sg_mc_max_depth; // Arbitrary starting point. next_transition must return a positiv value to work with threshold in DFSExplorer
+ int depth_ = _sg_mc_max_depth; // Arbitrary starting point. next_transition must return a positive value to work with
+ // threshold in DFSExplorer
public:
void copy_from(const Strategy* strategy) override
const auto* cast_strategy = dynamic_cast<BasicStrategy const*>(strategy);
xbt_assert(cast_strategy != nullptr);
depth_ = cast_strategy->depth_ - 1;
- xbt_assert(depth_ > 0, "The exploration reached a depth greater than %d. We will stop here to prevent weird interaction with DFSExplorer. If you want to change that behaviour, you should augment the size of the search by using --cfg=model-check/max-depth:", _sg_mc_max_depth.get());
+ if (depth_ <= 0) {
+ XBT_CERROR(mc_dfs,
+ "The exploration reached a depth greater than %d. Change the depth limit with "
+ "--cfg=model-check/max-depth. Here are the 100 first trace elements",
+ _sg_mc_max_depth.get());
+ auto trace = Exploration::get_instance()->get_textual_trace(100);
+ for (auto elm : trace)
+ XBT_CERROR(mc_dfs, " %s", elm.c_str());
+ xbt_die("Aborting now.");
+ }
}
BasicStrategy() = default;
~BasicStrategy() override = default;