From a2720a24328fcee3bde431dc632c068b266228c9 Mon Sep 17 00:00:00 2001 From: Todor Balabanov Date: Fri, 17 May 2019 17:13:13 +0300 Subject: Checking of min and max factor value was added. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is possible user to swap these two values. Change-Id: Ib375d705e42f7257aa9b16d72ab834020e401cde Reviewed-on: https://gerrit.libreoffice.org/72483 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl --- nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java index 2e5c38d0d179..f152cf92d481 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java @@ -128,8 +128,8 @@ public final class DEPSSolverImpl extends BaseEvolutionarySolver agents[i].setPbest(m_library.getSelectedPoint(i)); DEGTBehavior deGTBehavior = new DEGTBehavior(); - deGTBehavior.MIN_FACTOR = m_minFactor.getValue(); - deGTBehavior.MAX_FACTOR = m_maxFactor.getValue(); + deGTBehavior.MIN_FACTOR = Math.min(m_minFactor.getValue(), m_maxFactor.getValue()); + deGTBehavior.MAX_FACTOR = Math.max(m_minFactor.getValue(), m_maxFactor.getValue()); deGTBehavior.CR = m_CR.getValue(); PSGTBehavior psGTBehavior = new PSGTBehavior(); -- cgit