summaryrefslogtreecommitdiffstats
path: root/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox
diff options
context:
space:
mode:
authorTodor Balabanov <todor.balabanov@gmail.com>2019-05-15 19:54:21 +0300
committerTomaž Vajngerl <quikee@gmail.com>2019-06-03 15:53:30 +0200
commit90ace7be71d41257e29a28fa2e7c0adf8f84050d (patch)
tree2e7fee4022c5ae79c42f65a82f09f5630ae31b98 /nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox
parenttdf#67538 XTypeDetection::queryTypeByDescriptor poor performance, part3 (diff)
downloadcore-90ace7be71d41257e29a28fa2e7c0adf8f84050d.tar.gz
core-90ace7be71d41257e29a28fa2e7c0adf8f84050d.zip
Range for DE scaling factor was implemented.
Change-Id: I5b8d3cd69a6138d7eebf37c299626019b32d639a Reviewed-on: https://gerrit.libreoffice.org/72373 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox')
-rw-r--r--nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java
index 645318341108..0e68f856d912 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java
@@ -41,7 +41,10 @@ public class DEGTBehavior extends AbsGTBehavior implements ILibEngine {
private static final int DVNum = 2;
//scale constant: (0, 1.2], normally be 0.5
- public double FACTOR = 0.5;
+ public double MIN_FACTOR = 0.5;
+
+ //scale constant: (0, 1.2], normally be 0.5
+ public double MAX_FACTOR = 0.5;
//crossover constant: [0, 1], normally be 0.1 or 0.9
public double CR = 0.9;
@@ -70,7 +73,7 @@ public class DEGTBehavior extends AbsGTBehavior implements ILibEngine {
delta += (i % 2 == 0 ? +1D : -1D) * differenceVectors[i].getLocation()[index];
}
- trialVector[index] = globalVector[index] + FACTOR * delta;
+ trialVector[index] = globalVector[index] + RandomGenerator.doubleRangeRandom(MIN_FACTOR, MAX_FACTOR) * delta;
}
@Override