Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/29/10 17:53:12 (14 years ago)
Author:
abeham
Message:

Added a permutation type property specifying whether it's a relative (directed or undirected) or absolute permutation #889

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Creators/RandomPermutationCreator.cs

    r3160 r3231  
    4747      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    4848    }
     49    public IValueParameter<PermutationType> PermutationTypeParameter {
     50      get { return (IValueParameter<PermutationType>)Parameters["PermutationType"]; }
     51    }
     52
     53    public PermutationTypes PermutationType {
     54      get { return PermutationTypeParameter.Value.Value; }
     55      set { PermutationTypeParameter.Value.Value = value; }
     56    }
    4957
    5058    public RandomPermutationCreator()
     
    5361      Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the new random permutation."));
    5462      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The new random permutation."));
     63      Parameters.Add(new ValueParameter<PermutationType>("PermutationType", "The type of the permutation.", new PermutationType(PermutationTypes.RelativeUndirected)));
    5564    }
    5665
    5766    public override IOperation Apply() {
    58       PermutationParameter.ActualValue = new Permutation(LengthParameter.ActualValue.Value, RandomParameter.ActualValue);
     67      PermutationParameter.ActualValue = new Permutation(PermutationType, LengthParameter.ActualValue.Value, RandomParameter.ActualValue);
    5968      return base.Apply();
    6069    }
Note: See TracChangeset for help on using the changeset viewer.