Changeset 15116 for stable/HeuristicLab.Optimization/3.3/BasicProblems/Individuals/SingleEncodingIndividual.cs
- Timestamp:
- 07/03/17 22:59:37 (7 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14877
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Optimization merged: 14877
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization/3.3/BasicProblems/Individuals/SingleEncodingIndividual.cs
r14186 r15116 32 32 } 33 33 34 public override IItem this[string name] { 35 get { 36 if (Name != name) throw new ArgumentException(string.Format("{0} is not part of the individual.", name)); 37 return ExtractScopeValue(Name, Scope); 38 } 39 set { 40 if (Name != name) throw new ArgumentException(string.Format("{0} is not part of the individual.", name)); 41 SetScopeValue(Name, Scope, value); 42 } 34 private SingleEncodingIndividual(SingleEncodingIndividual copy) : base(copy.Encoding, new Scope()) { 35 copy.CopyToScope(Scope); 36 } 37 public override Individual Copy() { 38 return new SingleEncodingIndividual(this); 43 39 } 44 40 … … 48 44 return encoding; 49 45 } 50 51 public override Individual CopyToScope(IScope scope) {52 SetScopeValue(Name, scope, (IItem)this[Name].Clone());53 return new SingleEncodingIndividual(Encoding, scope);54 }55 46 } 56 47
Note: See TracChangeset
for help on using the changeset viewer.