py4sci

News

03/2013 PyGMO tries GSoC. Project pages

02/2013 V1.1.4 is out! Release notes

Get PyGMO: UNIX

First you need to prepare your system to run PyGMO. (and install third-party optional packages)

Then you may get PyGMO

As a last step, compile and install PyGMO

Get PyGMO: win32

Download the autoinstaller

Shortcuts

Algorithms

Problems

Topologies

Report a Bug

Go to our bugtracker

Request for support

Contact our mailinglist

Problems

A Quick Look

Problems in PyGMO are objects, first constructed and then used in conjunction to an algorithm. The user can implement its own problem directly in Python, in which case he needs to inherit from PyGMO.problem.base or PyGMO.problem.base_stochastic class. You may see Tutorial 1: Coding an optimization problem in Python or Tutorial 2: Coding a stochastic optimization problem in Python

Meta-problems

Common Name Name in PyGMO Comments
Rotated PyGMO.problem.rotated from V1.1.5
Shifted PyGMO.problem.shifted from V1.1.5
Normalized PyGMO.problem.normalized from V1.1.5

Box-Constrained Continuous Single-Objective

Common Name Name in PyGMO Comments
Ackley PyGMO.problem.ackley  
Bukin F6 PyGMO.problem.bukin A difficult bi-dimensional problem
Branin PyGMO.problem.branin Bi-dimensional problem
CEC2013 PyGMO.problem.cec2013 28 problems part of CEC2013 Competition
De Jong PyGMO.problem.dejong  
De Jong PyGMO.problem.py_example Implemented directly in Python
Griewank PyGMO.problem.griewank  
Himmelblau PyGMO.problem.himmelblau Bi-dimensional problem
Lennard-Jones PyGMO.problem.lennard_jones  
Michalewicz PyGMO.problem.michalewicz  
Rosenbrock PyGMO.problem.rosenbrock  
Rastrigin PyGMO.problem.rastrigin  
Schwefel PyGMO.problem.schwefel  
MGA-1DSM (tof encoding) PyGMO.problem.mga_1dsm_tof Requires the GTOP database option active
MGA-1DSM (alpha encoding) PyGMO.problem.mga_1dsm_alpha Requires the GTOP database option active
Cassini 1 PyGMO.problem.cassini_1 Requires the GTOP database option active
Cassini 2 PyGMO.problem.cassini_2 Requires the GTOP database option active
Rosetta PyGMO.problem.rosetta Requires the GTOP database option active
Tandem PyGMO.problem.tandem Requires the GTOP database option active
Laplace PyGMO.problem.tandem Requires the GTOP database option active
Messenger (Full Problem) PyGMO.problem.messenger_full Requires the GTOP database option active
GTOC1 PyGMO.problem.gtoc_1 Requires the GTOP database option active
Sagas PyGMO.problem.sagas Requires the GTOP database option active

Box-Constrained Continuous Multi-Objective

Common Name Name in PyGMO Comments
Kursawe’s study PyGMO.problem.kur  
Fonseca and Fleming’s study PyGMO.problem.fon  
Poloni’s study PyGMO.problem.pol  
Shaffer’s study PyGMO.problem.sch  
ZDT1 PyGMO.problem.zdt1  
ZDT2 PyGMO.problem.zdt2  
ZDT3 PyGMO.problem.zdt3  
ZDT4 PyGMO.problem.zdt4  
ZDT5 PyGMO.problem.zdt5  
ZDT6 PyGMO.problem.zdt6  
DTLZ1 PyGMO.problem.dtlz1  
DTLZ2 PyGMO.problem.dtlz2  
DTLZ3 PyGMO.problem.dtlz3  
DTLZ4 PyGMO.problem.dtlz4  
DTLZ5 PyGMO.problem.dtlz5  
DTLZ6 PyGMO.problem.dtlz6  
DTLZ7 PyGMO.problem.dtlz7  
MGA-1DSM (tof encoding) PyGMO.problem.mga_1dsm_tof Requires the GTOP database option active
MGA-1DSM (alpha encoding) PyGMO.problem.mga_1dsm_alpha Requires the GTOP database option active
Cassini 1 PyGMO.problem.cassini_1 Requires the GTOP database option active

Constrained Continuous Single-Objective

Common Name Name in PyGMO Comments
Luksan Vlcek 1 PyGMO.problem.luksan_vlcek_1  
Luksan Vlcek 2 PyGMO.problem.luksan_vlcek_2  
Luksan Vlcek 3 PyGMO.problem.luksan_vlcek_3  
Planet to Planet LT Transfer PyGMO.problem.py_pl2pl Requires PyKEP. Implemented in Python
SNOPT Toy-Problem PyGMO.problem.snopt_toyprob  
GTOC2 (Full Problem) PyGMO.problem.gtoc_2 Requires the GTOP database option active

