strategy_ = std::make_shared<MaxMatchComm>();
else if (_sg_mc_strategy == "min_match_comm")
strategy_ = std::make_shared<MinMatchComm>();
- else if (_sg_mc_strategy == "uniform") {
+ else if (_sg_mc_strategy == "uniform")
strategy_ = std::make_shared<UniformStrategy>();
else
THROW_IMPOSSIBLE;
strategy_ = std::make_shared<MaxMatchComm>();
else if (_sg_mc_strategy == "min_match_comm")
strategy_ = std::make_shared<MinMatchComm>();
- else if (_sg_mc_strategy == "uniform") {
+ else if (_sg_mc_strategy == "uniform")
strategy_ = std::make_shared<UniformStrategy>();
else
THROW_IMPOSSIBLE;
mailbox_[cast_strategy->last_mailbox_]++;
for (auto const& [_, val] : mailbox_)
- value_of_state += std::abs(val);
+ value_of_state_ += std::abs(val);
}
MaxMatchComm() = default;
~MaxMatchComm() override = default;
mailbox_[cast_strategy->last_mailbox_]++;
for (auto const& [_, val] : mailbox_)
- value_of_state -= std::abs(val);
+ value_of_state_ -= std::abs(val);
if (value_of_state_ < 0)
value_of_state_ = 0;
}
#define SIMGRID_MC_UNIFORMSTRATEGY_HPP
#include "src/mc/transition/Transition.hpp"
-#include "src/plugins/cfg/CFGMap.hpp"
namespace simgrid::mc {
{"uniform", "No specific strategy: choices are made randomly based on a uniform sampling."}
}};
+simgrid::config::Flag<int> _sg_mc_random_seed{"model-check/rand-seed",
+ "give a specific random seed to initialize the uniform distribution", 0,
+ [](int) { _mc_cfg_cb_check("Random seed"); }};
+
#if SIMGRID_HAVE_STATEFUL_MC
simgrid::config::Flag<int> _sg_mc_checkpoint{
"model-check/checkpoint", "Specify the amount of steps between checkpoints during stateful model-checking "
extern XBT_PUBLIC simgrid::config::Flag<bool> _sg_mc_unfolding_checker;
extern XBT_PRIVATE simgrid::config::Flag<bool> _sg_mc_timeout;
extern XBT_PRIVATE simgrid::config::Flag<int> _sg_mc_max_depth;
+extern XBT_PRIVATE simgrid::config::Flag<int> _sg_mc_random_seed;
extern "C" XBT_PUBLIC int _sg_mc_max_visited_states;
extern XBT_PRIVATE simgrid::config::Flag<std::string> _sg_mc_dot_output_file;
extern XBT_PRIVATE simgrid::config::Flag<bool> _sg_mc_termination;