Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
36062c25ffb1bca02abe44431fc45b7aa0de8d89
[simgrid.git] / src / mc / udpor_global.hpp
1 /* Copyright (c) 2007-2021. 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_UDPOR_GLOBAL_HPP
7 #define SIMGRID_MC_UDPOR_GLOBAL_HPP
8
9 #include <iostream>
10 #include <queue>
11
12 namespace simgrid {
13 namespace mc {
14
15 class UnfoldingEvent;
16 using EventSet = std::deque<UnfoldingEvent*>;
17
18 typedef struct s_evset_in {
19   EventSet causuality_events;
20   EventSet cause;
21   EventSet ancestorSet;
22 } s_evset_in_t;
23
24 class Configuration {
25 public:
26   EventSet events_;
27   EventSet maxEvent;         // Events recently added to events_
28   EventSet actorMaxEvent;    // maximal events of the actors in current configuration
29   UnfoldingEvent* lastEvent; // The last added event
30
31   Configuration plus_config(UnfoldingEvent*) const;
32   void createEvts(Configuration C, EventSet& result, const std::string& trans_tag, s_evset_in_t ev_sets, bool chk,
33                   UnfoldingEvent* immPreEvt);
34   void updateMaxEvent(UnfoldingEvent*);         // update maximal events of the configuration and actors
35   UnfoldingEvent* findActorMaxEvt(int actorId); // find maximal event of a Actor whose id = actorId
36
37   UnfoldingEvent* findTestedComm(const UnfoldingEvent* testEvt); // find comm tested by action testTrans
38
39   Configuration()                     = default;
40   Configuration(const Configuration&) = default;
41   Configuration& operator=(Configuration const&) = default;
42   Configuration(Configuration&&) noexcept        = default;
43   ~Configuration()                               = default;
44 };
45
46 } // namespace mc
47 } // namespace simgrid
48 #endif