From 4ecb159d5e815dfd6c4df9ae7a2ec91ff73d1bec Mon Sep 17 00:00:00 2001 From: Marcel Kronfeld Date: Mon, 4 May 2009 15:49:31 +0000 Subject: [PATCH] Improve handling of externally set initial population in PSO - minor change. --- src/eva2/server/go/enums/PSOTopologyEnum.java | 95 ++++++++++--------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/src/eva2/server/go/enums/PSOTopologyEnum.java b/src/eva2/server/go/enums/PSOTopologyEnum.java index 451c2fa0..58c99d00 100644 --- a/src/eva2/server/go/enums/PSOTopologyEnum.java +++ b/src/eva2/server/go/enums/PSOTopologyEnum.java @@ -1,50 +1,51 @@ package eva2.server.go.enums; public enum PSOTopologyEnum { - /** - * - */ - linear, - /** - * - */ - grid, - /** - * - */ - star, - /** - * - */ - multiSwarm, - /** - * - */ - tree, - /** - * - */ - hpso, - /** - * - */ - random; - - /** - * A method to translate the "old" integer tags into the enum type. - * @param oldID - * @return - */ - public static PSOTopologyEnum translateOldID(int oldID) { - switch (oldID) { - case 0: return linear; - case 1: return grid; - case 2: return star; - case 3: return multiSwarm; - case 4: return tree; - case 5: return hpso; - case 6: return random; - } - return random; - } -} + /** + * + */ + linear, + /** + * + */ + grid, + /** + * + */ + star, + /** + * + */ + multiSwarm, + /** + * + */ + tree, + /** + * + */ + hpso, + /** + * + */ + random; + + /** + * A method to translate the "old" integer tags into the enum type. + * @param oldID + * @return + */ + public static PSOTopologyEnum translateOldID(int oldID) { + switch (oldID) { + case 0: return linear; + case 1: return grid; + case 2: return star; + case 3: return multiSwarm; + case 4: return tree; + case 5: return hpso; + case 6: return random; + default: System.err.println("Error: invalid old topology ID in PSOTopologyEnum translateOldID! Returning grid."); + return grid; + } + } +} \ No newline at end of file