Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Configuration class defined
authoreazimi <azimi.ehsan@outlook.com>
Tue, 12 Jan 2021 10:44:52 +0000 (11:44 +0100)
committereazimi <azimi.ehsan@outlook.com>
Tue, 12 Jan 2021 10:44:52 +0000 (11:44 +0100)
src/mc/udpor_global.hpp

index e166ada..36062c2 100644 (file)
@@ -3,12 +3,45 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_UDPOR_GLOBAL_HPP 
+#ifndef SIMGRID_MC_UDPOR_GLOBAL_HPP
 #define SIMGRID_MC_UDPOR_GLOBAL_HPP
 
+#include <iostream>
+#include <queue>
+
 namespace simgrid {
 namespace mc {
 
+class UnfoldingEvent;
+using EventSet = std::deque<UnfoldingEvent*>;
+
+typedef struct s_evset_in {
+  EventSet causuality_events;
+  EventSet cause;
+  EventSet ancestorSet;
+} s_evset_in_t;
+
+class Configuration {
+public:
+  EventSet events_;
+  EventSet maxEvent;         // Events recently added to events_
+  EventSet actorMaxEvent;    // maximal events of the actors in current configuration
+  UnfoldingEvent* lastEvent; // The last added event
+
+  Configuration plus_config(UnfoldingEvent*) const;
+  void createEvts(Configuration C, EventSet& result, const std::string& trans_tag, s_evset_in_t ev_sets, bool chk,
+                  UnfoldingEvent* immPreEvt);
+  void updateMaxEvent(UnfoldingEvent*);         // update maximal events of the configuration and actors
+  UnfoldingEvent* findActorMaxEvt(int actorId); // find maximal event of a Actor whose id = actorId
+
+  UnfoldingEvent* findTestedComm(const UnfoldingEvent* testEvt); // find comm tested by action testTrans
+
+  Configuration()                     = default;
+  Configuration(const Configuration&) = default;
+  Configuration& operator=(Configuration const&) = default;
+  Configuration(Configuration&&) noexcept        = default;
+  ~Configuration()                               = default;
+};
 
 } // namespace mc
 } // namespace simgrid