Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/IdentityTopologyUpdater.cs @ 5209

Last change on this file since 5209 was 5209, checked in by epitzer, 13 years ago

Configurable ParticleUpdater, and topologies, different topology initializers and support for dynamic topology changes (#852)

File size: 1.9 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Encodings.IntegerVectorEncoding;
3#region License Information
4/* HeuristicLab
5 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
6 *
7 * This file is part of HeuristicLab.
8 *
9 * HeuristicLab is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * HeuristicLab is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
21 */
22#endregion
23
24using HeuristicLab.Operators;
25using HeuristicLab.Parameters;
26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
27namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
28
29  [StorableClass]
30  public class IdentityTopologyUpdater : SingleSuccessorOperator, ITopologyUpdater {
31
32    public ScopeTreeLookupParameter<IntegerVector> NeighborsParameter {
33      get { return (ScopeTreeLookupParameter<IntegerVector>)Parameters["Neighbors"]; }
34    }
35
36    public IdentityTopologyUpdater() {
37      Parameters.Add(new ScopeTreeLookupParameter<IntegerVector>("Neighbors", "The list of neighbors for each particle."));
38    }
39    [StorableConstructor]
40    protected IdentityTopologyUpdater(bool deserializing) : base(deserializing) { }
41    protected IdentityTopologyUpdater(IdentityTopologyUpdater original, Cloner cloner)
42      : base(original, cloner) {
43    }
44    public override IDeepCloneable Clone(Cloner cloner) {
45      return new IdentityTopologyUpdater(this, cloner);
46    }
47  }
48
49}
Note: See TracBrowser for help on using the repository browser.