summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java2
1 files changed, 1 insertions, 1 deletions
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 b6387bfb8a96..e5677818c0ef 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java
@@ -57,7 +57,7 @@ public class DEGTBehavior extends AbsGTBehavior implements ILibEngine {
if (Math.random()<CR || k == DIMENSION-1) {
double Dabcd = 0;
for(int i=0; i<referPoints.length; i++) {
- Dabcd += Math.pow(-1, i%2)*referPoints[i].getLocation()[rj];
+ Dabcd += (i%2==0 ? +1D : -1D)*referPoints[i].getLocation()[rj];
}
trailPoint.getLocation()[rj] = gbest_t.getLocation()[rj]+FACTOR*Dabcd;
} else {