Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17571


Ignore:
Timestamp:
05/28/20 18:03:00 (4 years ago)
Author:
mkommend
Message:

#2521: Changed parameters to use readonly only for GUI manipulation.

Location:
branches/2521_ProblemRefactoring
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEncoding.cs

    r17567 r17571  
    103103      bounds[0, 1] = max;
    104104
    105       lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
    106       boundsParameter = new ValueParameter<DoubleMatrix>(Name + ".Bounds", bounds);
     105      lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length)) { ReadOnly = true };
     106      boundsParameter = new ValueParameter<DoubleMatrix>(Name + ".Bounds", bounds) { ReadOnly = true };
    107107      Parameters.Add(lengthParameter);
    108108      Parameters.Add(boundsParameter);
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Encoding.cs

    r17570 r17571  
    9595    protected Encoding(string name)
    9696      : base(name) {
    97       Parameters.Add(new ValueParameter<ISolutionCreator<TEncodedSolution>>(name + ".SolutionCreator", "The operator to create a solution."));
     97      Parameters.Add(new ValueParameter<ISolutionCreator<TEncodedSolution>>(name + ".SolutionCreator", "The operator to create a solution.") {
     98        ReadOnly = true
     99      });
    98100      Parameters.Add(new FixedValueParameter<ReadOnlyItemSet<IOperator>>(name + ".Operators", "The operators that the encoding specifies.", encodingOperators.AsReadOnly()) {
    99         GetsCollected = false
     101        GetsCollected = false, ReadOnly = true
    100102      });
    101103
  • branches/2521_ProblemRefactoring/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs

    r17226 r17571  
    105105    protected override void SetEnabledStateOfControls() {
    106106      base.SetEnabledStateOfControls();
     107      ReadOnly = Content == null || Content.ReadOnly;
    107108      setValueButton.Enabled = Content != null && !Content.ReadOnly && !(Content is IFixedValueParameter) && !ReadOnly;
    108109      clearValueButton.Enabled = Content != null && !Content.ReadOnly && Content.Value != null && !(Content is IFixedValueParameter) && !(Content is ValueParameter<T>) && !ReadOnly;
  • branches/2521_ProblemRefactoring/HeuristicLab.Parameters/3.3/OptionalValueParameter.cs

    r17570 r17571  
    4444    public virtual T Value {
    4545      get { return this.value; }
    46       set {
    47         DoSetValue(value);
    48       }
     46      set { DoSetValue(value); }
    4947    }
    5048    private void DoSetValue(T value) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs

    r17544 r17571  
    177177    private void Parameterize() {
    178178      var operators = new List<IItem>();
     179
     180      //TODO correct wiring code, because most of the parameters are wired in the encoding
    179181      foreach (var op in Operators.OfType<PopulationSimilarityAnalyzer>()) {
    180182        var calcs = Operators.OfType<ISolutionSimilarityCalculator>().ToArray();
Note: See TracChangeset for help on using the changeset viewer.