summaryrefslogtreecommitdiff
path: root/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
diff options
context:
space:
mode:
Diffstat (limited to 'nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java')
-rw-r--r--nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java29
1 files changed, 14 insertions, 15 deletions
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
index 50ab8fd8c8f0..0f1240df9a1b 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
@@ -44,25 +44,25 @@ import net.adaptivebox.space.BasicPoint;
public class DEPSAgent implements ILibEngine {
- //Describes the problem to be solved
+ // Describes the problem to be solved
private ProblemEncoder problemEncoder;
- //Forms the goodness landscape
+ // Forms the goodness landscape
private IGoodnessCompareEngine qualityComparator;
- //store the point that generated in current learning cycle
+ // store the point that generated in current learning cycle
private SearchPoint trailPoint;
- //temp variable
+ // temp variable
private AbsGTBehavior selectGTBehavior;
- //the own memory: store the point that generated in old learning cycle
+ // 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
+ // the own memory: store the point that generated in last learning cycle
private BasicPoint pcurrent_t;
- //the own memory: store the personal best point
+ // the own memory: store the personal best point
private SearchPoint pbest_t;
- //Generate-and-test Behaviors
+ // Generate-and-test Behaviors
private DEGTBehavior deGTBehavior;
private PSGTBehavior psGTBehavior;
public double switchP = 0.5;
@@ -88,7 +88,7 @@ public class DEPSAgent implements ILibEngine {
}
private AbsGTBehavior getGTBehavior() {
- if (Math.random()<switchP) {
+ if (Math.random() < switchP) {
return deGTBehavior;
} else {
return psGTBehavior;
@@ -97,23 +97,23 @@ public class DEPSAgent implements ILibEngine {
public void setGTBehavior(AbsGTBehavior gtBehavior) {
if (gtBehavior instanceof DEGTBehavior) {
- deGTBehavior = ((DEGTBehavior)gtBehavior);
+ deGTBehavior = ((DEGTBehavior) gtBehavior);
deGTBehavior.setPbest(pbest_t);
return;
}
if (gtBehavior instanceof PSGTBehavior) {
- psGTBehavior = ((PSGTBehavior)gtBehavior);
+ psGTBehavior = ((PSGTBehavior) gtBehavior);
psGTBehavior.setMemPoints(pbest_t, pcurrent_t, pold_t);
return;
}
}
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);
}
@@ -125,4 +125,3 @@ public class DEPSAgent implements ILibEngine {
return trailPoint;
}
}
-