1 /* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMGRID_MC_BASICSTRATEGY_HPP
7 #define SIMGRID_MC_BASICSTRATEGY_HPP
9 namespace simgrid::mc {
11 /** Basic MC guiding class which corresponds to no guide at all (random choice) */
12 class BasicStrategy : public Strategy {
14 void operator=(const BasicStrategy&) { return; }
16 std::pair<aid_t, double> next_transition() const override
18 for (auto const& [aid, actor] : actors_to_run_) {
19 /* Only consider actors (1) marked as interleaving by the checker and (2) currently enabled in the application */
20 if (not actor.is_todo() || not actor.is_enabled() || actor.is_done()) {
24 return std::make_pair(aid, 1.0);
26 return std::make_pair(-1, 0.0);
28 void execute_next(aid_t aid, RemoteApp& app) override { return; }
30 void consider_best() override
32 for (auto& [_, actor] : actors_to_run_) {
35 if (actor.is_enabled() and not actor.is_done()) {
43 } // namespace simgrid::mc