12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package psoAlgoCode;
- public class Constants {
- // Constants PSO
- public static double ALPHA1 = 2;
- public static double ALPHA2 = 2;
- public static int SWARM_SIZE = 20;
- public static int MAX_ITERATION = 100;
- public static double PHI = 2.01;
- public static double RMU = 1.0;
- // 0 = Sphere function, 1 = Rastrigin, 2 = Griewank. Only for problems with
- // double as input
- public static int function = 0;
- // Constants Chart
- public static int ROUNDS = 1;
- // Variables PSO
- public static double START_OMEGA = 0.7;
- public static double END_OMEGA = 0.4;
- public static double DIFF_OMEGA = ((START_OMEGA - END_OMEGA) / MAX_ITERATION);
- // Dimensions determines the length of the
- public static int DIMENSIONS = 0;
- public static void setDimensions(int dim) {
- DIMENSIONS = dim;
- }
- public static void setAlpha1(double alpha) {
- ALPHA1 = alpha;
- }
- public static void setAlpha2(double alpha) {
- ALPHA2 = alpha;
- }
- public static void setSwarmSize(int size) {
- SWARM_SIZE = size;
- }
- public static void setMaxIt(int it) {
- MAX_ITERATION = it;
- }
- public static void setRounds(int rounds) {
- ROUNDS = rounds;
- }
- public static void setPhi(double phi) {
- PHI = phi;
- }
- public static void setRMU(double rmu) {
- RMU = rmu;
- }
- }
|