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 Adding a new optimization problem or Adding a new stochastic optimization problem

Meta-problems

Common Name Name in PyGMO Comments
Rotated PyGMO.problem.rotated  
Shifted PyGMO.problem.shifted  
Normalized PyGMO.problem.normalized  
Noisy PyGMO.problem.noisy  
Decompose PyGMO.problem.decompose  
Death-penalty PyGMO.problem.death_penalty Minimization assumed.
Constrained to MO PyGMO.problem.con2mo  
Constrained to Unconstrained PyGMO.problem.con2uncon  

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  
ZDT PyGMO.problem.zdt  
DTLZ PyGMO.problem.dtlz  
CEC2009 (UF1-UF10) PyGMO.problem.cec2009 UF problems from CEC2009 Competition.
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
CEC2006 PyGMO.problem.cec2006 24 problems part of CEC2006 Competition
Pressure vessel design PyGMO.problem.pressure_vessel  
Welded beam design PyGMO.problem.welded_beam  
Tension compression string design PyGMO.problem.tens_comp_string  
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

Constrained Continuous Multi-Objective

Common Name Name in PyGMO Comments
CEC2009 (CF1-CF10) PyGMO.problem.cec2009 CF problems from CEC2009 Competition.

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
_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 that can 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.

_compare_fitness_impl(self, f1, f2)

This is a virtual function that can be re-implemented in the derived class and must return a boolean value. Return true if f1 Pareto dominate f2, false otherwise. The default implementation will assume minimisation for each one of the f components i.e., each pair of corresponding elements in f1 and f2 is compared: if all elements in f1 are less or equal to the corresponding element in f2 (and at least one is less), true will be returned. Otherwise, false will be returned.

_compare_constraints_impl(self, c1, c2)

This is a virtual function tham can be re-implemented in the derived class (if c_dim>0) and must return a boolean value. Return true if c1 is a strictly better constraint vector than c2, false otherwise. Default implementation will return true under the following conditions, tested in order: c1 satisfies more constraints than c2, c1 and c2 satisfy the same number of constraints and the L2 norm of the constraint mismatches for c1 is smaller than for c2. Otherwise, false will be returned.

_compare_fc_impl(self, f1, c1, f2, c2)

This is a virtual function that can be re-implemented in the derived class (if c_dim>0) and must return a boolean value. By default, the function will perform sanity checks on the input arguments and will then call _compare_constraints_impl() if the constraint dimensions is not null, _compare_fitness_impl() otherwise.


class PyGMO.problem.death_penalty

class PyGMO.problem.con2mo

class PyGMO.problem.con2uncon

class PyGMO.problem.shifted
shift_vector

The shift vector defining the new problem

deshift((tuple) x)

Returns the de-shifted decision vector


class PyGMO.problem.rotated
rotation

The rotation matrix defining the new problem

derotate((tuple) x)

Returns the de-rotated decision vector


class PyGMO.problem.noisy

class PyGMO.problem.normalized
denormalize((tuple) x)

Returns the de-normalized decision vector


class PyGMO.problem.decompose
weights

The weights vector

WEIGHTED

Weighted decomposition method

TCHEBYCHEFF

Tchebycheff decomposition method

BI

Boundary Intersection decomposition method


class PyGMO.problem.ackley

class PyGMO.problem.bukin

class PyGMO.problem.cec2006

class PyGMO.problem.pressure_vessel

class PyGMO.problem.welded_beam

class PyGMO.problem.tens_comp_string

class PyGMO.problem.cec2009

class PyGMO.problem.cec2013

class PyGMO.problem.rosenbrock

class PyGMO.problem.string_match
PyGMO.problem.pretty(x)

Returns a string decoding the chromosome


class PyGMO.problem.rastrigin

class PyGMO.problem.schwefel

class PyGMO.problem.dejong

class PyGMO.problem.py_example

class PyGMO.problem.griewank

class PyGMO.problem.lennard_jones

class PyGMO.problem.branin

class PyGMO.problem.himmelblau

class PyGMO.problem.michalewicz

class PyGMO.problem.kur

class PyGMO.problem.fon

class PyGMO.problem.pol

class PyGMO.problem.sch

class PyGMO.problem.zdt

class PyGMO.problem.dtlz

class PyGMO.problem.tsp

class PyGMO.problem.golomb_ruler

class PyGMO.problem.knapsack

class PyGMO.problem.luksan_vlcek_1

class PyGMO.problem.luksan_vlcek_2

class PyGMO.problem.luksan_vlcek_3

class PyGMO.problem.snopt_toyprob

class PyGMO.problem.inventory

class PyGMO.problem.py_example_stochastic

class PyGMO.problem.mit_spheres
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)

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)

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

class PyGMO.problem.cassini_2

class PyGMO.problem.messenger_full

class PyGMO.problem.rosetta

class PyGMO.problem.laplace

class PyGMO.problem.tandem

class PyGMO.problem.gtoc_1

class PyGMO.problem.gtoc_2

class PyGMO.problem.py_pl2pl

class PyGMO.problem.sagas