From 6bd65207d70ea06e6be48df0da53c5142d4a32d3 Mon Sep 17 00:00:00 2001 From: JQSakaJoo Date: Tue, 30 Apr 2024 12:14:47 +0500 Subject: [PATCH] update TSEA --- .../AO_TSEA_TurtleShellEvolutionAlgorithm.mqh | 33 ++++++++++++------- README.md | 6 ++-- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/MQL5/Include/Math/AOs/PopulationAO/AO_TSEA_TurtleShellEvolutionAlgorithm.mqh b/MQL5/Include/Math/AOs/PopulationAO/AO_TSEA_TurtleShellEvolutionAlgorithm.mqh index 4935a02..0a17d0d 100644 --- a/MQL5/Include/Math/AOs/PopulationAO/AO_TSEA_TurtleShellEvolutionAlgorithm.mqh +++ b/MQL5/Include/Math/AOs/PopulationAO/AO_TSEA_TurtleShellEvolutionAlgorithm.mqh @@ -527,7 +527,7 @@ void C_AO_TSEA::Revision () stepF = (fB - minFval) / vClusters; - //3. Разметка по вертикали дочерней популяции--------------------------------- + //Разметка по вертикали дочерней популяции------------------------------------ for (int i = 0; i < popSize; i++) { if (agent [i].f == fB) agent [i].labelClustV = vClusters - 1; @@ -571,11 +571,11 @@ void C_AO_TSEA::Revision () { agent [i].label = km.KNN (data, agent [i], neighbNumb, hClusters); } - /* - if (epochsNow % 5 == 0) + + if (epochsNow % 50 == 0) { - km.KMeansPlusPlusInit (data, ArraySize (data), clusters); - km.KMeans (data, ArraySize (data), clusters); + //km.KMeansPlusPlusInit (data, ArraySize (data), clusters); + //km.KMeans (data, ArraySize (data), clusters); for (int v = 0; v < vClusters; v++) { @@ -603,7 +603,6 @@ void C_AO_TSEA::Revision () cell [v].cell [h].agent [size - 1] = data [i]; } } - */ } //5, 10. Поместить популяцию в панцирь---------------------------------------- @@ -624,20 +623,30 @@ void C_AO_TSEA::Revision () for (int c = 0; c < maxAgentsInCell; c++) { - if (agent [i].f < minF) + if (cell [v].cell [h].agent [c].f < minF) { - minF = agent [i].f; + minF = cell [v].cell [h].agent [c].f; posMin = c; } - if (agent [i].f > maxF) + if (cell [v].cell [h].agent [c].f > maxF) { - maxF = agent [i].f; + maxF = cell [v].cell [h].agent [c].f; posMax = c; } } - if (v == 0) pos = posMax; - else pos = posMin; + if (v == 0) + { + if (agent [i].f < minF) + { + pos = posMin; + } + else + { + pos = posMax; + } + } + else pos = posMin; } else { diff --git a/README.md b/README.md index f67b32e..ee721aa 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,12 @@ A list of implemented (+) optimization algorithms, (-) not included in the repos -DE (differential evolution) +BSA (bird swarm algorithm) -HS (harmony search) --SSG (saplings sowing and growing) +-SSG (saplings sowing and growing) ++TSEA (turtle shell evolution algorithm) -(PO)ES ((PO) evolution strategies) +BSO (brain storm optimization) +WOAm (wale optimization algorithm M) --ACOm (ant colony optimization M) -+TSEA (turtle shell evolution algorithm) +-ACOm (ant colony optimization M) -BFO-GA (bacterial foraging optimization - ga) -MEC (mind evolutionary computation) -IWO (invasive weed optimization)