Skip to content

Commit

Permalink
Working on the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnebro committed Jul 20, 2023
1 parent 2143e60 commit 67b9e6b
Show file tree
Hide file tree
Showing 7 changed files with 270 additions and 6 deletions.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Check the [dashboard documentation](evolver-dashboard/README.md#execute-the-dash
# Example: Meta-optimizing NSGA-II to solve an engineering problem
To illustrate the use of Evolver, we provide an example where NSGA-II, as meta-optimizer, is used to find a configuration of NSGA-II for the liquid-rocket single element injector design problem described in [Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems](https://doi.org/10.1016/j.engappai.2023.106192). This problem in included in jMetal in the *org.uma.jmetal.problem.multiobjective.rwa.Goel2007* class.
The code to run this example is in the [NSGAIIOptimizingNSGAIIForProblemGoel2007](https://github.com/jMetal/Evolver/blob/main/src/main/java/org/uma/evolver/examples/NSGAIIOptimizingNSGAIIForProblemGoel2007.java) program in Evolver.
Without entering into details, we set the Epsilon and Inverted Generational Distance Plus as indicators to be minimized and the stopping condition of the meta-optimizer is to compute 2000 function evaluations.
Without entering into details, we set the Epsilon and Inverted Generational Distance Plus as indicators to be minimized and the stopping condition of the meta-optimizer and the NSGA-II to be tuned are, respectively, 2000 and 7000 function evaluations.

We execute the program in a terminal by using the following command:
```console
Expand Down Expand Up @@ -163,3 +163,48 @@ We select the configuration corresponding to the solution having the minimum inv
--algorithmResult externalArchive --populationSizeWithArchive 45 --externalArchive unboundedArchive --createInitialSolutions random --offspringPopulationSize 100 --variation crossoverAndMutationVariation --crossover BLX_ALPHA --crossoverProbability 0.6748953752524687 --crossoverRepairStrategy round --sbxDistributionIndex 69.33946841828451 --blxAlphaCrossoverAlphaValue 0.3524179610073535 --mutation nonUniform --mutationProbabilityFactor 1.76602778869229 --mutationRepairStrategy round --polynomialMutationDistributionIndex 20.465825376938277 --linkedPolynomialMutationDistributionIndex 369.76116204526977 --uniformMutationPerturbation 0.9230041512352161 --nonUniformMutationPerturbation 0.6160655898281514 --selection tournament --selectionTournamentSize 8
```

The last step is to use this configuration with the [ConfigurableNSGAIIRunner](https://github.com/jMetal/Evolver/blob/develop/src/main/java/org/uma/evolver/configurablealgorithm/runner/ConfigurableNSGAIIRunner.java):

```java
public class ConfigurableNSGAIIRunner {

public static void main(String[] args) {

String referenceFrontFileName = "resources/referenceFronts/Goel2007.csv";

String[] parameters =
("--algorithmResult externalArchive "
+ "--populationSizeWithArchive 45 "
+ "--externalArchive unboundedArchive "
+ "--createInitialSolutions random "
+ "--offspringPopulationSize 100 "
+ "--variation crossoverAndMutationVariation "
+ "--crossover BLX_ALPHA "
+ "--crossoverProbability 0.6748953752524687 "
+ "--crossoverRepairStrategy round "
+ "--sbxDistributionIndex 69.33946841828451 "
+ "--blxAlphaCrossoverAlphaValue 0.3524179610073535 "
+ "--mutation nonUniform "
+ "--mutationProbabilityFactor 1.76602778869229 "
+ "--mutationRepairStrategy round "
+ "--polynomialMutationDistributionIndex 20.465825376938277 "
+ "--linkedPolynomialMutationDistributionIndex 369.76116204526977 "
+ "--uniformMutationPerturbation 0.9230041512352161 "
+ "--nonUniformMutationPerturbation 0.6160655898281514 "
+ "--selection tournament "
+ "--selectionTournamentSize 8 ")
.split("\\s+");

var configurableNSGAII = new ConfigurableNSGAII(new Goel2007(), 100, 15000);
//...
```

Note that we set the stopping condition to 15000 function evaluatoins (7000 were set for the
meta-optimization).

We include next the reference front of the problem, the front obtained by the configured NSGA-II and
the front obtained by NSGA-II with standard settings:

<img src="https://github.com/jMetal/Evolver/blob/main/resources/documentation/Goel2007.referenceFront.png" alt="Reference front" width="600"/>
<img src="https://github.com/jMetal/Evolver/blob/main/resources/documentation/Goel2007.standardNSGAII.png" alt="NSGAII front" width="600"/>
<img src="https://github.com/jMetal/Evolver/blob/main/resources/documentation/Goel2007.configurableNSGAII.png" alt="Configurable NSGAII front" width="600"/>
100 changes: 100 additions & 0 deletions resources/documentation/Goel2007.ConfigurableNSGAII.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
0.9565155637171666,0.008893414859126805,0.9875467278862495
0.005999999999999984,1.002,0.029999999999999992
0.7173999999999999,0.30029999999999996,-0.43150000000000005
0.2765300933871461,0.4631566932191765,0.6976796195426681
0.6553675349243062,0.1315174472996901,0.3368001834953837
0.3689377588182704,0.6217883904889807,-0.0636721602827708
0.05691700035069632,0.8431177735192469,0.6650257225817403
0.5122070777435093,0.05600268850998067,0.923561756717699
1.0969000000036246,0.06659999999825138,0.3884000000275763
0.3474965207110709,0.32841439765035246,0.22043837977816053
0.17570479811939496,0.6399607700245713,0.3364998061304622
0.843865698093686,0.23690821550483399,-0.011269370074944385
0.2516053016860986,0.8758141805672309,-0.14441833152546563
0.48785814600901406,0.32967720277541934,-0.15749528209355632
0.8620703940223753,0.04047712116228,0.6103522117068715
0.4063850610285129,0.21272141350405538,0.5646765748888459
0.05761843211449493,0.8451663836796269,0.30335009101129035
0.7257076681263758,0.018686240461161543,1.0443822417849464
0.6326075743311642,0.05323843343665636,0.6474279378280029
0.8914878788725386,0.1419167953118253,0.26894094326083784
0.18804877878039772,0.7370787436657554,0.06428172194782243
0.1608711745916711,0.6669013384270313,0.6451242372545413
0.2673463952963568,0.5070485708261403,0.15524331330427008
0.613164624946145,0.23814911721715287,0.09480136257097314
0.5231722726653154,0.5407952039037953,-0.20486052945033037
0.26786839573863785,0.4743455302895857,0.42689690073413933
0.6749087694041573,0.28318599772591246,-0.1540109637124496
0.48062654211817074,0.18554036634095375,0.33031279535192454
0.37169204166785574,0.4399070050074214,-0.01502089331823301
0.08475236260536857,0.8675262291983027,0.06914814739139112
0.7980120265501918,0.028036625626161184,0.8327811143439379
0.5094783336072514,0.07947161851344085,0.49217804375482
0.10478192133879166,0.7617188787501685,0.47634426933417107
0.9871923147832745,0.029596385072992826,0.7717374357281656
0.47358802147335183,0.30323789084620417,0.074714594131844
0.7670289067447112,0.05547976333762465,0.43198031849138047
0.3462160638555303,0.7676669334592146,-0.10461102779119218
0.7555936511900209,0.18147496454878204,0.18846483706785438
0.32683958350041264,0.3641760135897389,0.5275809171495817
0.1135733412277449,0.7482703529976072,0.8042406128635954
0.49185485091793296,0.07104240068441889,0.7115897543401472
0.9507368110894022,0.055144660155620855,0.4046226392020713
0.6564177669363166,0.038101822167672654,0.8648486858242468
0.1426652336426173,0.943878899172542,-0.06852019818802718
0.5872458335286685,0.03417614785626183,1.0848665614997488
0.22657884431350137,0.5519141307668276,0.5805873107433612
0.012413192752802634,0.9478634657731261,0.2145467241899584
0.22626084942320374,0.6165711239915467,0.09128949987579224
0.03027945858056853,0.8992531099300982,0.5026699107619487
1.089022869453523,0.012043484698903012,0.9607458504059601
0.11939708454890881,0.7428165608669576,0.25445253701313214
0.6126917842133559,0.31138063874292543,-0.31105749117110226
0.20339126798683518,0.5984125363749048,0.7757595755385058
0.37984299130282145,0.25687773302329014,0.3525691717123509
1.0154281309868531,0.12450710769189878,0.28970853397506824
0.46595900876845375,0.45183158365716974,-0.12672133522505408
0.5727462104858806,0.2827573377900979,-0.049126641989441694
0.6346448273581945,0.06324913991377143,0.46123731102212384
0.29612615620657606,0.42271390763022115,0.2498162464905663
0.7464198088677492,0.04106275491578739,0.6763179121240744
0.7915535985937059,0.266843461224444,-0.14926937266676865
0.8430315556836174,0.011244940644259486,1.0138549238165973
0.457424739293696,0.6228950213024703,-0.16675739915825744
0.914715622935825,0.1926333898453825,0.13316092366537083
0.22785680038765704,0.5479245337935692,0.3286303356581625
0.7381741930028085,0.22979307798292462,0.045960663570920296
0.374766912646603,0.35029411060302273,0.0582606147440905
0.3197903674827728,0.549183676559284,0.01629956957724562
0.2770940671565108,0.7022020669597189,-0.005105049760423211
0.5541774345750781,0.20940583205687602,0.22456628027652117
0.17812583646149047,0.837477897993012,0.01138316399750855
0.7511995075305297,0.2869061054366577,-0.28430633105062875
0.4027048534161602,0.5259541339214897,-0.06795893214662796
0.770603631355792,0.11904742484728935,0.3224073339443308
0.16569794484939943,0.6574845276952994,0.5007362271139484
0.8835495554507264,0.03040932997934814,0.7543726181436909
0.33248153569165334,0.35034407234903675,0.3573670972447204
0.4505836211869697,0.13309635308274392,0.5952566136300381
0.398950334950238,0.6949382927629374,-0.14622202851856003
0.17474712231681122,0.6741136972990561,0.20807615800562518
0.31870669053617195,0.42152841182816486,0.09838935406410942
0.5740690114219696,0.1321717644836988,0.41372373387119865
0.4454585776343977,0.1371439785420383,0.43842226218119273
0.569812434346884,0.05296344718706682,0.8051357622188164
0.47125284483169133,0.2503527396275623,0.19520101924989264
0.09916622549689304,0.8040349121554655,0.16245966289249705
0.022975646474141097,0.9165790420057234,0.36388235542296454
0.42131899019281277,0.3514183314105566,-0.06730705758001146
0.8702619755224722,0.049092804120780896,0.4758809739313435
0.25292815562133214,0.7833413341234502,-0.03696216567733984
0.0961193410071612,0.7735473584479777,0.6063858656036157
0.572440131163887,0.3039737122489375,-0.19217465613092438
0.28099167794787,0.45014382943764464,0.5716426645849975
0.6643139660173183,0.25519956586639636,-0.015638714435148915
0.20734816552859497,0.598481055064346,0.23440221643372353
0.8874999544081823,0.02110979236574367,0.8789017528336064
0.035948799728479766,0.9338738721344066,0.08931091578873386
0.14049658547998398,0.7106674169817524,0.36165164722686005
0.19816245545780226,0.941210773155277,-0.15950293833097146
0.7763364167570995,0.04595069614322647,0.5659797004391983
100 changes: 100 additions & 0 deletions resources/documentation/Goel2007.StandardNSGAII.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
0.004882596214924579,0.9888581071503517,0.06882374852145831
0.7173581355179025,0.30035104572504895,-0.4314244229290892
0.5502417365768394,0.039608515936991495,1.0963836114222039
0.9456878808432803,0.008942612883742337,0.9898823372123975
1.123791032545781,0.025560389041580728,0.874872305137108
0.006000250662152813,1.0019996194448386,0.030000798035506548
0.09469866857700686,0.7816176138816111,0.6082650672554628
0.5421655786007964,0.4124878152249618,-0.16366464031202674
0.338689445033388,0.7434571831709743,-0.0975055473005357
0.07052337482700669,0.8188622140975289,0.45835020632929635
0.28229104544005074,0.49605644948627825,0.11922803091159528
0.11192411779492682,0.7654080965372955,0.7248317197901821
0.41710972612845487,0.21164865038003997,0.5060413807490124
0.509362785096025,0.058671333266549254,0.9081059920634171
0.03673205767212684,0.9267437507538252,0.21604588943518607
0.9606027630209405,0.03486239672084445,0.9529498627647414
0.1521436342608675,0.6851103245631975,0.6724905254886498
0.8943297757603021,0.1333964003637269,0.27466770362388704
0.05114357127961616,0.9107751237434234,0.09545551430475963
0.5583680864298033,0.07436237478438121,0.6717472155552708
0.8203642747547085,0.24811602124835166,-0.050919657839441634
1.1044220980080899,0.027279140879425803,0.8549597566484926
0.3912840283254028,0.23421824073936062,0.32675124106058634
1.0338505147850603,0.10965817044884567,0.3598005554192689
0.48438368652485536,0.08405472941667191,0.49837113758257473
0.21658958667038386,0.5910343581463549,0.37413304685119764
0.6220760212059065,0.3234261907991539,-0.3049024011885617
0.6483787335967652,0.026452704668474963,1.066279879174031
0.24167348932401572,0.5400348688706482,0.760400507963151
0.6033425606146219,0.3005790509379133,-0.10285336698109981
0.3281887824182614,0.3857219997372184,0.19812258586604678
0.12963353488291568,0.7191570687938119,0.6361508082609855
0.14639157392169533,0.7159001686123673,0.3191954973000469
0.4982084991170161,0.3525381140951433,-0.13267451211091308
0.26327866301728403,0.8315034957987916,0.04881128607383195
0.8052844753843397,0.2538303089495882,-0.07577083142122806
0.6703915614047626,0.3107062890775191,-0.35820768361604116
1.0892198625428209,0.032487179310205325,0.7890270471948043
0.8744958936635134,0.0236902631200507,0.989593903643795
0.7414417257652233,0.2818751565137841,-0.22727382409602842
0.581516010224262,0.30993566769383246,-0.232152189961453
0.18892571028994154,0.6270429930052147,0.5603403311338709
0.24785474157431447,0.53410540059007,0.8314979069056792
0.3187500895199633,0.4574404765559798,0.19535091402804028
0.04267479777748366,0.8973520451812355,0.219052443067781
0.5768489367872675,0.313663327252448,-0.2621791365867091
0.3898067492110945,0.2560556599188386,0.4323449109945704
0.687481641503616,0.2996739086554411,-0.3817302894399104
0.3493802985809268,0.3388815193723713,0.14246737841576773
0.00962128579676337,0.9748385850409329,0.2297561010636833
1.0019702650890907,0.06941321251356984,0.39366601796596645
1.0717976387271257,0.040370535648971514,0.7337211592364354
1.064113588436142,0.06528214608217997,0.3962555989834575
0.15951698046137797,0.6775711294492307,0.5269094634127087
0.49734829721061036,0.3537357647418015,-0.14043093282918875
0.8871876903603231,0.12878651052679876,0.28469099162327416
0.2575507629146582,0.5274709248839725,0.9337896885990171
0.9165065474521952,0.10078550541610527,0.37413397501842394
0.23395504193112604,0.8679485437988363,-0.060955077139879944
0.861577740150442,0.2208865558748818,0.053644681454229404
1.1138288111369372,0.024744091889680332,0.879715967717945
0.8506950850169266,0.15871688242352977,0.23163178180503208
0.3516743000687958,0.38012911156356044,0.07600960820177574
0.46776210706230775,0.10426443400495816,0.4853642000642718
0.0855781523700186,0.8467318515018588,0.1746613468213036
0.29973128371881164,0.42224874994529893,0.2169673738885273
0.9739580804673327,0.014548777745610596,0.9381184032180886
0.08343834579366924,0.8009756448838655,0.31176756552287427
0.20012831553803015,0.8791707942534805,-0.06885312452506129
0.4489694745008738,0.19298439292914746,0.3450494320974318
0.2198629652529739,0.5707361796722973,0.3718355418226172
0.22484728695168696,0.5622060439633553,0.7526378188045458
0.2005622653375129,0.6058270208534311,0.3535022518683662
0.7059725697606504,0.31457263762923154,-0.4127721992590587
0.755598897964691,0.24611447351961352,0.02665675887559113
0.5226160169636467,0.1507188003736983,0.41049069707856284
0.5397874982659312,0.4127131371562459,-0.16128096741863665
0.6397680525662822,0.03712435957381481,1.0562767542205065
0.4337066667288163,0.21842977484347867,0.3085673433938163
0.7414417257652233,0.2818751565137841,-0.22727382409602842
0.023206447216423086,0.9692661742492797,0.05255035263161447
0.16564454741768872,0.6551546629595603,0.5075882194796634
0.6790459731967754,0.2994768843538585,-0.37241129403761036
0.12406973136788667,0.9459539799921793,-0.041771750537624705
0.1389966577155584,0.7208557560370605,0.47677392415062564
0.17801698630721785,0.6502720311530369,0.7820251014914665
0.23133929404387021,0.555595320802607,0.8256241286582072
0.7676908533479072,0.06708942419022862,0.4236215726794103
0.30919429522904013,0.4774176023182054,0.19857106206430325
0.3479734697144004,0.4373443266835417,0.03150089263679362
0.8696869309869945,0.17127504728048093,0.19920350154485555
1.0279602777266628,0.10908577642950908,0.36053896870539687
0.27438874526376267,0.5109422174538631,0.12177909723131496
1.0090076108968546,0.016829763081197508,0.9310119861069476
0.5472902053860845,0.09763545998477316,0.46493042477962704
0.6364606854187833,0.3032996160097611,-0.34086706423705504
0.34619212815413897,0.4415038610826786,0.022972906143424374
0.4530880126539422,0.17877328303707862,0.37100801162233155
0.7317976491474217,0.2875713917217864,-0.2819402779852364
0.9447061201176645,0.01030988982110985,0.9898215792640238
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,34 @@ public static void main(String[] args) {
String referenceFrontFileName = "resources/referenceFronts/Goel2007.csv";

String[] parameters =
("--algorithmResult externalArchive --populationSizeWithArchive 45 --externalArchive unboundedArchive --createInitialSolutions random --offspringPopulationSize 100 --variation crossoverAndMutationVariation --crossover BLX_ALPHA --crossoverProbability 0.6748953752524687 --crossoverRepairStrategy round --sbxDistributionIndex 69.33946841828451 --blxAlphaCrossoverAlphaValue 0.3524179610073535 --mutation nonUniform --mutationProbabilityFactor 1.76602778869229 --mutationRepairStrategy round --polynomialMutationDistributionIndex 20.465825376938277 --linkedPolynomialMutationDistributionIndex 369.76116204526977 --uniformMutationPerturbation 0.9230041512352161 --nonUniformMutationPerturbation 0.6160655898281514 --selection tournament --selectionTournamentSize 8\n ")
("--algorithmResult externalArchive "
+ "--populationSizeWithArchive 45 "
+ "--externalArchive unboundedArchive "
+ "--createInitialSolutions random "
+ "--offspringPopulationSize 100 "
+ "--variation crossoverAndMutationVariation "
+ "--crossover BLX_ALPHA "
+ "--crossoverProbability 0.6748953752524687 "
+ "--crossoverRepairStrategy round "
+ "--sbxDistributionIndex 69.33946841828451 "
+ "--blxAlphaCrossoverAlphaValue 0.3524179610073535 "
+ "--mutation nonUniform "
+ "--mutationProbabilityFactor 1.76602778869229 "
+ "--mutationRepairStrategy round "
+ "--polynomialMutationDistributionIndex 20.465825376938277 "
+ "--linkedPolynomialMutationDistributionIndex 369.76116204526977 "
+ "--uniformMutationPerturbation 0.9230041512352161 "
+ "--nonUniformMutationPerturbation 0.6160655898281514 "
+ "--selection tournament "
+ "--selectionTournamentSize 8 ")
.split("\\s+");

var autoNSGAII = new ConfigurableNSGAII(new Goel2007(), 100, 15000);
autoNSGAII.parse(parameters);
var configurableNSGAII = new ConfigurableNSGAII(new Goel2007(), 100, 15000);
configurableNSGAII.parse(parameters);

ConfigurableNSGAII.print(autoNSGAII.configurableParameterList());
ConfigurableNSGAII.print(configurableNSGAII.configurableParameterList());

EvolutionaryAlgorithm<DoubleSolution> nsgaII = autoNSGAII.build();
EvolutionaryAlgorithm<DoubleSolution> nsgaII = configurableNSGAII.build();

EvaluationObserver evaluationObserver = new EvaluationObserver(100);
RunTimeChartObserver<DoubleSolution> runTimeChartObserver =
Expand Down

0 comments on commit 67b9e6b

Please sign in to comment.