-
Notifications
You must be signed in to change notification settings - Fork 1
/
Equal.java
44 lines (29 loc) · 1.03 KB
/
Equal.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import ec.*;
import ec.gp.*;
public class Equal extends GPNode{
/**
*
*/
private static final long serialVersionUID = 4456947833828449749L;
public String toString() { return "Equal"; }
public int expectedChildren() { return 2; }
public void eval(final EvolutionState state, final int thread, final GPData input, final ADFStack stack, final GPIndividual individual, final Problem problem)
{
MyGPData result = (MyGPData)(input);
MyProblem myproblem = (MyProblem)problem;
//We evaluate our left children.
children[0].eval(state,thread,input,stack,individual,myproblem);
MyGPData leftdata = (MyGPData)(input);
//We evaluate our right children.
children[1].eval(state,thread,input,stack,individual,myproblem);
MyGPData rightdata = (MyGPData)(input);
if (rightdata.condicion == leftdata.condicion)
{
result.condicion = true;
result.punto = null;
return;
}
result.condicion = false;
result.punto = null;
}
}