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()); }
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); }
public MultiplyTaskSolver(byte[] problemData) : base(problemData) { mData = MultiplyProblemData.Deserialize(problemData); }