commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (MATH-775) In the ListPopulation constructor, the check for a negative populationLimit should occur first.
Date Thu, 05 Apr 2012 22:16:27 GMT

     [ https://issues.apache.org/jira/browse/MATH-775?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Thomas Neidhart resolved MATH-775.
----------------------------------

    Resolution: Fixed

The patch has been committed in r1310103, together with other changes that have been outlined
before.

Additionally, I have added two new methods:

 * public void addChromosomes(Collection<Chromosome> c)
 * protected List<Chromosome> getChromosomeList()

and made setChromosomes deprecated.

Rationale:

The internal state of ListPopulation shall be protected, and shall not be changeable from
the outside as it was possible before. When adding chromosomes, the entries are added to the
internal list, instead of setting the internal list reference to the provided list.

Derived classes can get access to the internal list via getChromosomeList (we could also make
the internal list protected, is there a policy in CM?).

The setters throw appropriate exceptions to keep the internal state consistent, and addChromosome
also throws an exception if the population would exceed the population limit.
                
> In the ListPopulation constructor, the check for a negative populationLimit should occur
first.
> -----------------------------------------------------------------------------------------------
>
>                 Key: MATH-775
>                 URL: https://issues.apache.org/jira/browse/MATH-775
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Reid Hochstedler
>              Labels: genetics
>             Fix For: 3.1
>
>         Attachments: MATH-775.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> In the ListPopulation constructor, the check to see whether the populationLimit is positive
should occur before the check to see if the number of chromosomes is greater than the populationLimit.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message