Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/15/14 15:06:57 (11 years ago)
Author:
abeham
Message:

#2174: Worked on programmable problem

  • Changed ProblemBase to IProblemDefinition and SingleObjectiveProblemBase to ISingleObjectiveProblemDefinition
  • Derived ParameterVectorCreater, -Crossover, and -Manipulator from MultiOperator<> instead of InstrumentedOperator
  • Split the megamoth ScriptOnInstanceChanged to multiple methods dealing with single-vector and multi-vector encodings separately, it's still a lot of tedious code
  • Removed maximization from Configuration again (would not be consistent with multi-objective problems)
Location:
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/BinaryParameterConfiguration.cs

    r10850 r10856  
    4646      length = cloner.Clone(original.length);
    4747    }
    48     public BinaryParameterConfiguration(int length)
    49       : base() {
     48    public BinaryParameterConfiguration(int length) {
    5049      this.length = new IntValue(length);
    5150    }
  • branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/Configuration.cs

    r10855 r10856  
    3434    public Dictionary<string, ParameterConfiguration> Parameters { get; protected set; }
    3535
    36     [Storable]
    37     public bool Maximization { get; protected set; }
    38 
    3936    [StorableConstructor]
    4037    protected Configuration(bool deserializing) : base(deserializing) { }
     
    4744        }
    4845      }
    49       Maximization = original.Maximization;
    5046    }
    5147    public Configuration() {
     
    8884    }
    8985
    90     public Configuration AddPermutation(string name, PermutationTypes type, int length) {
     86    public Configuration AddPermutation(string name, int length, PermutationTypes type) {
    9187      if (Parameters.ContainsKey(name)) throw new ArgumentException("name must be unique", "name");
    9288      Parameters.Add(name, new PermutationParameterConfiguration(length, type));
    9389      return this;
    9490    }
    95 
    96     public Configuration SetMaximization(bool maximization) {
    97       Maximization = maximization;
    98       return this;
    99     }
    10091  }
    10192}
  • branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/IntegerParameterConfiguration.cs

    r10850 r10856  
    6161      bounds = cloner.Clone(original.bounds);
    6262    }
    63     public IntegerParameterConfiguration(int length, int min, int max, int? step = null)
    64       : base() {
     63    public IntegerParameterConfiguration(int length, int min, int max, int? step = null) {
    6564      if (min >= max) throw new ArgumentException("min must be less than max", "min");
    6665      if (step.HasValue && step.Value <= 0) throw new ArgumentException("step must be greater than zero or null", "step");
     
    7170      if (step.HasValue) bounds[0, 2] = step.Value;
    7271    }
    73     public IntegerParameterConfiguration(int length, IList<int> min, IList<int> max, IList<int> step = null)
    74       : base() {
     72    public IntegerParameterConfiguration(int length, IList<int> min, IList<int> max, IList<int> step = null) {
    7573      if (min.Count == 0) throw new ArgumentException("Bounds must be given for the integer parameters.");
    7674      if (min.Count != max.Count) throw new ArgumentException("min must be of the same length as max", "min");
    7775      if (step != null && min.Count != step.Count) throw new ArgumentException("step must be of the same length as min or null", "step");
    78       if (min.Zip(max, (m, M) => m >= M).Any()) throw new ArgumentException("min must be less than max in each dimension", "min");
     76      if (min.Zip(max, (mi, ma) => mi >= ma).Any()) throw new ArgumentException("min must be less than max in each dimension", "min");
    7977      this.length = new IntValue(length);
    8078      bounds = new IntMatrix(min.Count, step != null ? 3 : 2);
  • branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/PermutationParameterConfiguration.cs

    r10850 r10856  
    5959      type = cloner.Clone(original.type);
    6060    }
    61     public PermutationParameterConfiguration(int length, PermutationTypes type)
    62       : base() {
     61    public PermutationParameterConfiguration(int length, PermutationTypes type) {
    6362      this.length = new IntValue(length);
    6463      this.type = new PermutationType(type);
  • branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/RealParameterConfiguration.cs

    r10850 r10856  
    6161      bounds = cloner.Clone(original.bounds);
    6262    }
    63     public RealParameterConfiguration(int length, double min, double max)
    64       : base() {
     63    public RealParameterConfiguration(int length, double min, double max) {
    6564      if (min >= max) throw new ArgumentException("min must be less than max", "min");
    6665      this.length = new IntValue(length);
     
    6968      bounds[0, 1] = max;
    7069    }
    71     public RealParameterConfiguration(int length, IList<double> min, IList<double> max)
    72       : base() {
     70    public RealParameterConfiguration(int length, IList<double> min, IList<double> max) {
    7371      if (min.Count == 0) throw new ArgumentException("Bounds must be given for the real parameters.");
    7472      if (min.Count != max.Count) throw new ArgumentException("min must be of the same length as max", "min");
    75       if (min.Zip(max, (m, M) => m >= M).Any()) throw new ArgumentException("min must be less than max in each dimension", "min");
     73      if (min.Zip(max, (mi, ma) => mi >= ma).Any()) throw new ArgumentException("min must be less than max in each dimension", "min");
    7674      this.length = new IntValue(length);
    7775      bounds = new DoubleMatrix(min.Count, 2);
Note: See TracChangeset for help on using the changeset viewer.