Пример #1
0
        public void execute() // generate_results
        {
            Stopwatch  stopwatch = new Stopwatch();
            SimOptions option;
            Experiment exp;

            for (int i = 0; i < options.Count; i++)
            {
                option = options[i];
                exp    = new Experiment(data, option);

                stopwatch.Restart();
                results.Add(exp.execute());
                stopwatch.Stop();
                executionTimes.Add(stopwatch.ElapsedTicks);

                Console.WriteLine("Experiment {0} / {1} took {2} ticks, ({3} milliseconds)", i + 1, options.Count, stopwatch.ElapsedTicks, stopwatch.ElapsedMilliseconds);
            }
        }
Пример #2
0
 public void ThreadPoolCallback(Object threadContext)
 {
     try
     {
         int threadIndex = (int)threadContext;
         Console.WriteLine("thread {0} started...", threadIndex);
         Experiment exp = new Experiment(data, options[threadIndex]);
         results[threadIndex] = exp.execute();
         //experiments[threadIndex].run();
         Console.WriteLine("thread {0} finished...", threadIndex);
     }
     finally
     {
         if (Interlocked.Decrement(ref _numerOfThreadsNotYetCompleted) == 0)
         {
             _doneEvent.Set();
         }
     }
 }
Пример #3
0
        public void run(Boolean parallel = true)
        {
            Experiment experiment = new Experiment(data, new SimOptions(1, 1, 1.1, 5.4, 26, 0.0006));

            experiment.execute();
        }