Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/15 16:42:09 (9 years ago)
Author:
mkommend
Message:

#2521: Refactored IntegerVectorEncoding, KnapsackProblem, and P3.

Location:
branches/ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVector.cs

    r12012 r13364  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Data;
     26using HeuristicLab.Optimization;
    2627using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2728
     
    2930  [StorableClass]
    3031  [Item("IntegerVector", "Represents a vector of integer values.")]
    31   public class IntegerVector : IntArray {
     32  public class IntegerVector : IntArray, ISolution {
    3233    [StorableConstructor]
    3334    protected IntegerVector(bool deserializing) : base(deserializing) { }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorEncoding.cs

    r12837 r13364  
    3434  [Item("IntegerVectorEncoding", "Describes an integer vector encoding.")]
    3535  [StorableClass]
    36   public sealed class IntegerVectorEncoding : Encoding<IIntegerVectorCreator> {
     36  public sealed class IntegerVectorEncoding : Encoding<IntegerVector> {
    3737    #region Encoding Parameters
    3838    [Storable]
     
    271271    #endregion
    272272  }
    273 
    274   public static class IndividualExtensionMethods {
    275     public static IntegerVector IntegerVector(this Individual individual) {
    276       var encoding = individual.GetEncoding<IntegerVectorEncoding>();
    277       return individual.IntegerVector(encoding.Name);
    278     }
    279     public static IntegerVector IntegerVector(this Individual individual, string name) {
    280       return (IntegerVector)individual[name];
    281     }
    282   }
    283273}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Interfaces/IIntegerVectorCreator.cs

    r12012 r13364  
    2828  /// An interface which represents an operator for creating vectors of int-valued data.
    2929  /// </summary>
    30   public interface IIntegerVectorCreator : ISolutionCreator, IBoundedIntegerVectorOperator {
     30  public interface IIntegerVectorCreator : ISolutionCreator<IntegerVector>, IBoundedIntegerVectorOperator {
    3131    IValueLookupParameter<IntValue> LengthParameter { get; }
    3232    ILookupParameter<IntegerVector> IntegerVectorParameter { get; }
Note: See TracChangeset for help on using the changeset viewer.