diff --git a/src/eva2/server/go/enums/PSOTopologyEnum.java b/src/eva2/server/go/enums/PSOTopologyEnum.java index ea9fb77e..451c2fa0 100644 --- a/src/eva2/server/go/enums/PSOTopologyEnum.java +++ b/src/eva2/server/go/enums/PSOTopologyEnum.java @@ -29,4 +29,22 @@ public enum PSOTopologyEnum { * */ 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; + } }