private void runCFMCBS(ICbsSolver solver, ProblemInstance instance) { // Run the algorithm bool solved; Console.WriteLine("----------------- " + solver + ", Minimizing MakeSpan -----------------"); Constants.ALLOW_WAIT_MOVE = true; this.startTime = this.ElapsedMillisecondsTotal(); solver.Setup(instance, new MAM_Run()); // Defining MMStar as the low level of the algorithm solved = solver.Solve(); elapsedTime = this.ElapsedMilliseconds(); if (solved) { Console.WriteLine("Total MakeSpan cost: {0}", solver.GetSolutionCost()); } else { Console.WriteLine("Failed to solve CBS"); } Console.WriteLine(); Console.WriteLine("Expanded nodes: {0}", solver.GetExpanded()); Console.WriteLine("Time in milliseconds: {0}", elapsedTime); if (toPrint) { this.PrintStatistics(instance, elapsedTime, null, solver); } }
private void WriteGivenCFMCBSProblem(ProblemInstance instance, ICbsSolver solver, string plan) { writeToFile( solver.GetName(), // solver name planningTime.ToString(), // planning time "MakeSpan", // cost function solver.GetSolutionCost().ToString(), // solution cost instanceId.ToString(), // instanceId instance.fileName, // file Name instance.m_vAgents.Length.ToString(), // #Agents m_mapFileName, // Map name solver.isSolved().ToString(), // Success instance.m_nObstacles, // Obstacles solver.GetExpanded().ToString(), // Expansions solver.GetGenerated().ToString(), // Generates preprocessingTime.ToString()); // preprocessing time }