Пример #1
0
        public Response <List <CellVector> > RunSolverOrginal(string solverName, string projectName, int timeoutInMin)
        {
            var solverRunner = new SolverRunner();

            solverRunner.GeneratePsuedoBooleanEncodingFromRandomCostGraph("");
            solverRunner.RunSAT4J();

            return(null);
        }
Пример #2
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);
        }
Пример #3
0
        public Response<List<CellVector>> RunSolverOrginal(string solverName, string projectName, int timeoutInMin)
        {
            var solverRunner = new SolverRunner();
            solverRunner.GeneratePsuedoBooleanEncodingFromRandomCostGraph("");
            solverRunner.RunSAT4J();

            return null;
        }
Пример #4
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;
 }