def setUp(self): self.D = 40 self.es_custom = EvolutionStrategyML(D=self.D, nFES=1000, mu=45, k=50, c_a=1.1, c_r=0.5, benchmark=MyBenchmark()) self.es1_custom = EvolutionStrategyML(D=self.D, nFES=1000, mu=45, lam=35, k=50, c_a=1.1, c_r=0.5, benchmark=MyBenchmark()) self.es_griewank = EvolutionStrategyML(D=self.D, nFES=1000, mu=35, lam=45, k=45, c_a=1.5, c_r=0.5, benchmark=Griewank()) self.es1_griewank = EvolutionStrategyML(D=self.D, nFES=1000, mu=45, lam=35, k=25, c_a=1.5, c_r=0.5, benchmark=Griewank())
def test_typeParametes(self): d = EvolutionStrategyML.typeParameters() self.assertTrue(d['lam'](10)) self.assertFalse(d['lam'](10.10)) self.assertFalse(d['lam'](0)) self.assertFalse(d['lam'](-10))