%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% _______ ___________ ______ ______ ___ ___
% / _____||___ ____| / __ \ | _ \ \ \ / /
% | | __ | | | | | | | |_) | \ V /
% | | |_ | | | | | | | | ___/ > <
% | |__| | | | | |__| | | | / _ \
% \______| |__| \______/ |__| /__/ \__\
%
% Version 0.9
% GTOPX - Space Mission Benchmarks
% --------------------------------
% This is an example program to test evaluate the ten
% benchmark instances of GTOPX, which are:
%
% No. 1 : Cassini1
% No. 2 : Cassini2
% No. 3 : Messenger (reduced)
% No. 4 : Messenger (full)
% No. 5 : GTOC1
% No. 6 : Rosetta
% No. 7 : Sagas
% No. 8 : Cassini1-MINLP
% No. 9 : Cassini1-MO
% No. 10 : Cassini1-MO-MINLP
%
% For each benchmark, the number of objetives (o), variables (n)
% and constraints (m) are given. Note that benchmark 8 and 10 include
% integer (discrete) variables, which are located at the end of the
% solution vector 'x'. The arrays 'xl' and 'xu' denote the lower and
% upper bounds (also called box-constraints) for each benchmark. The
% array 'x' given in this file is the best known solution vector.
%
% For further information on GTOPX, see here:
%
% http://www.midaco-solver.com/index.php/about/benchmarks/gtopx
%
% For further information on ESA's original GTOP, see here:
%
% https://www.esa.int/gsp/ACT/projects/gtop/
%
% For questions/suggestions on GTOPX, please email: info@midaco-solver.com
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function main
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%% MAIN PROGRAM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
benchmark = 1; disp(' Cassini1 ')
o = 1; % number of objectives
n = 6; % number of variables
ni = 0; % number of integer variables
m = 4; % number of constraints
xl = [-1000.0,30.0,100.0,30.0,400.0,1000.0]; % lower bounds
xu = [0.0,400.0,470.0,400.0,2000.0,6000.0]; % upper bounds
x = [-789.759878, 158.29826, 449.38588, 54.7171393, 1024.686, 4552.799163]; % best known solution
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x
benchmark = 2; disp(' Cassini2 ')
o = 1; % number of objectives
n = 22; % number of variables
ni = 0; % number of integer variables
m = 0; % number of constraints
xl = [-1000.0,3.0,0.0,0.0,100.0,100.0,30.0,400.0,800.0,0.01,0.01,0.01,0.01,0.01,1.05,1.05,1.15,1.7,-pi,-pi,-pi,-pi];
xu = [0.0,5.0,1.0,1.0,400.0,500.0,300.0,1600.0,2200.0,0.9,0.9,0.9,0.9,0.9,6.0,6.0,6.5,291.0,pi,pi,pi,pi];
x = [-779.894378988457561, 3.269411425703198, 0.529410104571234, 0.381748649774535, 168.169347918446192, 424.061185764409458, 53.307722076733533, 589.767059261808413, 2199.950937462144338, 0.774320965356460, 0.535145801354738, 0.038619342571980, 0.050049685390983, 0.288550381305552, 1.358730540567745, 1.050000000000000, 1.306766043512907, 69.814774728630795, -1.593246201481152, -1.959557907671481, -1.554766106156737, -1.513431800078973];
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x
benchmark = 3; disp(' Messenger (reduced) ')
o = 1; % number of objectives
n = 18; % number of variables
ni = 0; % number of integer variables
m = 0; % number of constraints
xl = [1000.0,1.0,0.0,0.0,30.0,30.0,30.0,30.0,0.01,0.01,0.01,0.01,1.1,1.1,1.1,-pi,-pi,-pi];
xu = [4000.0,5.0,1.0,1.0,400.0,400.0,400.0,400.0,0.99,0.99,0.99,0.99,6.0,6.0,6.0,pi,pi,pi];
x = [1171.4537811, 1.4156386, 0.3787730, 0.4975252, 399.9988492, 178.6438561, 299.2471490, 180.6207630, 0.2369875, 0.0100000, 0.8327221, 0.3142574, 1.7734215, 3.0364436, 1.1000000, 1.3506117, 1.0950083, 1.3449968];
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x
benchmark = 4; disp(' Messenger (full) ')
o = 1; % number of objectives
n = 26; % number of variables
ni = 0; % number of integer variables
m = 0; % number of constraints
xl = [1900.0,2.5,0.0,0.0,100.0,100.0,100.0,100.0,100.0,100.0,0.01,0.01,0.01,0.01,0.01,0.01,1.1,1.1,1.05,1.05,1.05, -pi, -pi, -pi, -pi, -pi];
xu = [2300.0,4.05,1.0,1.0,500.0,500.0,500.0,500.0,500.0,600.0,0.99,0.99,0.99,0.99,0.99,0.99,6.0,6.0,6.0,6.0,6.0, pi, pi, pi, pi, pi];
x = [2037.877864567844426, 4.050000190734863, 0.556720539555961, 0.634706307625142, 451.651542959219398, 224.694006511996577, 221.438483720560384, 266.073371482564824, 357.959170121390741, 534.104338857377456, 0.482413583122892, 0.733817341605811, 0.699337665254241, 0.740616124926094, 0.828723386566668, 0.902861270673425, 1.723741116076976, 1.100000023841858, 1.049999952316284, 1.049999952316284, 1.049999952316284, 2.767484583120401, 1.573418587459163, 2.629307841350829, 1.622878432547001, 1.609458990319683];
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x
benchmark = 5; disp(' GTOC1 ')
o = 1; % number of objectives
n = 8; % number of variables
ni = 0; % number of integer variables
m = 6; % number of constraints
xl = [3000.0, 14.0, 14.0, 14.0, 14.0, 100.0, 366.0, 300.0];
xu = [10000.0, 2000.0, 2000.0, 2000.0, 2000.0, 9000.0, 9000.0, 9000.0];
x = [6810.405216554911021, 168.374697626641421, 1079.474093199302388, 56.387311981695156, 1044.092886333879960, 3820.841817730225102, 1044.327260191322694, 3397.213494950476161];
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x
benchmark = 6; disp(' Rosetta ')
o = 1; % number of objectives
n = 22; % number of variables
ni = 0; % number of integer variables
m = 0; % number of constraints
xl = [1460.0,3.0,0.0,0.0,300.0,150.0,150.0,300.0,700.0,0.01,0.01,0.01,0.01,0.01,1.06,1.05,1.05,1.05,-pi,-pi,-pi,-pi];
xu = [1825.0,5.0,1.0,1.0,500.0,800.0,800.0,800.0,1850.0,0.9,0.9,0.9,0.9,0.9,9.0,9.0,9.0,9.0,pi,pi,pi,pi];
x = [1540.720429, 4.361360, 0.696882, 0.012581, 365.242303, 709.396306, 257.893134, 730.139362, 1850.000000, 0.432084, 0.808927, 0.125193, 0.654050, 0.438241, 1.064230, 1.050000, 3.219558, 1.050000, -2.115017, 1.796263, -1.547720, -1.982961];
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x
benchmark = 7; disp(' Sagas ')
o = 1; % number of objectives
n = 12; % number of variables
ni = 0; % number of integer variables
m = 2; % number of constraints
xl = [7000.0, 0.0, 0.0, 0.0, 50.0, 300.0, 0.01, 0.01, 1.05, 8.0, -pi, -pi];
xu = [9100.0, 7.0, 1.0, 1.0, 2000.0, 2000.0, 0.9, 0.9, 7.0, 500.0, pi, pi];
x = [7020.1007967, 5.3454028, 0.0004359, 0.5003408, 789.4146510, 483.9965559, 0.4945883, 0.0100000, 1.0500000, 10.8523045, -1.5721134, 1.9954418];
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x
benchmark = 8; disp(' Cassini1-MINLP ')
o = 1; % number of objectives
n = 10; % number of variables
ni = 4; % number of integer variables
m = 4; % number of constraints
xl = [-1000.0,30.0,100.0,30.0,400.0,1000.0, 1.0,1.0,1.0,1.0];
xu = [0.0,400.0,470.0,400.0,2000.0,6000.0, 9.0,9.0,9.0,9.0];
x = [-768.484123850541209, 350.572246317827421, 234.191991642478598, 55.791511186576670, 1012.713353855687160, 4533.949792068496208 ,3.0,2.0,3.0,5.0];
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x
benchmark = 9; disp(' Cassini1-MO ')
o = 2; % number of objectives
n = 6; % number of variables
ni = 0; % number of integer variables
m = 5; % number of constraints
xl = [-1000.0,30.0,100.0,30.0,400.0,1000.0];
xu = [0.0,400.0,470.0,400.0,2000.0,6000.0];
x = [-789.759878, 158.29826, 449.38588, 54.7171393, 1024.686, 4552.799163];
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x
benchmark = 10; disp(' Cassini1-MO-MINLP ')
o = 2; % number of objectives
n = 10; % number of variables
ni = 4; % number of integer variables
m = 5; % number of constraints
xl = [-1000.0,30.0,100.0,30.0,400.0,1000.0, 1.0,1.0,1.0,1.0 ];
xu = [0.0,400.0,470.0,400.0,2000.0,6000.0, 9.0,9.0,9.0,9.0 ];
x = [-768.484123850541209, 350.572246317827421, 234.191991642478598, 55.791511186576670, 1012.713353855687160, 4533.949792068496208 ,3.0,2.0,3.0,5.0];
[ f, g ] = gtopxmex( benchmark, x ) % call GTOPX and evaluate solution x