2 * Description: For comparison of goodness in landscape with stoch. ranking.
4 * @ Author Create/Modi Note
5 * Xiaofeng Xie May 29, 2004
7 * [1] Runarsson T P, Yao X. Stochastic ranking for constrained evolutionary
8 * optimization. IEEE Trans. on Evolutionary Computation. 2000, 4 (3): 284-294
12 package net
.adaptivebox
.goodness
;
14 import net
.adaptivebox
.global
.*;
16 public class SRComparator
implements IGoodnessCompareEngine
, IUpdateCycleEngine
{
17 public double Pf
= 0.5;
19 public SRComparator() {}
21 public SRComparator(double pf
) {
25 public void updateCycle(int t
) {
30 * check the magnitude of two array, the frontial is more important
31 * Stoch ranking: array size = 2
33 public int compare(double[] fit1
, double[] fit2
) {
34 if((fit1
[0]==fit2
[0])||Pf
>Math
.random()) {
35 return GlobalCompare
.compare(fit1
[1], fit2
[1]);
37 return GlobalCompare
.compare(fit1
[0], fit2
[0]);