Box-Constrained Integer Single-Objective

Common Name Name in PyGMO Comments
String Match PyGMO.problem.string_match  

Constrained Integer Single-Objective

Common Name Name in PyGMO Comments
Golomb Ruler PyGMO.problem.golomb_ruler  
Traveling Salesman PyGMO.problem.tsp  
Knapsack PyGMO.problem.knapsack  

Stochastic Objective Function

Common Name Name in PyGMO Comments
Inventory Problem PyGMO.problem.inventory  
MIT SPHERES PyGMO.problem.mit_spheres  
Noisy De Jong PyGMO.problem.py_example_stochastic  

Detailed Documentation

class PyGMO.problem.base(*args)

This class is the base class for all non-stochastic optimization problems. When defining an optimization problem in PyGMO, the user needs to write a class that inherits from this base class and needs to call its constructor. He will then need to re-implement a number of virtual functions that define the problem objectives and constraints, as well as defining the box-bounds on the decision vector.

__init__(*args)

Base problem constructor. It must be called from within the derived class constructor __init__()

USAGE: super(derived_class_name,self).__init__(dim, i_dim, n_obj, c_dim, c_ineq_dim, c_tol)

  • dim: Total dimension of the decision vector
  • i_dim: dimension of the integer part of decision vector (the integer part is placed at the end of the decision vector). Defaults to 0
  • n_obj: number of objectives. Defaults to 1
  • c_dim: total dimension of the constraint vector. dDefaults to 0
  • c_ineq_dim: dimension of the inequality part of the constraint vector (inequality const. are placed at the end of the decision vector). Defaults to 0
  • c_tol: constraint tolerance. When comparing individuals, this tolerance is used to decide whether a constraint is considered satisfied.
_objfun_impl(self, x)

This is a virtual function tham must be re-implemented in the derived class and must return a tuple packing as many numbers as the problem objectives (n_obj)

_compute_constraints_impl(self, x)

This is a virtual function tham can must be re-implemented in the derived class (if c_dim>0) and must return a tuple packing as many numbers as the declared dimension of the problem constraints (c_dim). Inequality constarints need to be packed at last.

reset_caches((_base)arg1) → None :

Resets the internal caching system of PyGMO. This needs to be called whenever the state of the problem is changed i.e. the seed in a stochastic optimization problem or the trajectory model in a low-thrust optimization etc..

set_bounds((_base)arg1, (float)arg2, (float)arg3) → None :
Set all bounds to the input values.
set_bounds( (_base)arg1, (object)arg2, (object)arg3) -> None :
Set bounds to the input vectors.
feasibility_x((_base)arg1, (object)arg2) → bool :

Determine feasibility of decision vector.

feasibility_c((_base)arg1, (object)arg2) → bool :

Determine feasibility of constraint vector.

class PyGMO.problem.shifted(problem=None, shift=None)

Shifted problem

__init__(problem=None, shift=None)

Shifts a problem.

NOTE: this meta-problem constructs a new problem where the objective function will be f(x+b),
where b is the shift (bounds are also chaged accordingly)

USAGE: problem.(problem=PyGMO.ackley(1), shift = a random vector)

  • problem: PyGMO problem one wants to shift
  • shift: a value or a list containing the shifts. By default, a radnom shift is created within the problem bounds
shift_vector

The shift vector defining the new problem

PyGMO.problem.shifted.deshift((tuple) x)

Returns the de-shifted decision vector

class PyGMO.problem.rotated(problem=None, rotation=None)

Rotated problem

__init__(problem=None, rotation=None)

Rotates a problem. (also reflections are possible) The new objective function will be f(Rx_{normal}), where R is an orthogonal matrix and x_{normal} is the decision vector normailized to [-1,1]

NOTE: To ensure all of the original space is included in the new box-constrained search space, bounds of the normalized variables are expanded to [-sqrt(2),sqrt(2)]. It is still guaranteed theat the original objective function will not be called outside of the original bounds by projecting points outside the original space onto the boundary

USAGE: problem.(problem=PyGMO.ackley(1), rotation = a random orthogonal matrix)

  • problem: PyGMO problem one wants to shift
  • rotation: a list of lists (matrix). If not specified, a random orthogonal matrix is used.
rotation

The rotation matrix defining the new problem

PyGMO.problem.rotated.derotate((tuple) x)

Returns the de-rotated decision vector

class PyGMO.problem.normalized(problem=None)

Normalized problem

__init__(problem=None)

Normalizes a problem (e.g. maps all variables to [-1,1])

NOTE: this meta-problem constructs a new problem having normalized bounds/variables

USAGE: problem.(problem=PyGMO.ackley(1))

  • problem: PyGMO problem one wants to normalize
PyGMO.problem.normalized.denormalize((tuple) x)

Returns the de-normalized decision vector

class PyGMO.problem.ackley(dim=10)

