Beispiel #1
0
        public override byte[] Solve(byte[] partialData, TimeSpan timeout)
        {
            State = TaskSolverState.Solving;
            MultiplyProblemData problemData = MultiplyProblemData.Deserialize(partialData);

            //nic nie trzeba tu robic
            State = TaskSolverState.Idle;
            OnProblemSolvingFinished(this);
            return(new MultiplySolutionData(problemData.Multiplier).Serialize());
        }
Beispiel #2
0
 public override byte[][] DivideProblem(int threadCount)
 {
     State = TaskSolverState.Dividing;
     byte[][] dividedData = new byte[mData.Number][];
     for (int i = 0; i < mData.Number; ++i)
     {
         dividedData[i] = new MultiplyProblemData(1, mData.Multiplier).Serialize();
     }
     PartialProblems = dividedData;
     OnProblemDividingFinished(this);
     State = TaskSolverState.Idle;
     return(dividedData);
 }
Beispiel #3
0
 public MultiplyTaskSolver(byte[] problemData)
     : base(problemData)
 {
     mData = MultiplyProblemData.Deserialize(problemData);
 }