Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
019bd142b970c183d58231c819410aadaeec8282
[simgrid.git] / src / mc / Transition.cpp
1 /* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #include "src/mc/Transition.hpp"
7 #include "src/mc/ModelChecker.hpp"
8 #include "src/mc/Session.hpp"
9 #include "xbt/asserts.h"
10
11 namespace simgrid {
12 namespace mc {
13 unsigned long Transition::executed_transitions_ = 0;
14
15 std::string Transition::to_string()
16 {
17   xbt_assert(mc_model_checker != nullptr, "Must be called from MCer");
18
19   return textual_;
20 }
21 RemotePtr<simgrid::kernel::actor::SimcallObserver> Transition::execute()
22 {
23   textual_ = mc_model_checker->simcall_to_string(aid_, times_considered_);
24   executed_transitions_++;
25
26   simgrid::mc::RemotePtr<simgrid::kernel::actor::SimcallObserver> res = mc_model_checker->handle_simcall(*this);
27   mc_model_checker->wait_for_requests();
28
29   return res;
30 }
31 } // namespace mc
32 } // namespace simgrid