-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNot.java
43 lines (29 loc) · 912 Bytes
/
Not.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
import ec.*;
import ec.gp.*;
public class Not extends GPNode{
/**
*
*/
private static final long serialVersionUID = 8441276216331510235L;
public String toString() { return "Not"; }
public int expectedChildren() { return 1; }
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 data = (MyGPData)(input);
if (data.condicion == true)
{
result.condicion = false;
result.punto = null;
return;
}
else{
result.condicion = true;
result.punto = null;
return;
}
}
}