[Libreoffice-commits] core.git: nlpsolver/src
Todor Balabanov (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jun 21 06:49:30 UTC 2021
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java | 5 +++++
nlpsolver/src/locale/NLPSolverCommon_en_US.properties | 1 +
2 files changed, 6 insertions(+)
New commits:
commit 89459662bf2684a07596d4132c84e5da7e0af8d4
Author: Todor Balabanov <todor.balabanov at gmail.com>
AuthorDate: Sun Jun 20 13:49:57 2021 +0300
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jun 21 08:48:50 2021 +0200
Global optimization metaheuristics sometimes are sensitive to the quality of the random numbers.
Change-Id: Ibc1e95736c5f9355e67f2129a7804064e329da89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117510
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java
index b33d77a438d9..0c402e87c12f 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java
@@ -34,6 +34,7 @@ import com.sun.star.sheet.SolverConstraintOperator;
import com.sun.star.uno.XComponentContext;
import java.util.ArrayList;
import net.adaptivebox.global.BasicBound;
+import net.adaptivebox.global.RandomGenerator;
import net.adaptivebox.goodness.ACRComparator;
import net.adaptivebox.goodness.BCHComparator;
import net.adaptivebox.goodness.IGoodnessCompareEngine;
@@ -53,6 +54,7 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver {
registerProperty(m_useACRComperator);
registerProperty(m_useRandomStartingPoint);
+ registerProperty(m_useStrongerPRNG);
registerProperty(m_required);
registerProperty(m_tolerance);
@@ -168,6 +170,7 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver {
private final PropertyInfo<Double> m_variableRangeThreshold = new PropertyInfo<Double>("VariableRangeThreshold", 3.0, "Variable Bounds Threshold (when guessing)"); //to approximate the variable bounds
private final PropertyInfo<Boolean> m_useACRComperator = new PropertyInfo<Boolean>("UseACRComparator", false, "Use ACR Comparator (instead of BCH)");
private final PropertyInfo<Boolean> m_useRandomStartingPoint = new PropertyInfo<Boolean>("UseRandomStartingPoint", false, "Use Random starting point");
+ private final PropertyInfo<Boolean> m_useStrongerPRNG = new PropertyInfo<Boolean>("UseStrongerPRNG", false, "Use a stronger random generator (slower)");
protected PropertyInfo<Integer> m_required = new PropertyInfo<Integer>("StagnationLimit", 70, "Stagnation Limit");
protected PropertyInfo<Double> m_tolerance = new PropertyInfo<Double>("Tolerance", 1e-6, "Stagnation Tolerance");
private final PropertyInfo<Boolean> m_enhancedSolverStatus = new PropertyInfo<Boolean>("EnhancedSolverStatus", true, "Show enhanced solver status");
@@ -324,6 +327,8 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver {
m_envCompareEngine = new BCHComparator();
m_specCompareEngine = m_useACRComperator.getValue() ? new ACRComparator(m_library, m_learningCycles.getValue()) : new BCHComparator();
+
+ RandomGenerator.useStrongerGenerator( m_useStrongerPRNG.getValue() );
}
protected void applySolution() {
diff --git a/nlpsolver/src/locale/NLPSolverCommon_en_US.properties b/nlpsolver/src/locale/NLPSolverCommon_en_US.properties
index 84262674ddb9..5ab304d69ebb 100644
--- a/nlpsolver/src/locale/NLPSolverCommon_en_US.properties
+++ b/nlpsolver/src/locale/NLPSolverCommon_en_US.properties
@@ -9,6 +9,7 @@ NLPSolverCommon.Properties.GuessVariableRange=Variable Bounds Guessing
NLPSolverCommon.Properties.VariableRangeThreshold=Variable Bounds Threshold (when guessing)
NLPSolverCommon.Properties.UseACRComparator=Use ACR Comparator (instead of BCH)
NLPSolverCommon.Properties.UseRandomStartingPoint=Use Random starting point
+NLPSolverCommon.Properties.UseStrongerPRNG=Use a stronger random generator (slower)
NLPSolverCommon.Properties.StagnationLimit=Stagnation Limit
NLPSolverCommon.Properties.Tolerance=Stagnation Tolerance
NLPSolverCommon.Properties.EnhancedSolverStatus=Show enhanced solver status
More information about the Libreoffice-commits
mailing list