Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4043


Ignore:
Timestamp:
07/19/10 13:01:33 (12 years ago)
Author:
abeham
Message:

#926

  • Added LeftSelector and RightSelector (reverted some changes in r3096)
Location:
trunk/sources/HeuristicLab.Selection/3.3
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Selection/3.3/HeuristicLab.Selection-3.3.csproj

    r3832 r4043  
    8484    <Compile Include="BestSelector.cs" />
    8585    <Compile Include="ConditionalSelector.cs" />
     86    <Compile Include="LeftSelector.cs" />
    8687    <Compile Include="RandomReplacer.cs" />
    8788    <Compile Include="GenderSpecificSelector.cs" />
     
    8990    <Compile Include="Replacer.cs" />
    9091    <Compile Include="RightChildReducer.cs" />
     92    <Compile Include="RightSelector.cs" />
    9193    <Compile Include="SingleObjectiveSelector.cs" />
    9294    <Compile Include="LeftReducer.cs" />
  • trunk/sources/HeuristicLab.Selection/3.3/LeftSelector.cs

    r3095 r4043  
    2222using System.Collections.Generic;
    2323using HeuristicLab.Core;
     24using HeuristicLab.Data;
     25using HeuristicLab.Parameters;
    2426using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2527
     
    3032  [Item("LeftSelector", "An operator which selects sub-scopes from left to right.")]
    3133  [StorableClass]
    32   [Creatable("Test")]
    3334  public sealed class LeftSelector : Selector {
    34     public LeftSelector() : base() { }
     35    private ValueParameter<BoolValue> CopySelectedParameter {
     36      get { return (ValueParameter<BoolValue>)Parameters["CopySelected"]; }
     37    }
     38    public IValueLookupParameter<IntValue> NumberOfSelectedSubScopesParameter {
     39      get { return (ValueLookupParameter<IntValue>)Parameters["NumberOfSelectedSubScopes"]; }
     40    }
     41
     42    public BoolValue CopySelected {
     43      get { return CopySelectedParameter.Value; }
     44      set { CopySelectedParameter.Value = value; }
     45    }
     46
     47    public LeftSelector()
     48      : base() {
     49      Parameters.Add(new ValueParameter<BoolValue>("CopySelected", "True if the selected sub-scopes should be copied, otherwise false.", new BoolValue(true)));
     50      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfSelectedSubScopes", "The number of sub-scopes which should be selected."));
     51    }
    3552
    3653    protected override IScope[] Select(List<IScope> scopes) {
  • trunk/sources/HeuristicLab.Selection/3.3/RightSelector.cs

    r3095 r4043  
    2222using System.Collections.Generic;
    2323using HeuristicLab.Core;
     24using HeuristicLab.Data;
     25using HeuristicLab.Parameters;
    2426using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2527
     
    3032  [Item("RightSelector", "An operator which selects sub-scopes from right to left.")]
    3133  [StorableClass]
    32   [Creatable("Test")]
    3334  public sealed class RightSelector : Selector {
    34     public RightSelector() : base() { }
     35    private ValueParameter<BoolValue> CopySelectedParameter {
     36      get { return (ValueParameter<BoolValue>)Parameters["CopySelected"]; }
     37    }
     38    public IValueLookupParameter<IntValue> NumberOfSelectedSubScopesParameter {
     39      get { return (ValueLookupParameter<IntValue>)Parameters["NumberOfSelectedSubScopes"]; }
     40    }
     41
     42    public BoolValue CopySelected {
     43      get { return CopySelectedParameter.Value; }
     44      set { CopySelectedParameter.Value = value; }
     45    }
     46    public RightSelector()
     47      : base() {
     48      Parameters.Add(new ValueParameter<BoolValue>("CopySelected", "True if the selected sub-scopes should be copied, otherwise false.", new BoolValue(true)));
     49      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfSelectedSubScopes", "The number of sub-scopes which should be selected."));
     50    }
    3551
    3652    protected override IScope[] Select(List<IScope> scopes) {
Note: See TracChangeset for help on using the changeset viewer.