Пример #1
0
        private static void lpProblemPhase(InputParser inputParser, int serverNO, int pointNO, double delta,
            int binNO, int[] binHefts, double explicitLimit, LPModelFileCreator lpModelFileCreator, LPSolver lpSolver)
        {
            int timeoutSec = inputParser.parseInputTimeout();
            bool deleteOutputLP = inputParser.parseInputDeleteOutputLP();

            string outputFilename = lpModelFileCreator.createOutputLPFile(serverNO, binNO, pointNO,
                binHefts, delta, explicitLimit);

            lpSolver.solveLP(serverNO, binNO, binHefts, timeoutSec, outputFilename);

            if (deleteOutputLP)
            {
                File.Delete(outputFilename);
            }
        }
Пример #2
0
 static void Main(string[] args)
 {
     // IMPORTANT NOTE:
     //     please check the Debug or Release folder contains lpsolve55.dll and build on x86 platform.
     IndexTransformator transformator = new IndexTransformator();
     InputParser inputParser = new InputParser(transformator);
     BinsCreator binsCreator = new BinsCreator(transformator);
     LPModelFileCreator lpModelFileCreator = new LPModelFileCreator();
     LPSolver lpSolver = new LPSolver();
     int serverNO;
     int pointNO;
     double delta;
     int spaceDimension;
     int histogramResolution;
     Array array;
     int[] binHefts;
     int binNO;
     double explicitLimit;
     binCreationPhase(inputParser, binsCreator, out serverNO, out pointNO, out delta, out spaceDimension,
         out histogramResolution, out array, out binHefts, out binNO, out explicitLimit);
     lpProblemPhase(inputParser, serverNO, pointNO, delta, binNO, binHefts, explicitLimit, lpModelFileCreator, lpSolver);
     Console.WriteLine("Press any key to exit!");
     Console.Read();
 }