Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Split TransitionAny and TransitionRandom to their own files
[simgrid.git] / src / mc / transition / TransitionAny.hpp
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 #ifndef SIMGRID_MC_TRANSITION_ANY_HPP
7 #define SIMGRID_MC_TRANSITION_ANY_HPP
8
9 #include "src/kernel/actor/SimcallObserver.hpp"
10 #include "src/mc/transition/Transition.hpp"
11
12 #include <sstream>
13 #include <string>
14
15 namespace simgrid {
16 namespace mc {
17
18 class TestAnyTransition : public Transition {
19   std::vector<Transition*> transitions_;
20
21 public:
22   TestAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream);
23   std::string to_string(bool verbose) const override;
24   bool depends(const Transition* other) const override;
25
26   Transition* get_current_transition() const { return transitions_.at(times_considered_); }
27 };
28
29 class WaitAnyTransition : public Transition {
30   std::vector<Transition*> transitions_;
31
32 public:
33   WaitAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream);
34   std::string to_string(bool verbose) const override;
35   bool depends(const Transition* other) const override;
36
37   Transition* get_current_transition() const { return transitions_.at(times_considered_); }
38 };
39
40 } // namespace mc
41 } // namespace simgrid
42
43 #endif