This is the java implementation of the spea2 algorithm, which contains the algorithm and an exercise
I simulated running on an Android phone, this is his effect
You can set a listener for Spea2, and he will pass the results of each time into this listener
-
Inherit the Problem to implement the abstract method Calculation, the meaning of the parameters:
UpperLimit:Maximum value range
LowerLimit:Minimum value range
NbVariablesDecision:Number of decision variables
-
Instantiate the Problem just written
-
Instantiate GAParameters, the meaning of the parameters:
PopSize:Population size
ArchiveSize:Elite population size
Gmax:Maximum number of inheritances
Pc:Cross probability
Pm:Mutation probability
-
Instantiate Spea2,afferent the Problem and gaParameters
-
Call Spea2.getResult () to calculate the result
