- Timestamp:
- 03/15/10 23:49:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators/3.3/SubScopesSorter.cs
r3017 r3048 36 36 private string actualName; 37 37 38 public SubScopesLookupParameter<Double Data> ValueParameter {39 get { return (SubScopesLookupParameter<Double Data>)Parameters["Value"]; }38 public SubScopesLookupParameter<DoubleValue> ValueParameter { 39 get { return (SubScopesLookupParameter<DoubleValue>)Parameters["Value"]; } 40 40 } 41 public ValueLookupParameter<Bool Data> DescendingParameter {42 get { return (ValueLookupParameter<Bool Data>)Parameters["Descending"]; }41 public ValueLookupParameter<BoolValue> DescendingParameter { 42 get { return (ValueLookupParameter<BoolValue>)Parameters["Descending"]; } 43 43 } 44 44 private ScopeParameter CurrentScopeParameter { … … 51 51 public SubScopesSorter() 52 52 : base() { 53 Parameters.Add(new SubScopesLookupParameter<Double Data>("Value", "The values contained in each sub-scope acording which the sub-scopes of the current scope are sorted."));54 Parameters.Add(new ValueLookupParameter<Bool Data>("Descending", "True if the sub-scopes should be sorted in descending order, otherwise false."));53 Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Value", "The values contained in each sub-scope acording which the sub-scopes of the current scope are sorted.")); 54 Parameters.Add(new ValueLookupParameter<BoolValue>("Descending", "True if the sub-scopes should be sorted in descending order, otherwise false.")); 55 55 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope whose sub-scopes are sorted.")); 56 56 } … … 58 58 public override IOperation Apply() { 59 59 descending = DescendingParameter.ActualValue.Value; 60 actualName = LookupParameter<ItemArray<Double Data>>.TranslateName(ValueParameter.Name, ExecutionContext);60 actualName = LookupParameter<ItemArray<DoubleValue>>.TranslateName(ValueParameter.Name, ExecutionContext); 61 61 CurrentScope.SubScopes.Sort(SortScopes); 62 62 return base.Apply(); … … 75 75 return -1; 76 76 else { 77 int result = ((Double Data)var1.Value).CompareTo((DoubleData)var2.Value);77 int result = ((DoubleValue)var1.Value).CompareTo((DoubleValue)var2.Value); 78 78 if (descending) result = result * -1; 79 79 return result;
Note: See TracChangeset
for help on using the changeset viewer.