Ackley function.

__init__(dim=10)

Constructs a Ackley problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.ackley(dim=10)

  • dim: problem dimension
class PyGMO.problem.bukin

Bukin’s f6 function.

__init__()

Constructs a Bukin’s f6 problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.bukin()

class PyGMO.problem.cec2013(dim=10, prob_id=1, path='input_data/')

CEC2013 Competition Problems.

__init__(dim=10, prob_id=1, path='input_data/')

Constructs one of the 28 CEC2013 Competition Problems (Box-Constrained Continuous Single-Objective)

NOTE: this problem requires two files to be put in the path indicated. “M_Dxx.txt” and “shift_data.txt”
These files can be downloaded from the CEC2013 competition site

USAGE: problem.cec2013(dim = 10, prob_id=1, path=”input_data/”)

class PyGMO.problem.rosenbrock(dim=10)

Multi-dimensional Rosenbrock function.

__init__(dim=10)

Constructs a Rosenbrock problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.rosenbrock(dim=10)

  • dim: problem dimension
class PyGMO.problem.string_match(string='Can we use it for space?')

String matching problem.

__init__(string='Can we use it for space?')

Constructs a string-match problem (Box-Constrained Integer Single-Objective)

NOTE: This is the problem of matching a string. Transcribed as an optimization problem

USAGE: problem.string_match(string = “mah”)

  • string: string to match
PyGMO.problem.pretty(x)

Returns a string decoding the chromosome

class PyGMO.problem.rastrigin(dim=10)

Generalised Rastrigin function.

__init__(dim=10)

Constructs a Rastrigin problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.rastrigin(dim=10)

  • dim: problem dimension
class PyGMO.problem.schwefel(dim=10)

Two-dimensional Schwefel function.

__init__(dim=10)

Constructs a Schwefel problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.schwefel(dim=10)

  • dim: problem dimension
class PyGMO.problem.dejong(dim=10)

De Jong’s function.

__init__(dim=10)

Constructs a De Jong problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.dejong(dim=10)

  • dim: problem dimension
class PyGMO.problem.py_example(dim=10)

De Jong (sphere) function implemented purely in Python.

USAGE: py_example(dim = 10)

  • dim problem dimension
__init__(dim=10)
class PyGMO.problem.griewank(dim=10)

Griewank function.

__init__(dim=10)

Constructs a De Jong problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.dejong(dim=10)

  • dim: problem dimension
class PyGMO.problem.lennard_jones(n_atoms=4)

Lennard Jones problem.

__init__(n_atoms=4)

Constructs a Lennard-Jones problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.lennard_jones(n_atoms=4)

  • n_atoms: number of atoms
class PyGMO.problem.branin

Branin’s rcos function.

__init__()

Constructs a Branin problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.branin()

class PyGMO.problem.himmelblau

Himmelblau’s function.

__init__()

Constructs a Himmelblau problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.himmelblau()

class PyGMO.problem.michalewicz(dim=10)

Michalewicz’s function.

__init__(dim=10)

Constructs a Michalewicz problem (Box-Constrained Continuous Single-Objective)

USAGE: problem.michalewicz(dim=5)

NOTE: Minimum is -4.687 for dim=5 and -9.66 for dim = 10

  • dim: problem dimension
class PyGMO.problem.kur(dim=10)

Kursawe’s study problem.

__init__(dim=10)

Constructs a Kursawe’s study problem (Box-Constrained Continuous Multi-Objective)

NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002

USAGE: problem.kur()

  • dim: problem dimension
class PyGMO.problem.fon

Fonseca and Fleming’s study problem.

__init__()

Constructs a Fonseca and Fleming’s study problem (Box-Constrained Continuous Multi-Objective)

NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002

USAGE: problem.fon()

class PyGMO.problem.pol

Poloni’s study problem.

__init__()

Constructs a Poloni’s study study problem (Box-Constrained Continuous Multi-Objective)

NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002

USAGE: problem.pol()

class PyGMO.problem.sch

Shaffer’s study problem.

__init__()

Constructs a Schaffer’s study problem (Box-Constrained Continuous Multi-Objective)

NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002

USAGE: problem.sch()

class PyGMO.problem.zdt1(dim=30)

ZDT1

__init__(dim=30)

Constructs a ZDT1 problem (Box-Constrained Continuous Multi-Objective)

NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002

USAGE: problem.zdt1(dim = 30)

  • dim: problem dimension
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
class PyGMO.problem.zdt2(dim=30)

ZDT2

__init__(dim=30)

Constructs a ZDT2 problem (Box-Constrained Continuous Multi-Objective)

NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002

USAGE: problem.zdt2(dim = 30)

  • dim: problem dimension
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
class PyGMO.problem.zdt3(dim=30)

ZDT3

__init__(dim=30)

