示例#1
0
        public Response <string> RunSolver(string projectName, string encodingType, string encodingFilename)
        {
            var response = new Response <string>()
            {
                Success = true
            };

            try
            {
                var encodingFilePath = UtilityFunctions.GetProjectFolder(projectName) + "\\" + encodingFilename;
                var encodingFileName = Path.GetFileNameWithoutExtension(encodingFilePath);
                var resultFilepath   = UtilityFunctions.GetProjectFolder(projectName) + "\\" + string.Format("{0}_SAT4j.txt", encodingFileName);
                var solverRunner     = new SolverRunner();
                var resultFilename   = solverRunner.RunSolverSAT4J(encodingFilePath, resultFilepath);
                response.Data = resultFilename;
            }
            catch (Exception ex)
            {
                response.Success      = false;
                response.ErrorMessage = "Error while running the solver!";
                return(response);
            }
            return(response);
        }
示例#2
0
 public Response <bool> CreateNewProject(string projectName)
 {
     Thread.Sleep(2500);
     return(UtilityFunctions.CreaNewProject(projectName));
 }
示例#3
0
 public Response <string> GenerateRandomCostGraph(string projectName, int numberOfNodes)
 {
     Thread.Sleep(2500);
     return(UtilityFunctions.GenerateRandomCostMatrix(projectName, numberOfNodes));
 }
示例#4
0
 public Response <string> GenerateEuclideanDistanceCostGraph(string projectName, int numberOfNodes)
 {
     Thread.Sleep(2500);
     return(UtilityFunctions.GenerateEuclideanDistanceCostGraph(projectName, numberOfNodes));
 }
示例#5
0
 public Response <bool> SaveSelectedPoints(List <CellVector> selectedPoints, string projectName)
 {
     Thread.Sleep(2500);
     return(UtilityFunctions.SaveSelectedPoints(selectedPoints, projectName));
 }