Improve handling of externally set initial population in PSO - adding a translation method.

This commit is contained in:
Marcel Kronfeld 2009-05-04 15:45:52 +00:00
parent 55655911fd
commit a8234302f0

View File

@ -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;
}
}