Constructs a ZDT3 problem (Box-Constrained Continuous Multi-Objective)

NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002

USAGE: problem.zdt3(dim = 30)

  • dim: problem dimension
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
class PyGMO.problem.zdt4(dim=10)

ZDT4

__init__(dim=10)

Constructs a ZDT4 problem (Box-Constrained Continuous Multi-Objective)

NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002

USAGE: problem.zdt4(dim = 10)

  • dim: problem dimension
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
class PyGMO.problem.zdt5(bnr=11)

ZDT5

__init__(bnr=11)

Constructs a ZDT5 problem (Box-Constrained Continuous Multi-Objective)

NOTE: E. Zitzler, K. Deb, L. Thiele: Comparison of Multiobjective Evolutionary Algorithms: Empirical Results, Evolutionary Computation, 2000

USAGE: problem.zdt5(bnr = 11)

  • bnr: number of binary strings used for the problem (problem dimension is 30 + 5 * (bnr - 1))
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
class PyGMO.problem.zdt6(dim=10)

ZDT6

__init__(dim=10)

Constructs a ZDT6 problem (Box-Constrained Continuous Multi-Objective)

NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002

USAGE: problem.zdt6(dim = 10)

  • dim: problem dimension
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
class PyGMO.problem.dtlz1(k=5, fdim=3)

DTLZ1 benchmark problem.

__init__(k=5, fdim=3)

Constructs a DTLZ1 problem (Box-Constrained, continuous, multimodal, scalable multi-objective)

NOTE: K Deb, L Thiele, M Laumanns, E Zitzler, Scalable test problems for evolutionary multiobjective optimization

The optimal pareto front lies on a linear hyperplane with f_1 + f_2 + ... + f_m = 0.5.

USAGE: problem.dt1z1(k = 5, fdim=3)

  • k: defines problem dimension as k + fdim - 1
  • fdim: number of objectives
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
plot(pop, a=40, comp=[0, 1, 2])

Generic plot-method for multi-objective optimization problems with more then 2 objectives

USAGE: prob.plot(pop, comp[0,2,3]) * pop: population of solutions to the problem * a: angle of view on which the 3d-plot is created * comp: indexes the fitness dimension for x,y and z axis in that order

class PyGMO.problem.dtlz2(k=10, fdim=3)

DTLZ2 benchmark problem.

__init__(k=10, fdim=3)

Constructs a DTLZ2 problem (Box-Constrained, continuous, unimodal, scalable multi-objective)

NOTE: K Deb, L Thiele, M Laumanns, E Zitzler, Scalable test problems for evolutionary multiobjective optimization

The search space is continous, unimodal and the problem is not deceptive. The Pareto-front is a quarter of a sphere

USAGE: problem.dt1z2(k = 10, fdim=3)

  • k: defines problemdimension as k + fdim - 1
  • fdim: number of objectives
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
plot(pop, a=40, comp=[0, 1, 2])

Specific plot-method for the DTLZ2, DTLZ3 and DTLZ4 - plotting also the optimal pareto-front

USAGE: prob.plot(pop, comp[0,2,3])

  • pop: population of solutions to the problem
  • a: angle of view on which the 3d-plot is created
  • comp: indexes the fitness dimension for x,y and z axis in that order
class PyGMO.problem.dtlz3(k=10, fdim=3)

DTLZ3 benchmark problem.

__init__(k=10, fdim=3)

Constructs a DTLZ3 problem (Box-Constrained, continuous, multimodal, scalable multi-objective)

Same Pareto Front as DTLZ2, but harder to converge towards it

NOTE: K Deb, L Thiele, M Laumanns, E Zitzler, Scalable test problems for evolutionary multiobjective optimization

USAGE: problem.dt1z3(k = 10, fdim=3)

  • k: defines problemdimension as k + fdim - 1
  • fdim: number of objectives
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
plot(pop, a=40, comp=[0, 1, 2])

Specific plot-method for the DTLZ2, DTLZ3 and DTLZ4 - plotting also the optimal pareto-front

USAGE: prob.plot(pop, comp[0,2,3])

  • pop: population of solutions to the problem
  • a: angle of view on which the 3d-plot is created
  • comp: indexes the fitness dimension for x,y and z axis in that order
class PyGMO.problem.dtlz4(k=10, fdim=3, alpha=100)

DTLZ4 benchmark problem.

__init__(k=10, fdim=3, alpha=100)

Constructs a DTLZ4 problem (Box-Constrained, continuous, unimodal, scalable multi-objective)

The search space contains a dense area of solutions next to the f_M/f_1 plane.

NOTE: K Deb, L Thiele, M Laumanns, E Zitzler, Scalable test problems for evolutionary multiobjective optimization

USAGE: problem.dt1z4(k = 10, fdim=3, alpha=100)

  • k: defines problem dimension as k + fdim - 1
  • fdim: number of objectives
  • alpha: parameter controlling density of solutions
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
plot(pop, a=40, comp=[0, 1, 2])

