public void DrawShortestPath(int counter) { String dirName = "PolysTesting"; FrogEntityPoly frog = new FrogEntityPoly(this._entra, this._entra.EngineState.FrogRB); PolyLog frogPolyLog = new PolyLog(frog, frog.GetDefPoly(), null); var shortestP = EntraPlusUsageManager.GetShortestPath(this.AllPaths)[0]; var pathPoints = BuildPath(frogPolyLog, shortestP); var form = new PathForm(pathPoints, true); form.DrawPathIntoOutput(dirName + @"\path " + counter + ".jpg"); }
private static void GetFitnessUsage(List <List <PolyLog> > allPaths, string levelStr, bool isShortestPathOnlyComparsion, out int usedNoRopes, out int generatedNoRopes, out float usageFit) { EntraPlusUsageManager usageManager = new EntraPlusUsageManager(allPaths, isShortestPathOnlyComparsion); usageManager.DoAnalysis(); List <Component> items = new LevelGenerator(levelStr).Items; items.RemoveAll(x => x is Frog); items.RemoveAll(x => x is Cookie); items.RemoveAll(x => x is Rope); usedNoRopes = usageManager.GetUsedCompsCountNoRopes(); generatedNoRopes = items.Count; usageFit = ((generatedNoRopes - usedNoRopes) / (float)generatedNoRopes); }