Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/16/19 16:12:21 (5 years ago)
Author:
abeham
Message:

#2521: worked on refactoring PTSP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/PercentValue.cs

    r17226 r17253  
    2121
    2222using System;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    25 using HEAL.Attic;
    2626
    2727namespace HeuristicLab.Data {
     
    5151    }
    5252    public PercentValue() : base() { }
    53     public PercentValue(double value) : base(value) { }
    54 
    55     public PercentValue(double value, bool restrictToUnitInterval)
     53    public PercentValue(double value, bool @readonly = false) : base(value, @readonly) { }
     54    // TODO: suggest to remove the following constructor [ABE]
     55    public PercentValue(double value, bool restrictToUnitInterval, bool @readonly = false)
    5656      : base() {
    5757      this.restrictToUnitInterval = restrictToUnitInterval;
     
    5959        throw new ArgumentException("Value must lie in the interval [0,1].");
    6060      this.value = value;
     61      this.readOnly = @readonly;
    6162    }
    6263
     
    101102      }
    102103    }
     104
     105    public new PercentValue AsReadOnly() {
     106      return (PercentValue)base.AsReadOnly();
     107    }
    103108  }
    104109}
Note: See TracChangeset for help on using the changeset viewer.