Specific plot-method for the DTLZ2, DTLZ3 and DTLZ4 - plotting also the optimal pareto-front

USAGE: prob.plot(pop, comp[0,2,3])

  • pop: population of solutions to the problem
  • a: angle of view on which the 3d-plot is created
  • comp: indexes the fitness dimension for x,y and z axis in that order
class PyGMO.problem.dtlz5(k=10, fdim=3)

DTLZ5 benchmark problem.

__init__(k=10, fdim=3)

Constructs a DTLZ5 problem (Box-Constrained, continuous, unimodal, scalable multi-objective)

This problem will test an MOEA’s ability to converge to a curve and will also allow an easier way to visually demonstrate (just by plotting f_M with any other objective function) the performance of an MOEA. Since there is a natural bias for solutions close to this Pareto-optimal curve, this problem may be easy for an algorithmn to solve. Because of its simplicity its recommended to use a higher number of objectives.

NOTE: K Deb, L Thiele, M Laumanns, E Zitzler, Scalable test problems for evolutionary multiobjective optimization

USAGE: problem.dt1z5(k = 10, fdim = 3)

  • k: defines problem dimension as k + fdim - 1
  • fdim: number of objectives
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
plot(pop, a=40, comp=[0, 1, 2])

Generic plot-method for multi-objective optimization problems with more then 2 objectives

USAGE: prob.plot(pop, comp[0,2,3]) * pop: population of solutions to the problem * a: angle of view on which the 3d-plot is created * comp: indexes the fitness dimension for x,y and z axis in that order

class PyGMO.problem.dtlz6(k=10, fdim=3)

DTLZ6 benchmark problem.

__init__(k=10, fdim=3)

Constructs a DTLZ6 problem (Box-Constrained, continuous, unimodal, scalable multi-objective)

A more difficult version of the DTLZ5 problem: the non-linear distance function g makes it harder to convergence against the pareto optimal curve.

NOTE: K Deb, L Thiele, M Laumanns, E Zitzler, Scalable test problems for evolutionary multiobjective optimization

USAGE: problem.dt1z6(k = 10, fdim = 3)

  • k: defines problem dimension as k + fdim - 1
  • fdim: number of objectives
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
plot(pop, a=40, comp=[0, 1, 2])

Generic plot-method for multi-objective optimization problems with more then 2 objectives

USAGE: prob.plot(pop, comp[0,2,3]) * pop: population of solutions to the problem * a: angle of view on which the 3d-plot is created * comp: indexes the fitness dimension for x,y and z axis in that order

class PyGMO.problem.dtlz7(k=20, fdim=3)

DTLZ7 benchmark problem.

__init__(k=20, fdim=3)

Constructs a DTLZ7 problem (Box-Constrained, continuous, scalable multi-objective)

This problem has disconnected Pareto-optimal regions in the search space.

NOTE: K Deb, L Thiele, M Laumanns, E Zitzler, Scalable test problems for evolutionary multiobjective optimization

USAGE: problem.dt1z7(k = 20, fdim = 3)

  • k: defines problem dimension as k + fdim - 1
  • fdim: number of objectives
p_distance(pop)

The p distance is a convergence metric measuring the distance of a population from the pareto front. It is 0.0 if all individuals of the population lie on the Pareto-front. The metric is based on the distance function g defined for all dtlz and zdt problems and it is defined in the paper below.

NOTE: M Maertens, D Izzo, The asynchronous island model and NSGA-II: study of a new migration operator and its performance, to be published in GECCO2013

USAGE: x = prob.p_distance(isl.population)

  • pop: population to evaluate
plot(pop, a=40, comp=[0, 1, 2])

Generic plot-method for multi-objective optimization problems with more then 2 objectives

USAGE: prob.plot(pop, comp[0,2,3]) * pop: population of solutions to the problem * a: angle of view on which the 3d-plot is created * comp: indexes the fitness dimension for x,y and z axis in that order

class PyGMO.problem.tsp(matrix=[[0, 1, 2], [1, 0, 5], [2, 5, 0]])

Traveling salesman problem

__init__(matrix=[[0, 1, 2], [1, 0, 5], [2, 5, 0]])

Constructs a Travelling Salesman problem (Constrained Integer Single-Objective)

USAGE: problem.tsp(matrix = [0,1,2],[1,0,5],[2,5,0])

  • matrix: inter-city distances (symmetric matrix)
class PyGMO.problem.golomb_ruler(order=5, length=10)

Optimal Golomb ruler search. Constructor from order of the Golomb ruler and maximum distance between consecutive marks.

__init__(order=5, length=10)

Constructs a Golomb Ruler problem (Constrained Integer Single-Objective)

NOTE: see http://en.wikipedia.org/wiki/Golomb_ruler

