Free cookie consent management tool by TermsFeed Policy Generator

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2135 closed enhancement (done)

Add possibility to restrict PercentValues to [0,1]

Reported by: mkommend Owned by: mkommend
Priority: medium Milestone: HeuristicLab 3.3.10
Component: Data Version: 3.3.9
Keywords: Cc:

Description

It is rather common to have a percent value, which must be in the interval [0,1] (e.g., rel. number of samples, mutation rate, ...). Therefore, it should be possible to restrict the PercentValue to lie in the specified interval.

Change History (15)

comment:1 Changed 10 years ago by mkommend

  • Status changed from new to accepted
  • Version changed from 3.3.9 to branch

comment:2 Changed 10 years ago by mkommend

r10325: Branched HeuristicLab.Data for modification of the PercentValue type.

comment:3 Changed 10 years ago by mkommend

r10326: Added and configured solution for HeuristicLab.Data.

comment:4 Changed 10 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from accepted to reviewing

r10327: Added possibility to restrict PercentValue objects to [0,1].

Last edited 10 years ago by mkommend (previous) (diff)

comment:5 follow-up: Changed 10 years ago by gkronber

  • Owner changed from gkronber to mkommend
  • Status changed from reviewing to assigned

Reviewed comments for r10327:

  • Reuse the setter for Value in the constructor to remove duplicate code.
  • Change error message to: "The provided value must lie in the interval [0,1]".
  • I think the changes are Ok. It is not necessary to create a specialized class for this functionality.

comment:6 Changed 10 years ago by mkommend

r10352: Adapted error message in PercentValue.

comment:7 in reply to: ↑ 5 ; follow-up: Changed 10 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from assigned to reviewing

Replying to gkronber:

Reviewed comments for r10327:

  • Reuse the setter for Value in the constructor to remove duplicate code.

The setter for Value was not reused on purpose, because reusing it would mean to add a virtual member call in the ctor of PercentValue, which could lead to problems in potential subclasses.

comment:8 in reply to: ↑ 7 Changed 10 years ago by gkronber

  • Owner changed from gkronber to mkommend
  • Status changed from reviewing to assigned

Replying to mkommend:

Replying to gkronber:

Reviewed comments for r10327:

  • Reuse the setter for Value in the constructor to remove duplicate code.

The setter for Value was not reused on purpose, because reusing it would mean to add a virtual member call in the ctor of PercentValue, which could lead to problems in potential subclasses.

Maybe we could seal this class. In any case please change the error messages for the ArgumentException. I suggest to use "Value must lie in the interval [0,1]." in all exceptions.

comment:9 Changed 10 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from assigned to reviewing

r10405: Changed exception message in PercentValue.

comment:10 Changed 10 years ago by gkronber

  • Owner changed from gkronber to mkommend
  • Status changed from reviewing to readytorelease

Fine by me.

comment:11 Changed 10 years ago by mkommend

r10448: Merged branch changes to PercentValue into the trunk.

comment:12 Changed 10 years ago by mkommend

r10449: Delete branch for the changes in PercentValue.

comment:13 Changed 10 years ago by mkommend

r10505: merged r10448 into stable.

comment:14 Changed 10 years ago by mkommend

  • Resolution set to done
  • Status changed from readytorelease to closed

comment:15 Changed 10 years ago by abeham

  • Version changed from branch to 3.3.9
Note: See TracTickets for help on using tickets.