Exemplo n.º 1
0
        /// <summary>
        /// Creates PartialProblem instance.
        /// </summary>
        /// <param name="id">ID of the partial problem within a problem instance.</param>
        /// <param name="problem">Corresponding problem instance.</param>
        /// <param name="privateData">Partial problem's private data.</param>
        public PartialProblem(ulong id, Problem problem, byte[] privateData)
        {
            Id = id;
            Problem = problem;
            PrivateData = privateData;

            if (problem.CommonData == null)
                throw new Exception("Common data in the corresponding problem instance must be set.");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates DivisionWork instance.
        /// </summary>
        /// <param name="assigneeId">ID of the assignee task manager.</param>
        /// <param name="problem">Problem instance to divide.</param>
        /// <param name="availableThreads">Number of threads within the system that can solve this type of problem. De facto number of parts to divide into.</param>
        public DivisionWork(ulong assigneeId, Problem problem, ulong availableThreads)
        {
            if (problem == null)
                throw new ArgumentNullException();

            AssigneeId = assigneeId;
            Problem = problem;

            Problem.NumberOfParts = availableThreads;
        }