Ejemplo n.º 1
0
        protected override string ReceivedSolvePartialProblems(SolvePartialProblems solvePartialProblems)
        {
            ///// Hey here is the problem to solve! (undivided, everything is in CommonData)
            string problem = Utilities.Base64Decode(solvePartialProblems.CommonData);

            globalProblem = problem;
            //solvePartialProblems.Id;
            NodeWorker worker = new NodeWorker(solvePartialProblems.Id);

            worker.problemObject = ProblemLoader.loadnewExampleString(globalProblem);
            Workers.Add(worker);
            double    sol       = worker.calculateAlgorithm();
            Solutions solutions = new Solutions();

            solutions.Id         = solvePartialProblems.Id;
            solutions.CommonData = Utilities.Base64Encode(sol.ToString());
            Console.WriteLine("How Long = " + this.Workers.First().HowLong);
            CMSocket.Instance.SendMessage(this.Port, this.IP, solutions.SerializeToXML(), this);
            return(null);
        }