Last change
on this file since 10835 was
7128,
checked in by epitzer, 13 years ago
|
#1696 Integrate fitness landscape analysis plugins from Heureka! repository.
|
File size:
1.2 KB
|
Rev | Line | |
---|
[7128] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using HeuristicLab.Core;
|
---|
| 6 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 7 | using HeuristicLab.Common;
|
---|
| 8 |
|
---|
| 9 | namespace HeuristicLab.Problems.NK.WeightInitializers {
|
---|
| 10 |
|
---|
| 11 | [Item("EqualWeightsInitializer", "Initializes all weights to 1.0")]
|
---|
| 12 | public class EqualWeightsInitializer : NamedItem, IWeightsInitializer {
|
---|
| 13 |
|
---|
| 14 | public override bool CanChangeName { get { return false; } }
|
---|
| 15 | public override bool CanChangeDescription { get { return false; } }
|
---|
| 16 |
|
---|
| 17 | [StorableConstructor]
|
---|
| 18 | protected EqualWeightsInitializer(bool deserializing) : base(deserializing) { }
|
---|
| 19 | protected EqualWeightsInitializer(EqualWeightsInitializer original, Cloner cloner)
|
---|
| 20 | : base(original, cloner) {
|
---|
| 21 | }
|
---|
| 22 | public EqualWeightsInitializer() {
|
---|
| 23 | name = ItemName;
|
---|
| 24 | description = ItemDescription;
|
---|
| 25 | }
|
---|
| 26 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 27 | return new EqualWeightsInitializer(this, cloner);
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | #region IWeightsInitializer Members
|
---|
| 31 |
|
---|
| 32 | public IEnumerable<double> GetWeights(int nComponents) {
|
---|
| 33 | return new[] { 1.0 };
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | #endregion
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.