Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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))
Ejemplo n.º 3
0
    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)