diff options
author | Todor Balabanov <todor.balabanov@gmail.com> | 2019-05-13 14:29:17 +0300 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-05-17 08:45:46 +0200 |
commit | 5ee453818c88f0a73ca2863a80c6b901feed1837 (patch) | |
tree | b95833b4759506c6dfa71164da37ec3e24c8cfd6 /nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps | |
parent | acd4625f2f1bf418452ffdafeac1b83fe1b2acde (diff) |
Some additional manual formatting.
Change-Id: Ie5590535d013aa2f747dd034fa2fcd2ae5c3956b
Reviewed-on: https://gerrit.libreoffice.org/72226
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps')
3 files changed, 26 insertions, 14 deletions
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java index 0f1240df9a1b..b9784c8a2ab3 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java @@ -46,6 +46,7 @@ public class DEPSAgent implements ILibEngine { // Describes the problem to be solved private ProblemEncoder problemEncoder; + // Forms the goodness landscape private IGoodnessCompareEngine qualityComparator; @@ -57,8 +58,10 @@ public class DEPSAgent implements ILibEngine { // the own memory: store the point that generated in old learning cycle private BasicPoint pold_t; + // the own memory: store the point that generated in last learning cycle private BasicPoint pcurrent_t; + // the own memory: store the personal best point private SearchPoint pbest_t; @@ -109,11 +112,12 @@ public class DEPSAgent implements ILibEngine { } public void generatePoint() { -// generates a new point in the search space (S) based on -// its memory and the library + // generates a new point in the search space (S) based on + // its memory and the library selectGTBehavior = this.getGTBehavior(); selectGTBehavior.generateBehavior(trailPoint, problemEncoder); -// evaluate into goodness information + + // evaluate into goodness information problemEncoder.evaluate(trailPoint); } 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 40e570a77559..645318341108 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java @@ -37,9 +37,14 @@ import net.adaptivebox.problem.ProblemEncoder; import net.adaptivebox.space.BasicPoint; public class DEGTBehavior extends AbsGTBehavior implements ILibEngine { - private static final int DVNum = 2; // Number of differential vectors, normally be 1 or 2 - public double FACTOR = 0.5; // scale constant: (0, 1.2], normally be 0.5 - public double CR = 0.9; // crossover constant: [0, 1], normally be 0.1 or 0.9 + //Number of differential vectors, normally be 1 or 2 + private static final int DVNum = 2; + + //scale constant: (0, 1.2], normally be 0.5 + public double FACTOR = 0.5; + + //crossover constant: [0, 1], normally be 0.1 or 0.9 + public double CR = 0.9; // the own memory: store the point that generated in last learning cycle private SearchPoint pbest_t; diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java index afd18390e630..13c605b63780 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java @@ -64,20 +64,23 @@ import net.adaptivebox.space.DesignSpace; public class PSGTBehavior extends AbsGTBehavior { // Two normally choices for (c1, c2, weight), i.e., (2, 2, 0.4), or (1.494, - // 1.494, 0.729) - // The first is used in dissipative PSO (cf. [4]) as CL>0, and the second is - // achieved by using - // constriction factors (cf. [3]) + // 1.494, 0.729) The first is used in dissipative PSO (cf. [4]) as CL>0, and + // the second is achieved by using constriction factors (cf. [3]) public double c1 = 2; public double c2 = 2; - public double weight = 0.4; // inertia weight - public double CL = 0; // See ref[4], normally be 0.001~0.005 + //inertia weight + public double weight = 0.4; + + //See ref[4], normally be 0.001~0.005 + public double CL = 0; // the own memory: store the point that generated in old learning cycle private BasicPoint pold_t; + // the own memory: store the point that generated in last learning cycle private BasicPoint pcurrent_t; + // the own memory: store the personal best point private SearchPoint pbest_t; @@ -100,7 +103,8 @@ public class PSGTBehavior extends AbsGTBehavior { deltaxb = weight * (pcurrent_t.getLocation()[b] - pold_t.getLocation()[b]) + c1 * Math.random() * (pbest_t.getLocation()[b] - pcurrent_t.getLocation()[b]) + c2 * Math.random() * (gbest_t.getLocation()[b] - pcurrent_t.getLocation()[b]); -// limitation for delta_x + + // limitation for delta_x deltaxbm = 0.5 * designSpace.getMagnitudeIn(b); if (deltaxb < -deltaxbm) { deltaxb = -deltaxbm; @@ -118,5 +122,4 @@ public class PSGTBehavior extends AbsGTBehavior { pold_t.importLocation(pcurrent_t); pcurrent_t.importLocation(trailPoint); } - } |