add a retry feature for randomly failing CMA-ES optimizer test

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1103418 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2011-05-15 15:00:33 +00:00
parent e12caa8de1
commit e401d4ac06
1 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,8 @@ import java.util.Arrays;
import java.util.Random;
import org.apache.commons.math.MathException;
import org.apache.commons.math.Retry;
import org.apache.commons.math.RetryRunner;
import org.apache.commons.math.analysis.MultivariateRealFunction;
import org.apache.commons.math.exception.MathUserException;
import org.apache.commons.math.exception.MultiDimensionMismatchException;
@ -32,10 +34,12 @@ import org.apache.commons.math.optimization.RealPointValuePair;
import org.apache.commons.math.random.MersenneTwister;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Test for {@link CMAESOptimizer}.
*/
@RunWith(RetryRunner.class)
public class CMAESOptimizerTest {
static final int DIM = 13;
@ -130,6 +134,7 @@ public class CMAESOptimizerTest {
}
@Test
@Retry(3)
public void testMaximize() throws MathException {
double[] startPoint = point(DIM,1.0);
double[] insigma = point(DIM,0.1);