Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/SolutionCreation/IdentityIntegerVectorCreator.cs @ 13069

Last change on this file since 13069 was 13069, checked in by gkronber, 9 years ago

#2499: imported source code for HeuristicLab.BioBoost from private repository with some changes

File size: 1.0 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Data;
4using HeuristicLab.Encodings.IntegerVectorEncoding;
5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
6using System.Linq;
7
8namespace HeuristicLab.BioBoost.SolutionCreation {
9
10  [StorableClass]
11  public class IdentityIntegerVectorCreator : IntegerVectorCreator {
12
13    #region Construction & Cloning
14    [StorableConstructor]
15    protected IdentityIntegerVectorCreator(bool isDeserializing) : base(isDeserializing) {}
16    protected IdentityIntegerVectorCreator(IdentityIntegerVectorCreator orig, Cloner cloner) : base(orig, cloner) {}
17    public IdentityIntegerVectorCreator() { }
18    public override IDeepCloneable Clone(Cloner cloner) {
19      return new IdentityIntegerVectorCreator(this, cloner);
20    }
21    #endregion
22
23    protected override IntegerVector Create(IRandom random, IntValue length, IntMatrix bounds) {
24      return new IntegerVector(Enumerable.Range(0, length.Value).ToArray());
25    }
26
27  }
28}
Note: See TracBrowser for help on using the repository browser.