Line | |
---|
1 | using System;
|
---|
2 | using HEAL.Attic;
|
---|
3 | using HeuristicLab.Common;
|
---|
4 | using HeuristicLab.Encodings.RealVectorEncoding;
|
---|
5 |
|
---|
6 | namespace HeuristicLab.Algorithms.NSGA3
|
---|
7 | {
|
---|
8 | [StorableType("D35C9D79-77DF-4CF3-AB44-FCCC00E44C5F")]
|
---|
9 | public class Solution : IDeepCloneable
|
---|
10 | {
|
---|
11 | // Chromosome
|
---|
12 | public RealVector Chromosome { get; set; }
|
---|
13 |
|
---|
14 | // Fitness
|
---|
15 | public double[] Fitness { get; set; }
|
---|
16 |
|
---|
17 | public Solution(RealVector chromosome)
|
---|
18 | {
|
---|
19 | Chromosome = chromosome;
|
---|
20 | }
|
---|
21 |
|
---|
22 | public Solution(Solution solution, Cloner cloner)
|
---|
23 | {
|
---|
24 | Chromosome = cloner.Clone(solution.Chromosome);
|
---|
25 | Fitness = new double[solution.Fitness.Length];
|
---|
26 | Array.Copy(solution.Fitness, Fitness, solution.Fitness.Length);
|
---|
27 | }
|
---|
28 |
|
---|
29 | public IDeepCloneable Clone(Cloner cloner)
|
---|
30 | {
|
---|
31 | return new Solution(this, cloner);
|
---|
32 | }
|
---|
33 |
|
---|
34 | public object Clone()
|
---|
35 | {
|
---|
36 | return new Cloner().Clone(this);
|
---|
37 | }
|
---|
38 | }
|
---|
39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.