Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : remove unused argument in functions for heap comparison algorithm
[simgrid.git] / src / surf / trace_mgr_private.h
index dd5e09e..65d1bb7 100644 (file)
@@ -10,6 +10,7 @@
 #include "xbt/swag.h"
 #include "xbt/heap.h"
 #include "surf/trace_mgr.h"
+#include "xbt/RngStream.h"
 
 typedef struct tmgr_event {
   double delta;
@@ -17,32 +18,42 @@ typedef struct tmgr_event {
 } s_tmgr_event_t, *tmgr_event_t;
 
 enum e_trace_type {
-  e_trace_list, e_trace_uniform, e_trace_exponential, e_trace_weibull
+  e_trace_list, e_trace_probabilist
 };
 
-typedef struct tmgr_trace {
-  enum e_trace_type type;
+enum e_event_generator_type {
+  e_generator_uniform, e_generator_exponential, e_generator_weibull
+};
+
+typedef struct probabilist_event_generator {
+  enum e_event_generator_type type;
+  RngStream rng_stream;
+  double next_value;
   union {
-    struct {
-      xbt_dynar_t event_list;
-    } s_list;
     struct {
       double alpha;
       double beta;
-      s_tmgr_event_t next_event;
-      /* and probably other things */
-    } s_uniform;
+    } s_uniform_parameters;
     struct {
       double lambda;
-      s_tmgr_event_t next_event;
-      /* and probably other things */
-    } s_exponential;
+    } s_exponential_parameters;
     struct {
       double lambda;
       double k;
-      s_tmgr_event_t next_event;
-      /* and probably other things */
-    } s_weibull;
+    } s_weibull_parameters;
+  };
+} s_probabilist_event_generator_t;
+
+typedef struct tmgr_trace {
+  enum e_trace_type type;
+  union {
+    struct {
+      xbt_dynar_t event_list;
+    } s_list;
+    struct {
+      probabilist_event_generator_t event_generator[2];
+      int next_event;
+    } s_probabilist;
   };
 } s_tmgr_trace_t;
 
@@ -58,4 +69,6 @@ typedef struct tmgr_history {
   xbt_heap_t heap;
 } s_tmgr_history_t;
 
+double tmgr_event_generator_next_value(probabilist_event_generator_t generator);
+
 #endif                          /* _SURF_TMGR_PRIVATE_H */