USAGE: problem.golomb_ruler(order = 5, length=10)

  • order: order of the Golomb ruler
  • length: length of the Golomb ruler
class PyGMO.problem.knapsack(values=[1, 2, 3, 4, 5], weights=[10, 40, 30, 50, 20], max_weight=100)

Classical 01 knapsack problem. Constructor from vector of values, vector of weights and maximum weight.

__init__(values=[1, 2, 3, 4, 5], weights=[10, 40, 30, 50, 20], max_weight=100)

Constructs a 0-1 Knapsack Problem (Constrained Integer Single-Objective)

USAGE: problem.knapsack(values = [1,2,3,4,5], weights = [10, 40, 30, 50, 20], max_weight = 100)

  • values: raw array of values
  • weights: raw array of weights
  • max_weight: maximum weight
class PyGMO.problem.luksan_vlcek_1(dim=3)

Luksan Vlcek problem 1.

__init__(dim=3)

Constructs the first Luksan Vlcek problem (Constrained Continuous Single-Objective)

NOTE: L. Luksan and J. Vlcek, “Sparse and Parially Separable Test Problems for Unconstrained and Equality Constrained Optimization”

USAGE: problem.luksan_vlcek_1(dim=3)

  • dim: problem dimension
class PyGMO.problem.luksan_vlcek_2(dim=16)

Luksan Vlcek problem 2.

__init__(dim=16)

Constructs the second Luksan Vlcek problem (Constrained Continuous Single-Objective)

NOTE: L. Luksan and J. Vlcek, “Sparse and Parially Separable Test Problems for Unconstrained and Equality Constrained Optimization”

USAGE: problem.luksan_vlcek_2(dim=16)

  • dim: problem dimension
class PyGMO.problem.luksan_vlcek_3(dim=8)

Luksan Vlcek problem 3.

__init__(dim=8)

Constructs the third Luksan Vlcek problem (Constrained Continuous Single-Objective)

NOTE: L. Luksan and J. Vlcek, “Sparse and Parially Separable Test Problems for Unconstrained and Equality Constrained Optimization”

USAGE: problem.luksan_vlcek_3(dim=8)

  • dim: problem dimension
class PyGMO.problem.snopt_toyprob

SNOPT toy problem.

__init__()

Constructs SNOPT toy-problem (Box-Constrained Continuous Multi-Objective)

USAGE: problem.snopt_toyprob()

class PyGMO.problem.inventory(weeks=4, sample_size=10, seed=0)

Inventory problem.

__init__(weeks=4, sample_size=10, seed=0)

Constructs an Inventory Problem (Stochastic Objective Function)

NOTE: see www2.isye.gatech.edu/people/faculty/Alex_Shapiro/SPbook.pdf

USAGE: problem.inventory(weeks = 4, sample_size = 10, seed = 0):

  • week: dimension of the problem corresponding to the numer of weeks

    to plan the inventory for.

  • sample_size: dimension of the sample used to approximate the expected value

  • seed: integer used as starting random seed to build the

    pseudorandom sequences used to generate the sample

class PyGMO.problem.py_example_stochastic(dim=10, seed=0)

Noisy De Jong (sphere) function implemented purely in Python.

USAGE: py_example_stochastic(dim = 10, seed=0)

  • dim problem dimension
  • seed initial random seed
__init__(dim=10, seed=0)
class PyGMO.problem.mit_spheres(sample_size=10, n_hidden=10, ode_prec=0.001, seed=0, symmetric=False, simulation_time=50.0)

Spheres problem, a neurocontroller for the MIT test-bed (absolute perception-action)

__init__(sample_size=10, n_hidden=10, ode_prec=0.001, seed=0, symmetric=False, simulation_time=50.0)

Construct a Neurocontroller Evolution problem that seeks to drive three point masses to form a triangle This problem was used to design a contorller for the MIT SPHERES test bed on boear the ISS

USAGE: problem.mit_spheres(sample_size = 10, n_hidden = 10, ode_prec = 1E-3, seed = 0, symmetric = False, simulation_time = 50.0):

  • sample_size: number of initial conditions the neurocontroller is tested from
  • n_hidden: number of hidden for the feed-forward neural network
  • ode_prec: relative numerical precision of neurons the ODE integrator
  • seed: integer used as starting random seed to build the pseudorandom sequences used to generate the sample
  • symmetric: when True activates a Neural Network having symmetric weights (i.e. purely homogeneuos agents)
  • simulation_time: when True activates a Neural Network having symmetric weights (i.e. purely homogeneuos agents)
post_evaluate((tuple) x, (int) N, (int) seed) → (tuple) out

Returns a tuple with the N post evaluation results of chromosome x w.r.t. conditions generated by seed. The returned tuple has the structure [ic, fit] and is sorted by fit. Where ic are the initial conditions and fit the Evaluated fitness.

