コード例 #1
0
ファイル: BeamService.cs プロジェクト: linriedi/School
        private SolutionSet CreateFirstSolutionSet(Point[] points)
        {
            var partialSolutions = new PartialSolution[SolutionSet.BeamWith];

            for (int i = 0; i < SolutionSet.BeamWith; i++)
            {
                partialSolutions[i] = new PartialSolution(points[i]);
            }
            return(new SolutionSet(partialSolutions, points.Length));
        }
コード例 #2
0
ファイル: PartialSolution.cs プロジェクト: linriedi/School
        public PartialSolution(PartialSolution paritalSolution, PartialSolutionTail partialSolutionTail, int id)
        {
            this.Id = id;

            var points = paritalSolution.Points.ToList();

            points.AddRange(partialSolutionTail.Points);
            this.Points = points.ToArray();

            var length = this.Points.Length;

            this.DistanceClosed += partialSolutionTail.ClosedDistance;
            this.DistanceOpen    = paritalSolution.DistanceOpen + partialSolutionTail.DistanceOpen;

            this.LastPoint = partialSolutionTail.LastPoint;
        }
コード例 #3
0
 public PartialSolutionTail(PartialSolution partialSolution)
 {
     this.Head   = partialSolution;
     this.Points = new Point[0];
 }