From: mlaurent Date: Mon, 5 Jun 2023 11:59:56 +0000 (+0200) Subject: Merge branch 'master' of https://framagit.org/simgrid/simgrid X-Git-Tag: v3.34~41^2~15 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6260d187764dc644d699e1a53454f7efdcc682df Merge branch 'master' of https://framagit.org/simgrid/simgrid --- 6260d187764dc644d699e1a53454f7efdcc682df diff --cc src/mc/api/strategy/BasicStrategy.hpp index d1ee3a8fc8,452efd4b7b..67c1ac8673 --- a/src/mc/api/strategy/BasicStrategy.hpp +++ b/src/mc/api/strategy/BasicStrategy.hpp @@@ -6,23 -6,20 +6,25 @@@ #ifndef SIMGRID_MC_BASICSTRATEGY_HPP #define SIMGRID_MC_BASICSTRATEGY_HPP + #include "Strategy.hpp" + namespace simgrid::mc { -/** Basic MC guiding class which corresponds to no guide at all (random choice) */ +/** 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_ = 100000; // Arbitrary starting point. next_transition must return a positiv value to work with threshold in DFSExplorer + public: + void copy_from(const Strategy* strategy) override + { + const BasicStrategy* cast_strategy = static_cast(strategy); + xbt_assert(cast_strategy != nullptr); + depth_ = cast_strategy->depth_ - 1; + xbt_assert(depth_ > 0, "The exploration reached a depth greater than 100000. We will stop here to prevent weird interaction with DFSExplorer."); + } BasicStrategy() = default; ~BasicStrategy() override = default; - BasicStrategy(const BasicStrategy&) = delete; - BasicStrategy& operator=(const BasicStrategy&) - { /* nothing to copy over while cloning */ - return *this; - } std::pair next_transition() const override {