Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/15 14:42:48 (10 years ago)
Author:
mkommend
Message:

#2174: Distributed files in programmable problem branch to the correct plugins.

Location:
branches/ProgrammableProblem/HeuristicLab.Optimization/3.3/BasicProblems
Files:
1 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Optimization/3.3/BasicProblems/Individuals/Individual.cs

    r11885 r11949  
    2222using System;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Encodings.BinaryVectorEncoding;
    25 using HeuristicLab.Encodings.IntegerVectorEncoding;
    26 using HeuristicLab.Encodings.PermutationEncoding;
    27 using HeuristicLab.Encodings.RealVectorEncoding;
    2824
    29 namespace HeuristicLab.Problems.Programmable {
     25namespace HeuristicLab.Optimization {
    3026  public abstract class Individual {
    3127    protected IEncoding Encoding { get; private set; }
     
    6157    }
    6258  }
    63 
    64   #region extension methods
    65   public static class IndividualExtensionMethods {
    66     public static BinaryVector BinaryVector(this Individual individual) {
    67       var encoding = individual.GetEncoding<BinaryVectorEncoding>();
    68       return individual.BinaryVector(encoding.Name);
    69     }
    70     public static BinaryVector BinaryVector(this Individual individual, string name) {
    71       return (BinaryVector)individual[name];
    72     }
    73 
    74     public static IntegerVector IntegerVector(this Individual individual) {
    75       var encoding = individual.GetEncoding<IntegerVectorEncoding>();
    76       return individual.IntegerVector(encoding.Name);
    77     }
    78     public static IntegerVector IntegerVector(this Individual individual, string name) {
    79       return (IntegerVector)individual[name];
    80     }
    81 
    82     public static Permutation Permutation(this Individual individual) {
    83       var encoding = individual.GetEncoding<PermutationEncoding>();
    84       return individual.Permutation(encoding.Name);
    85     }
    86     public static Permutation Permutation(this Individual individual, string name) {
    87       return (Permutation)individual[name];
    88     }
    89 
    90     public static RealVector RealVector(this Individual individual) {
    91       var encoding = individual.GetEncoding<RealVectorEncoding>();
    92       return individual.RealVector(encoding.Name);
    93     }
    94     public static RealVector RealVector(this Individual individual, string name) {
    95       return (RealVector)individual[name];
    96     }
    97   }
    98   #endregion
    9959}
Note: See TracChangeset for help on using the changeset viewer.