diff options
-rw-r--r-- | nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java | 2 | ||||
-rw-r--r-- | nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java | 4 |
2 files changed, 5 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 0e68f856d912..5dedc8052ec7 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java @@ -118,7 +118,7 @@ public class DEGTBehavior extends AbsGTBehavior implements ILibEngine { private SearchPoint[] getReferPoints() { SearchPoint[] referPoints = new SearchPoint[DVNum * 2]; for (int i = 0; i < referPoints.length; i++) { - referPoints[i] = socialLib.getSelectedPoint(RandomGenerator.intRangeRandom(0, socialLib.getPopSize() - 1)); + referPoints[i] = socialLib.getRandomPoint(); } return referPoints; } diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java index 247d4908c420..76e57ac76077 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java @@ -56,6 +56,10 @@ public class Library { return libPoints[index]; } + public SearchPoint getRandomPoint() { + return libPoints[RandomGenerator.intRangeRandom(0, libPoints.length - 1)]; + } + public static boolean replace(IGoodnessCompareEngine comparator, SearchPoint outPoint, SearchPoint tobeReplacedPoint) { boolean isBetter = false; |