def __init__(self): Benchmark.__init__(self, -10, 10) def function(self): def evaluate(D, sol): val = 0.0 for i in range(D): val += sol[i]**2 return val return evaluate runner = Runner(D=40, nFES=100, nRuns=2, useAlgorithms=[ GreyWolfOptimizer(), "FlowerPollinationAlgorithm", ParticleSwarmAlgorithm(), "HybridBatAlgorithm", "SimulatedAnnealing", "CuckooSearch" ], useBenchmarks=[ Ackley(), Griewank(), Sphere(), HappyCat(), "rastrigin", MyBenchmark() ]) runner.run(export='json', verbose=True)
Ackley, Griewank, Sphere, HappyCat ) """Example demonstrating the use of NiaPy Runner.""" runner = Runner( D=40, nFES=100, nRuns=2, useAlgorithms=[ GreyWolfOptimizer(), "FlowerPollinationAlgorithm", ParticleSwarmAlgorithm(), "HybridBatAlgorithm", "SimulatedAnnealing", "CuckooSearch"], useBenchmarks=[ Ackley(), Griewank(), Sphere(), HappyCat(), "rastrigin"] ) print(runner.run(verbose=True))
def __init__(self): Benchmark.__init__(self, -10, 10) def function(self): def evaluate(D, sol): val = 0.0 for i in range(D): val += sol[i]**2 return val return evaluate runner = Runner(D=40, nFES=100, nRuns=2, useAlgorithms=[ GreyWolfOptimizer(), "FlowerPollinationAlgorithm", ParticleSwarmAlgorithm(), "HybridBatAlgorithm", "SimulatedAnnealing", "CuckooSearch" ], useBenchmarks=[ Ackley(), Griewank(), Sphere(), HappyCat(), "rastrigin", MyBenchmark() ]) runner.run(export='dataframe', verbose=True)