summaryrefslogtreecommitdiff
path: root/nlpsolver/ThirdParty
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-18 09:11:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-18 10:35:16 +0200
commit4b99e377473e74160627d3b257fec7b3bc8e7763 (patch)
tree70b5f7b8193586fc593280e889a9eb5e852b457d /nlpsolver/ThirdParty
parentbd90d1c630c93cf39f9bd83fc69c568c9d7eb35a (diff)
Revert "Some lower objects coupling."
This reverts commit 7b93bae224c7c2c49b105ef97304bb46f8b68da5. Reason for revert: Does not compile /home/tdf/lode/jenkins/workspace/lo_ubsan/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java:45: error: DEPSAgent is not abstract and does not override abstract method setLibrary(Library) in ILibEngine public class DEPSAgent implements ILibEngine { ^ 1 error Change-Id: I72f2a22ab1f4119178f8002c21ba0845c4cd1bdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119040 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'nlpsolver/ThirdParty')
-rw-r--r--nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java33
1 files changed, 22 insertions, 11 deletions
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
index 7a6077a725c4..b3e5f310031f 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
@@ -38,6 +38,7 @@ import net.adaptivebox.deps.behavior.PSGTBehavior;
import net.adaptivebox.global.RandomGenerator;
import net.adaptivebox.goodness.IGoodnessCompareEngine;
import net.adaptivebox.knowledge.ILibEngine;
+import net.adaptivebox.knowledge.Library;
import net.adaptivebox.knowledge.SearchPoint;
import net.adaptivebox.problem.ProblemEncoder;
import net.adaptivebox.space.BasicPoint;
@@ -71,21 +72,31 @@ public class DEPSAgent implements ILibEngine {
private double switchP = 0.5;
- public DEPSAgent(ProblemEncoder encoder, DEGTBehavior deGTBehavior, PSGTBehavior psGTBehavior, double switchP, IGoodnessCompareEngine comparer) {
- problemEncoder = encoder;
+ public DEPSAgent(ProblemEncoder encoder, DEGTBehavior deGTBehavior, PSGTBehavior psGTBehavior, double switchP, IGoodnessCompareEngine comparer, Library lib) {
+ setProblemEncoder(encoder);
- trailPoint = problemEncoder.getFreshSearchPoint();
- pold_t = problemEncoder.getFreshSearchPoint();
- pcurrent_t = problemEncoder.getFreshSearchPoint();
+ this.switchP = switchP;
- this.switchP = switchP;
+ deGTBehavior.setLibrary(lib);
+ psGTBehavior.setLibrary(lib);
+ setGTBehavior(deGTBehavior);
+ setGTBehavior(psGTBehavior);
+ this.deGTBehavior = deGTBehavior;
+ this.psGTBehavior = psGTBehavior;
- setGTBehavior(deGTBehavior);
- setGTBehavior(psGTBehavior);
- this.deGTBehavior = deGTBehavior;
- this.psGTBehavior = psGTBehavior;
+ qualityComparator = comparer;
+ }
- qualityComparator = comparer;
+ public void setLibrary(Library lib) {
+ deGTBehavior.setLibrary(lib);
+ psGTBehavior.setLibrary(lib);
+ }
+
+ public void setProblemEncoder(ProblemEncoder encoder) {
+ problemEncoder = encoder;
+ trailPoint = problemEncoder.getFreshSearchPoint();
+ pold_t = problemEncoder.getFreshSearchPoint();
+ pcurrent_t = problemEncoder.getFreshSearchPoint();
}
public void setSpecComparator(IGoodnessCompareEngine comparer) {