Improve handling of externally set initial population in PSO - minor change.

This commit is contained in:
Marcel Kronfeld 2009-05-04 15:49:31 +00:00
parent a8234302f0
commit 4ecb159d5e

View File

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