summaryrefslogtreecommitdiff
path: root/nlpsolver/src
diff options
context:
space:
mode:
authorTodor Balabanov <todor.balabanov@gmail.com>2021-07-12 19:13:32 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-13 09:57:41 +0200
commita71caa79c8eb09ff0374cdaf4b081ba42d1330a1 (patch)
tree2852edebdb49b1da29494a288d0140234bb27942 /nlpsolver/src
parenta35b49c58519925f5b093edbc3b59180dc8a03eb (diff)
Object initialization is done via a constructor with parameters.
Change-Id: I66e87f7c898efb1f2c6b1d31fbd5654244e3ea82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118785 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'nlpsolver/src')
-rw-r--r--nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java12
1 files changed, 2 insertions, 10 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 aff425ba4e20..20cf9286e91a 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java
@@ -127,10 +127,6 @@ public final class DEPSSolverImpl extends BaseEvolutionarySolver
//Init:
DEPSAgent[] agents = new DEPSAgent[m_swarmSize.getValue()];
for (int i = 0; i < m_swarmSize.getValue(); i++) {
- agents[i] = new DEPSAgent();
- agents[i].setProblemEncoder(m_problemEncoder);
- agents[i].setPbest(m_library.getSelectedPoint(i));
-
DEGTBehavior deGTBehavior = new DEGTBehavior();
deGTBehavior.MIN_FACTOR = Math.min(m_minFactor.getValue(), m_maxFactor.getValue());
deGTBehavior.MAX_FACTOR = Math.max(m_minFactor.getValue(), m_maxFactor.getValue());
@@ -142,12 +138,8 @@ public final class DEPSSolverImpl extends BaseEvolutionarySolver
psGTBehavior.CL = m_CL.getValue();
psGTBehavior.weight = m_weight.getValue();
- agents[i].switchP = m_agentSwitchRate.getValue();
- agents[i].setGTBehavior(deGTBehavior);
- agents[i].setGTBehavior(psGTBehavior);
-
- agents[i].setSpecComparator(m_specCompareEngine);
- agents[i].setLibrary(m_library);
+ agents[i] = new DEPSAgent(m_problemEncoder, deGTBehavior, psGTBehavior, m_agentSwitchRate.getValue(), m_specCompareEngine, m_library);
+ agents[i].setPbest(m_library.getSelectedPoint(i));
}
//Learn: