コード例 #1
0
ファイル: AlgTopNH.cs プロジェクト: Lannyland/IPPA
 // Store path planning results to array
 private void StoreResults(int index)
 {
     // Plan path
     lstThreads[index].PlanPath();
     // Storing results
     arrResponses[index] = new PathPlanningResponse(
                             lstThreads[index].index,
                             lstThreads[index].GetCDF(),
                             lstThreads[index].GetRunTime(),
                             lstThreads[index].GetEfficiency(),
                             lstThreads[index].GetPath());
 }
コード例 #2
0
ファイル: AlgGlobalWarming.cs プロジェクト: Lannyland/IPPA
        // Store path planning results to array
        private void StoreResults(int index)
        {
            //// Wait until it is safe to enter.
            //mut.WaitOne();

            //Console.WriteLine("{0} has entered the protected area",
            //    Thread.CurrentThread.Name);

            // Plan path
            lstThreads[index].PlanPath();
            // I am recalculating BestCDF because the Global Warming effect lowered the probabilities
            double RealCDF = GetTrueCDF(lstThreads[index].GetPath());
            // Storing results
            arrResponses[index] = new PathPlanningResponse(
                                    lstThreads[index].index,
                                    RealCDF,
                                    lstThreads[index].GetRunTime(),
                                    lstThreads[index].GetEfficiency(),
                                    lstThreads[index].GetPath());

            //Console.WriteLine("{0} is leaving the protected area\r\n",
            //            Thread.CurrentThread.Name);

            //// Release the Mutex.
            //mut.ReleaseMutex();
        }
コード例 #3
0
ファイル: AlgRealTime.cs プロジェクト: Lannyland/IPPA
 // Store path planning results to array
 private void StoreResults(int index)
 {
     DateTime startTime2 = DateTime.Now;
     // Plan path
     lstThreads[index].PlanPath();
     // I am recalculating BestCDF because the Global Warming effect lowered the probabilities
     double RealCDF = GetTrueCDF(lstThreads[index].GetPath());
     // Storing results
     arrResponses[index] = new PathPlanningResponse(
                             lstThreads[index].index,
                             RealCDF,
                             lstThreads[index].GetRunTime(),
                             lstThreads[index].GetEfficiency(),
                             lstThreads[index].GetPath());
     DateTime stopTime2 = DateTime.Now;
     TimeSpan duration2 = stopTime2 - startTime2;
     double RunTime2 = duration2.TotalSeconds;
     if (ProjectConstants.DebugMode)
     {
         curRequest.SetLog(lstThreads[index].GetCurRequest().AlgToUse + " took " + RunTime2 + " seconds.\n");
     }
 }
コード例 #4
0
ファイル: AlgTopTwo.cs プロジェクト: Lannyland/IPPA
 // Store path planning results to array
 private void StoreResults(int index)
 {
     // Plan path for seg2
     lstThreads[index].PlanPath();
     // Storing results
     arrResponses[index] = new PathPlanningResponse(
                             lstThreads[index].index,
                             lstThreads[index].GetCDF(),
                             lstThreads[index].GetRunTime(),
                             lstThreads[index].GetEfficiency(),
                             lstThreads[index].GetPath());
     // Plan path for seg3
     lstThreads[index + 1].SetmDist(lstThreads[index].GetmCurDist());
     lstThreads[index + 1].PlanPath();
     // Storing results
     arrResponses[index + 1] = new PathPlanningResponse(
                             lstThreads[index + 1].index,
                             lstThreads[index + 1].GetCDF(),
                             lstThreads[index + 1].GetRunTime(),
                             lstThreads[index + 1].GetEfficiency(),
                             lstThreads[index + 1].GetPath());
 }