simulate((tuple) x, (tuple) ic, (int) N) → (tuple) world_states

Returns the SPHERES coordinates as evaluated in one simulation with initial conditions ic and in N points

visualize((tuple) world_states)

Requires VPython installed. It opens a graphical display and animate the motion of the three SPHERES as desribed by the world_state tuple (output from the simulate method)

class PyGMO.problem.mga_1dsm_tof
__init__(seq, t0, tof, vinf, multi_objective=False, add_vinf_dep=False, add_vinf_arr=True)

Constructs an mga_1dsm problem (tof-encoding)

  • seq: list of PyKEP planets defining the encounter sequence, including the starting planet (default: earth venus earth)
  • t0: list of two epochs defining the launch window (default: 2000-Jan-01 00:00:00 to 2002-Sep-27 00:00:00)
  • tof: list of intervals defining the times of flight in days (default: [[50,900],[50,900]])
  • vinf: list of two floats defining the minimum and maximum allowed initial hyperbolic velocity at launch in km/sec (default: [0.5, 2.5])
  • multi_objective: when True constructs a multiobjective problem (dv, T)
  • add_vinf_dep: when True the computed Dv includes the initial hyperbolic velocity (at launch)
  • add_vinf_arr: when True the computed Dv includes the final hyperbolic velocity (at arrival)

USAGE: problem.mga_1dsm(seq = [planet_ss(‘earth’),planet_ss(‘venus’),planet_ss(‘earth’)], t0 = [epoch(0),epoch(1000)], tof = [ [200, 700], [200, 700] ], vinf = [0.5, 2.5], multi_objective = False, add_vinf_dep = False, add_vinf_arr = True)

mga_1dsm_tof.plot(x)

Plots the trajectory represented by the decision vector x

set_tof(tof)

Resets the tof-bounds by the provided list of epochs. Needs a list consisting of lower/upper bound tuples.

set_launch_window((tuple) t0)

Resets the launch windows to the lower and upper bounds given by tuple t0. Bounds need to be epochs.

set_vinf((double) vinf_u)

Sets the upper bound for vinf to vinf_u

pretty((tuple) x) → (string) out

Returns a string with informations about tour encoded by x

class PyGMO.problem.mga_1dsm_alpha
__init__(seq, t0, tof, vinf, multi_objective=False, add_vinf_dep=False, add_vinf_arr=True)

Constructs an mga_1dsm problem (alpha-encoding)

  • seq: list of PyKEP planets defining the encounter sequence, including the starting planet (default: earth venus earth)
  • t0: list of two epochs defining the launch window (default: 2000-Jan-01 00:00:00 to 2002-Sep-27 00:00:00)
  • tof: list of two floats defining the minimum and maximum allowed mission length in days (default: [365.25, 1826.35])
  • vinf: list of two floats defining the minimum and maximum allowed initial hyperbolic velocity at launch in km/sec (default: [0.5, 2.5])
  • multi_objective: when True constructs a multiobjective problem (dv, T)
  • add_vinf_dep: when True the computed Dv includes the initial hyperbolic velocity (at launch)
  • add_vinf_arr: when True the computed Dv includes the final hyperbolic velocity (at arrival)

USAGE: problem.mga_1dsm(seq = [planet_ss(‘earth’),planet_ss(‘venus’),planet_ss(‘earth’)], t0 = [epoch(0),epoch(1000)], tof = [ [200, 700], [200, 700] ], vinf = [0.5, 2.5], multi_objective = False, add_vinf_dep = False, add_vinf_arr = True)

mga_1dsm_alpha.plot(x)

Plots the trajectory represented by the decision vector x

set_tof((tuple) tof)

Resets the tof-bounds by the provided tuple of epochs.

set_launch_window((tuple) t0)

Resets the launch windows to the lower and upper bounds given by tuple t0. Bounds need to be epochs.

set_vinf((double) vinf_u)

Sets the upper bound for vinf to vinf_u

pretty((tuple) x) → (string) out

Returns a string with informations about tour encoded by x

class PyGMO.problem.cassini_1(objectives=1)

Cassini 1 interplanetary trajectory problem.

__init__(objectives=1)

Constructs a Cassini 1 Problem (Box-Constrained Continuous Single-Objective)

NOTE: This problem (MGA) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]
Its single objective version has a global minimum at 4.9307 [km/s], and it is a deceptive problem with a larger minimum at 5.303 [km/s]

USAGE: problem.cassini_1(objectives = 1)

  • objectives: number of objectives. 1=DV, 2=DV,DT
class PyGMO.problem.cassini_2

Cassini 2 interplanetary trajectory problem.

__init__()

Constructs a Cassini 2 Problem (Box-Constrained Continuous Single-Objective)

NOTE: This problem (MGA-1DSM) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]

