SwarmOps.ProblemIndex.ProblemIndex C# (CSharp) 메소드

ProblemIndex() 공개 메소드

Construct the ProblemIndex-object.
public ProblemIndex ( Problem problems ) : System.Collections.Generic
problems Problem The problems to be indexed.
리턴 System.Collections.Generic
        public ProblemIndex(Problem[] problems)
            : base()
        {
            Debug.Assert(problems.Length > 0);

            int numProblems = problems.Count();
            double weight = 1.0 / numProblems;

            Index = new List<ProblemFitness>(numProblems);

            foreach (Problem problem in problems)
            {
                Index.Add(new ProblemFitness(problem, weight));
            }
        }

Same methods

ProblemIndex::ProblemIndex ( WeightedProblem weightedProblems ) : System.Collections.Generic