From ad36129a2861f531ce0f59fa5792b0eab8dec685 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 5 Mar 2014 15:06:08 +0100
Subject: [PATCH] Do not modify seed on each run to have predictible results

---
 dream/simulation/LineGenerationJSON.py  |  3 +--
 dream/tests/dump/Topology63.json.result | 30 ++++++++++++-------------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/dream/simulation/LineGenerationJSON.py b/dream/simulation/LineGenerationJSON.py
index fe10f85e..91bfd623 100644
--- a/dream/simulation/LineGenerationJSON.py
+++ b/dream/simulation/LineGenerationJSON.py
@@ -1263,8 +1263,7 @@ def main(argv=[], input_data=None):
     #run the experiment (replications)          
     for i in xrange(G.numberOfReplications):
         #logger.info("start run number "+str(i+1)) 
-        G.seed+=1
-        G.Rnd=Random(G.seed)     
+        G.Rnd=Random(G.seed + i)
         initialize()                        #initialize the simulation 
         createWIP()
         initializeObjects()
diff --git a/dream/tests/dump/Topology63.json.result b/dream/tests/dump/Topology63.json.result
index ad3e15c5..c7cd21f6 100644
--- a/dream/tests/dump/Topology63.json.result
+++ b/dream/tests/dump/Topology63.json.result
@@ -6,19 +6,19 @@
    "id": "E1", 
    "results": {
     "lifespan": {
-     "avg": 8.389456464150808, 
-     "max": 9.862246183668073, 
-     "min": 6.916666744633542
+     "avg": 7.644704034234376, 
+     "max": 9.273160413246833, 
+     "min": 6.016247655221919
     }, 
     "takt_time": {
-     "avg": 1.6638373280700693, 
-     "max": 1.6638373280700693, 
-     "min": 1.6638373280700693
+     "avg": 1.3184411532500233, 
+     "max": 1.3184411532500233, 
+     "min": 1.3184411532500233
     }, 
     "throughput": {
-     "avg": 30.75, 
-     "max": 32.4991076812121, 
-     "min": 29.000892318787898
+     "avg": 32.25, 
+     "max": 34.2341794502541, 
+     "min": 30.265820549745897
     }
    }
   }, 
@@ -52,14 +52,14 @@
      "min": 0.0
     }, 
     "waiting_ratio": {
-     "avg": 5.780684174517209, 
-     "max": 7.703045665141752, 
-     "min": 3.8583226838926654
+     "avg": 6.40180811900683, 
+     "max": 8.264789529051413, 
+     "min": 4.538826708962247
     }, 
     "working_ratio": {
-     "avg": 94.2193158254828, 
-     "max": 96.14167731610733, 
-     "min": 92.29695433485826
+     "avg": 93.59819188099317, 
+     "max": 95.46117329103775, 
+     "min": 91.73521047094859
     }
    }
   }
-- 
2.30.9