Improve handling of externally set initial population in PSO - adding a translation method.
This commit is contained in:
parent
55655911fd
commit
a8234302f0
@ -29,4 +29,22 @@ public enum PSOTopologyEnum {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
random;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user