utils/replay-simulation.cc
changeset 205 681e44f1cf58
parent 201 b7635c5d5bdf
child 286 57e6a2006962
--- a/utils/replay-simulation.cc	Fri Dec 15 10:19:49 2006 +0100
+++ b/utils/replay-simulation.cc	Fri Dec 15 13:51:56 2006 +0100
@@ -72,7 +72,6 @@
   CommandsI m_command;
   RemoveEvents m_removeEvents;
   uint32_t m_uid;
-  uint32_t m_currentUid;
 };
 
 typedef std::vector<std::pair<uint32_t, uint32_t> > Removes;
@@ -271,19 +270,22 @@
 {
   char const *input = 0;
   uint32_t n = 1;
+  bool is_map = false;
+  bool is_list = false;
+  bool is_heap = false;
   while (argc > 0) 
     {
       if (strcmp ("--list", argv[0]) == 0) 
         {
-          Simulator::SetLinkedList ();
+          is_list = true;
         } 
       else if (strcmp ("--heap", argv[0]) == 0) 
         {
-          Simulator::SetBinaryHeap ();
+          is_heap = true;
         } 
       else if (strcmp ("--map", argv[0]) == 0) 
         {
-          Simulator::SetStdMap ();
+          is_map = true;
         } 
       else if (strncmp ("--n=", argv[0], strlen("--n=")) == 0) 
         {
@@ -308,8 +310,22 @@
     }
   LogReader log;
   log.ReadFromFilename (input);
+  std::cout << "start runs..." << std::endl;
   for (uint32_t i = 0; i < n; i++) 
     {
+      if (is_map)
+        {
+          Simulator::SetStdMap ();
+        }
+      else if (is_list)
+        {
+          Simulator::SetLinkedList ();
+        }
+      else if (is_heap)
+        {
+          Simulator::SetBinaryHeap ();
+        }
       log.Run ();
+      Simulator::Destroy ();
     }
 }