Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17558


Ignore:
Timestamp:
05/25/20 19:10:09 (5 years ago)
Author:
dleko
Message:

#2825: Generate structured reference points and show them in Results tab.

Location:
branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/HeuristicLab.Algorithms.NSGA3-3.3.csproj

    r17557 r17558  
    111111    <Compile Include="Plugin.cs" />
    112112    <Compile Include="Properties\AssemblyInfo.cs" />
     113    <Compile Include="ReferencePoint.cs" />
    113114    <Compile Include="Solution.cs" />
     115    <Compile Include="Utility.cs" />
    114116  </ItemGroup>
    115117  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs

    r17557 r17558  
    11using System;
     2using System.Collections.Generic;
    23using System.Linq;
    34using System.Threading;
     
    6263        private const string DominateOnEqualQualitiesName = "DominateOnEqualQualities";
    6364
     65        // Results Names
     66
     67        private const string GeneratedReferencePointsResultName = "Generated Reference Points";
     68
    6469        #endregion ParameterAndResultsNames
    6570
     
    120125
    121126        #endregion Properties
     127
     128        #region ResultsProperties
     129
     130        public DoubleMatrix ResultsGeneratedReferencePoints
     131        {
     132            get { return (DoubleMatrix)Results[GeneratedReferencePointsResultName].Value; }
     133            set { Results[GeneratedReferencePointsResultName].Value = value; }
     134        }
     135
     136        #endregion ResultsProperties
    122137
    123138        public NSGA3() : base()
     
    147162        }
    148163
     164        #region Overriden Methods
     165
    149166        public override IDeepCloneable Clone(Cloner cloner)
    150167        {
     
    152169        }
    153170
     171        protected override void Initialize(CancellationToken cancellationToken)
     172        {
     173            base.Initialize(cancellationToken);
     174
     175            InitResults();
     176            InitReferencePoints();
     177        }
     178
    154179        protected override void Run(CancellationToken cancellationToken)
    155180        {
    156181            throw new NotImplementedException();
    157182        }
     183
     184        #endregion Overriden Methods
     185
     186        #region Private Methods
     187
     188        private void InitResults()
     189        {
     190            Results.Add(new Result(GeneratedReferencePointsResultName, "The initially generated reference points", new DoubleMatrix()));
     191        }
     192
     193        // Generates the structured reference points
     194        private void InitReferencePoints()
     195        {
     196            // Generate reference points and add them to results
     197            int nDiv = 5; // todo: figure out the correct number of divisions
     198            List<ReferencePoint> referencePoints = ReferencePoint.GenerateReferencePoints(Problem.Encoding.Length, nDiv);
     199            ResultsGeneratedReferencePoints = Utility.ConvertToDoubleMatrix(referencePoints);
     200        }
     201
     202        #endregion Private Methods
    158203    }
    159204}
Note: See TracChangeset for help on using the changeset viewer.