Changeset 8086 for branches/ScatterSearch (trunk integration)/HeuristicLab.Optimization.Operators/3.3
- Timestamp:
- 06/22/12 11:11:38 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 20 20 bin 21 21 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Optimization.Operators/3.3/HeuristicLab.Optimization.Operators-3.3.csproj
r7789 r8086 105 105 </Reference> 106 106 <Reference Include="System.Data" /> 107 <Reference Include="System.Drawing" /> 107 108 <Reference Include="System.Xml" /> 108 109 </ItemGroup> 109 110 <ItemGroup> 110 <Compile Include="ISimilarityCalculator.cs" />111 111 <Compile Include="GeneralizedExponentialDiscreteDoubleValueModifier.cs" /> 112 <Compile Include="IImprovementOperator.cs" />113 <Compile Include="IPathRelinker.cs" />114 112 <Compile Include="MultiObjective\CrowdedComparisonSorter.cs" /> 115 113 <Compile Include="MultiObjective\CrowdingDistanceAssignment.cs" /> -
branches/ScatterSearch (trunk integration)/HeuristicLab.Optimization.Operators/3.3/PathRelinker.cs
r7789 r8086 64 64 : base() { 65 65 #region Create parameters 66 Parameters.Add(new ScopeParameter("CurrentScope" ));67 Parameters.Add(new ScopeTreeLookupParameter<IItem>("Parents" ));68 Parameters.Add(new ValueParameter<PercentValue>("RelinkingAccuracy", new PercentValue(0.25)));66 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope that contains the parents.")); 67 Parameters.Add(new ScopeTreeLookupParameter<IItem>("Parents", "The parents used for path relinking.")); 68 Parameters.Add(new ValueParameter<PercentValue>("RelinkingAccuracy", "The percentage of relinked offspring that should be yielded.", new PercentValue(0.25))); 69 69 #endregion 70 70 } -
branches/ScatterSearch (trunk integration)/HeuristicLab.Optimization.Operators/3.3/SimilarityCalculator.cs
r7793 r8086 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Operators;26 using HeuristicLab.Parameters;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 25 29 26 namespace HeuristicLab.Optimization.Operators { 30 27 /// <summary> 31 /// A base class for operators that perform diversity calculation between two solutions.28 /// A base class for items that perform similarity calculation between two solutions. 32 29 /// </summary> 33 [Item("DiversityCalculator", "A base class for operators that perform diversity calculation between two solutions.")] 34 [StorableClass] 35 public abstract class SimilarityCalculator : SingleSuccessorOperator, ISimilarityCalculator { 36 #region Parameter properties 37 public IValueLookupParameter<IItem> TargetParameter { 38 get { return (IValueLookupParameter<IItem>)Parameters["Target"]; } 39 } 30 [Item("SimilarityCalculator", "A base class for items that perform similarity calculation between two solutions.")] 31 public abstract class SimilarityCalculator : Item, ISimilarityCalculator { 32 #region Properties 33 public string Target { get; set; } 40 34 #endregion 41 35 42 #region Properties43 private IItem Target {44 get { return TargetParameter.ActualValue; }45 }46 #endregion47 48 [StorableConstructor]49 36 protected SimilarityCalculator(bool deserializing) : base(deserializing) { } 50 37 protected SimilarityCalculator(SimilarityCalculator original, Cloner cloner) : base(original, cloner) { } 51 protected SimilarityCalculator() 52 : base() { 53 #region Create parameters 54 Parameters.Add(new ValueLookupParameter<IItem>("Target")); 55 #endregion 56 } 57 58 public sealed override IOperation Apply() { // TODO: check if sealed fits here? 59 return base.Apply(); 60 } 38 protected SimilarityCalculator() : base() { } 61 39 62 40 public double ExecuteCalculation(IScope left, IScope right) { … … 64 42 throw new ArgumentException("Cannot calculate diversity because one or both of the provided scopes is null."); 65 43 66 if (left == right) return 0;44 if (left == right) return 1.0; 67 45 else return CalculateSimilarity(left, right); 68 46 } 69 47 70 48 protected abstract double CalculateSimilarity(IScope left, IScope right); 49 50 public override Common.IDeepCloneable Clone(Common.Cloner cloner) { return null; } 71 51 } 72 52 }
Note: See TracChangeset
for help on using the changeset viewer.