Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/25/14 13:05:14 (10 years ago)
Author:
mkommend
Message:

#2174: Configured solution creator in single encodings.

Location:
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryEncoding.cs

    r11575 r11582  
    2727using HeuristicLab.Data;
    2828using HeuristicLab.Encodings.BinaryVectorEncoding;
    29 using HeuristicLab.Optimization;
    3029using HeuristicLab.Parameters;
    3130using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    7473      : base(name) {
    7574      lengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length));
     75      RegisterParameterEvents();
     76      DiscoverOperators();
     77      SolutionCreator = Operators.OfType<RandomBinaryVectorCreator>().Single();
    7678    }
    7779
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/Encoding.cs

    r11559 r11582  
    4949
    5050
    51     ISolutionCreator IEncoding.DefaultSolutionCreator { get { return DefaultSolutionCreator; } }
    52     public virtual T DefaultSolutionCreator {
    53       get { return null; }
    54     }
    55 
    56 
    5751    ISolutionCreator IEncoding.SolutionCreator {
    5852      get { return SolutionCreator; }
     
    6559    public T SolutionCreator {
    6660      get {
    67         if (solutionCreator == null) return DefaultSolutionCreator;
    6861        return solutionCreator;
    6962      }
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerEncoding.cs

    r11561 r11582  
    8787      boundsParameter = cloner.Clone(original.boundsParameter);
    8888      RegisterParameterEvents();
    89       DiscoverOperators();
    9089    }
    9190    public override IDeepCloneable Clone(Cloner cloner) { return new IntegerEncoding(this, cloner); }
     
    102101      RegisterParameterEvents();
    103102      DiscoverOperators();
     103      SolutionCreator = Operators.OfType<UniformRandomIntegerVectorCreator>().Single();
    104104    }
    105105    public IntegerEncoding(string name, int length, IList<int> min, IList<int> max, IList<int> step = null)
     
    118118      RegisterParameterEvents();
    119119      DiscoverOperators();
     120      SolutionCreator = Operators.OfType<UniformRandomIntegerVectorCreator>().Single();
    120121    }
    121122
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/PermutationEncoding.cs

    r11575 r11582  
    2727using HeuristicLab.Data;
    2828using HeuristicLab.Encodings.PermutationEncoding;
    29 using HeuristicLab.Encodings.RealVectorEncoding;
    3029using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3130using HeuristicLab.PluginInfrastructure;
     
    9695      RegisterParameterEvents();
    9796      DiscoverOperators();
     97      SolutionCreator = Operators.OfType<RandomPermutationCreator>().Single();
    9898    }
    9999
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs

    r11561 r11582  
    103103      RegisterParameterEvents();
    104104      DiscoverOperators();
     105      SolutionCreator = Operators.OfType<UniformRandomRealVectorCreator>().Single();
    105106    }
    106107
     
    120121      RegisterParameterEvents();
    121122      DiscoverOperators();
     123      SolutionCreator = Operators.OfType<UniformRandomRealVectorCreator>().Single();
    122124    }
    123125
Note: See TracChangeset for help on using the changeset viewer.