void complete(object sender, ControllerInfo i) { TimeSpan elapsed = DateTime.Now - start; using (System.IO.StreamWriter file = new System.IO.StreamWriter(filename, true)) { file.WriteLine("{0} {1} {2} {3} {4} {5} {6}", count + 1, elapsed.TotalSeconds, i.AverageCTE, i.AverageSpeed, i.AverageLateralAcceleration, i.MaxLateralAcceleration, i.AverageDLateralAcceleration); } count++; if (count < num) { start = DateTime.Now; startSim(); } else if (smoothing && Smoother.Anchoring) { using (System.IO.StreamWriter file = new System.IO.StreamWriter(filename, true)) { file.WriteLine("\n" + collisions + " collisions"); file.WriteLine("\nSmoother (No Anchoring):"); } count = 0; collisions = 0; smoothing = true; Smoother.Anchoring = false; } else if (smoothing) { using (System.IO.StreamWriter file = new System.IO.StreamWriter(filename, true)) { file.WriteLine("\n" + collisions + " collisions"); file.WriteLine("\nUnsmoothed:"); } count = 0; collisions = 0; smoothing = false; Smoother.Anchoring = false; } else { using (System.IO.StreamWriter file = new System.IO.StreamWriter(filename, true)) { file.WriteLine("\n" + collisions + " collisions\n"); } simulation.Exit(); } }
void complete(object sender, ControllerInfo i) { TimeSpan elapsed = DateTime.Now - start; using (System.IO.StreamWriter file = new System.IO.StreamWriter(filename, true)) { file.WriteLine("{0} {1} {2} {3} {4} {5}", startIndex, goalIndex, elapsed.TotalSeconds, i.GoalPositionError, i.GoalOrientationError, MathHelper.ToDegrees(i.GoalOrientationError)); } if (++goalIndex >= numSpacesInRow) { goalIndex = 0; if (++startIndex >= numSpacesInRow) { simulation.Exit(); return; } } startSim(); }