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 /** @file odpor_tests_private.hpp
8 * A private header file for all ODPOR tests
11 #ifndef SIMGRID_MC_ODPOR_TEST_PRIVATE_HPP
12 #define SIMGRID_MC_ODPOR_TEST_PRIVATE_HPP
14 #include "src/mc/explo/udpor/udpor_tests_private.hpp"
15 #include "src/mc/transition/Transition.hpp"
17 namespace simgrid::mc::odpor {
19 struct DependentIfSameValueAction : public Transition {
24 DependentIfSameValueAction(Type type, aid_t issuer, int value, int times_considered = 0)
25 : Transition(type, issuer, times_considered), value(value)
28 DependentIfSameValueAction(aid_t issuer, int value, int times_considered = 0)
29 : Transition(simgrid::mc::Transition::Type::UNKNOWN, issuer, times_considered), value(value)
33 // Dependent only with DependentAction (i.e. not itself)
34 bool depends(const Transition* other) const override
36 if (aid_ == other->aid_) {
40 if (const auto* same_value = dynamic_cast<const DependentIfSameValueAction*>(other); same_value != nullptr) {
41 return value == same_value->value;
44 // `DependentAction` is dependent with everyone who's not the `IndependentAction`
45 return dynamic_cast<const simgrid::mc::udpor::DependentAction*>(other) != nullptr;
49 } // namespace simgrid::mc::odpor