Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
374d69def4668085caa698df9dd738a2c58dca1a
[simgrid.git] / src / mc / transition / TransitionRandom.hpp
1 /* Copyright (c) 2015-2023. 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_RANDOM_HPP
7 #define SIMGRID_MC_TRANSITION_RANDOM_HPP
8
9 #include "src/mc/transition/Transition.hpp"
10
11 namespace simgrid::mc {
12
13 class RandomTransition : public Transition {
14   int min_;
15   int max_;
16
17 public:
18   std::string to_string(bool verbose) const override;
19   RandomTransition(aid_t issuer, int times_considered, std::stringstream& stream);
20   bool depends(const Transition* other) const override
21   {
22     if (other->type_ < type_)
23       return other->depends(this);
24
25     return aid_ == other->aid_;
26   } // Independent with any other transition
27 };
28
29 } // namespace simgrid::mc
30
31 #endif