commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Neidhart <thomas.neidh...@gmail.com>
Subject Re: svn commit: r1409352 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/genetics/FixedElapsedTimeTest.java
Date Thu, 15 Nov 2012 08:19:30 GMT
On 11/15/2012 01:05 AM, Gilles Sadowski wrote:
> Hi.
> 
> On Wed, Nov 14, 2012 at 08:09:52PM -0000, tn@apache.org wrote:
>> Author: tn
>> Date: Wed Nov 14 20:09:51 2012
>> New Revision: 1409352
>>
>> URL: http://svn.apache.org/viewvc?rev=1409352&view=rev
>> Log:
>> Reduce sleep time in unit test to prevent possible race condition.
>>
>> Modified:
>>     commons/proper/math/trunk/src/test/java/org/apache/commons/math3/genetics/FixedElapsedTimeTest.java
>>
>> Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/genetics/FixedElapsedTimeTest.java
>> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/genetics/FixedElapsedTimeTest.java?rev=1409352&r1=1409351&r2=1409352&view=diff
>> ==============================================================================
>> --- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/genetics/FixedElapsedTimeTest.java
(original)
>> +++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/genetics/FixedElapsedTimeTest.java
Wed Nov 14 20:09:51 2012
>> @@ -59,7 +59,7 @@ public class FixedElapsedTimeTest {
>>  
>>          while (!tec.isSatisfied(pop)) {
>>              try {
>> -                Thread.sleep(500);
>> +                Thread.sleep(50);
>>              } catch (InterruptedException e) {
>>                  // ignore
>>              }
>>
> 
> I have never read this part of CM yet. But just this makes me think that the
> "FixedElapsedTime" class should not exist in CM. Indeed, using it makes the
> algorithm behave differently at each run!
> I don't deny the usefulness of allotting some amount of time for a
> computation, but this has absolutely nothing to do with genetic algorithms
> (nor any others).
> CM can help in implementing this high-level requirement, by allowing
> <some search algorithm> to be restarted with the result of a previous run
> but IMHO it is a bad idea to have the various CM codes directly implement
> that functionality.

just to clarify, the algorithm does not behave differently with this
stopping condition, it just stops earlier based on the time criteria.

The best solution found so far will be returned, very similar to a max
iteration count criteria.

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message