It models the same interplanetary trajectory as the cassini_1 problem, but in a more accurate fashion, allowing deep space manouvres

Best known global minimum is at 8.383 [km/s]

USAGE: problem.cassini_2()

class PyGMO.problem.messenger_full

Full Messenger problem.

__init__()

Constructs a Mesenger Full Problem (Box-Constrained Continuous Single-Objective)

NOTE: This problem (MGA-1DSM) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]

Best known global minimum is at 2.113

USAGE: problem.messenger_full()

class PyGMO.problem.rosetta

Rosetta problem.

__init__()

Constructs a Rosetta Problem (Box-Constrained Continuous Single-Objective)

NOTE: This problem (MGA-1DSM) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]

Best known global minimum is at 1.343 [km/s]

USAGE: problem.rosetta()

class PyGMO.problem.laplace(seq=[3, 2, 3, 3, 5])

Laplace problem.

__init__(seq=[3, 2, 3, 3, 5])

Constructs a EJSM-Laplace Problem (Box-Constrained Continuous Single-Objective)

NOTE: This problem (MGA-1DSM) is similar to TandEM, but targets Jupiter and the user
can specify explicitly the planetary fly-by sequence

USAGE: problem.laplace(seq = [3,2,3,3,5])

  • seq: The planetary sequence. This is a list of ints that represent the planets to visit

    1 - Mercury, 2 - Venus, 3 - Earth, 4 - Mars, 5 - Jupiter, 6 - Saturn. It must start from 3 (Earth) and end with 5 (Jupiter)

class PyGMO.problem.tandem(prob_id=7, max_tof=-1)

Tandem problem.

__init__(prob_id=7, max_tof=-1)

Constructs a TandEM Problem (Box-Constrained Continuous Single-Objective)

NOTE: This problem (MGA-1DSM) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]. The objective function is -log(m_final).

USAGE: problem.tandem(prob_id = 7, max_tof = -1)

  • prob_id: Selects the problem variant (one of 1..25). All problems differ from the fly-by sequence
  • max_tof = Activates a constriants on the maximum time of flight allowed (in years)
class PyGMO.problem.gtoc_1

GTOC 1 problem (chemical approximation).

__init__()

Constructs a GTOC 1 Problem (Box-Constrained Continuous Single-Objective)

NOTE: This problem (MGA) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]

Best known global minima is at -1,581,950

USAGE: problem.gtoc_1()

class PyGMO.problem.gtoc_2

GTOC 2 problem (LT model).

__init__((object)arg1[, (gtoc_2)arg2]) → None

__init__( (object)arg1 [, (int)arg2 [, (int)arg3 [, (int)arg4 [, (int)arg5 [, (int)arg6 [, (_gtoc_2_objective)arg7]]]]]]) -> None

class PyGMO.problem.py_pl2pl(mass=1000, Tmax=0.05, Isp=2500, Vinf_0=3, Vinf_f=1e-12, nseg=10, departure=None, target=None, optimise4mass=False)

This problem represents a low-thrust transfer between a departure planet (default is the earth) and a target planet (default is mars). The spacecraft is described by its starting mass (mass) its engine specific impulse (Isp) and its engine maximum thrust (Tmax). The Sims-Flanagan model is used to describe a trajectory. A variable number of segments (nseg) can be used An initial velocity with respect to the Earth is allowed (Vinf_0) assumed to be given by the launcher A final velocity wrt the target planet is also allowed (Vinf_f) The method high_fidelity allows to use a continuous thrust model rather than impulses

__init__(mass=1000, Tmax=0.05, Isp=2500, Vinf_0=3, Vinf_f=1e-12, nseg=10, departure=None, target=None, optimise4mass=False)

Constructs a low-thrust transfer between a departure planet and a target planet (Constrained Continuous Single-Objective)

NOTE: An impulsive transcription is used to transform into an NLP the Optimal Control Problem

USAGE: problem.py_pl2pl(self,mass=1000,Tmax=0.05,Isp=2500,Vinf_0=3,Vinf_f=0,nseg=10,departure = PyKEP.planet_ss(‘earth’), target = PyKEP.planet_ss(‘mars’))

  • mass: spacecraft mass at departure [kg]

  • Tmax: maximum allowed thrust [N]

  • Isp: spacecarft engine specific impulse [Isp]

  • Vinf_0: allowed maximum starting velocity [km/s]

  • Vinf_f: allowed maximum arrival velocity [km/s]

    (if negative it is interpreted as a minimum arrival velocity)

  • nseg: number of segments used for the impulsive transcription

  • departure: departure planet (a PyKEP planet)

  • target: arrival planet (a PyKEP planet)

class PyGMO.problem.sagas

Sagas problem.

__init__()

Constructs a SAGAS Problem (Box-Constrained Continuous Single-Objective)

NOTE: This problem (MGA-1DSM) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]

USAGE: problem.sagas()