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_UDPOR_COMPATIBILITY_GRAPH_NODE_HPP
7 #define SIMGRID_MC_UDPOR_COMPATIBILITY_GRAPH_NODE_HPP
9 #include "src/mc/explo/udpor/EventSet.hpp"
10 #include "src/mc/explo/udpor/udpor_forward.hpp"
12 #include <initializer_list>
14 #include <unordered_set>
16 namespace simgrid::mc::udpor {
19 * @brief A node in a `CompatabilityGraph` which describes which
20 * combinations of events are in causal-conflict with the events
21 * associated with the node
23 class CompatibilityGraphNode {
25 std::unordered_set<CompatibilityGraphNode*> conflicts;
29 CompatibilityGraphNode(const CompatibilityGraphNode&) = default;
30 CompatibilityGraphNode& operator=(CompatibilityGraphNode const&) = default;
31 CompatibilityGraphNode(CompatibilityGraphNode&&) = default;
32 CompatibilityGraphNode(std::unordered_set<CompatibilityGraphNode*> conflicts, EventSet events_ = EventSet());
34 void add_event(UnfoldingEvent* e) { this->events_.insert(e); }
35 const EventSet& get_events() const { return this->events_; }
36 const std::unordered_set<CompatibilityGraphNode*>& get_conflicts() const { return this->conflicts; }
39 } // namespace simgrid::mc::udpor