1 | /*
|
---|
2 | Copyright 2006 by Sean Luke
|
---|
3 | Licensed under the Academic Free License version 3.0
|
---|
4 | See the file "LICENSE" for more information
|
---|
5 | */
|
---|
6 |
|
---|
7 |
|
---|
8 | package ec.app.ant.func;
|
---|
9 | import ec.*;
|
---|
10 | import ec.gp.*;
|
---|
11 | import ec.util.*;
|
---|
12 |
|
---|
13 | /*
|
---|
14 | * Progn3.java
|
---|
15 | *
|
---|
16 | * Created: Wed Nov 3 18:26:37 1999
|
---|
17 | * By: Sean Luke
|
---|
18 | */
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * @author Sean Luke
|
---|
22 | * @version 1.0
|
---|
23 | */
|
---|
24 |
|
---|
25 | public class Progn3 extends GPNode implements EvalPrint
|
---|
26 | {
|
---|
27 | public String toString() { return "progn3"; }
|
---|
28 |
|
---|
29 | public void checkConstraints(final EvolutionState state,
|
---|
30 | final int tree,
|
---|
31 | final GPIndividual typicalIndividual,
|
---|
32 | final Parameter individualBase)
|
---|
33 | {
|
---|
34 | super.checkConstraints(state,tree,typicalIndividual,individualBase);
|
---|
35 | if (children.length!=3)
|
---|
36 | state.output.error("Incorrect number of children for node " +
|
---|
37 | toStringForError() + " at " +
|
---|
38 | individualBase);
|
---|
39 | }
|
---|
40 |
|
---|
41 | public void eval(final EvolutionState state,
|
---|
42 | final int thread,
|
---|
43 | final GPData input,
|
---|
44 | final ADFStack stack,
|
---|
45 | final GPIndividual individual,
|
---|
46 | final Problem problem)
|
---|
47 | {
|
---|
48 | // Evaluate children. Easy as cake.
|
---|
49 | children[0].eval(state,thread,input,stack,individual,problem);
|
---|
50 | children[1].eval(state,thread,input,stack,individual,problem);
|
---|
51 | children[2].eval(state,thread,input,stack,individual,problem);
|
---|
52 | }
|
---|
53 |
|
---|
54 | public void evalPrint(final EvolutionState state,
|
---|
55 | final int thread,
|
---|
56 | final GPData input,
|
---|
57 | final ADFStack stack,
|
---|
58 | final GPIndividual individual,
|
---|
59 | final Problem problem,
|
---|
60 | final int[][] map2)
|
---|
61 | {
|
---|
62 | // Evaluate children. Easy as cake.
|
---|
63 | ((EvalPrint)children[0]).evalPrint(state,thread,input,stack,individual,problem,map2);
|
---|
64 | ((EvalPrint)children[1]).evalPrint(state,thread,input,stack,individual,problem,map2);
|
---|
65 | ((EvalPrint)children[2]).evalPrint(state,thread,input,stack,individual,problem,map2);
|
---|
66 | }
|
---|
67 | }
|
---|
68 |
|
---|
69 |
|
---|
70 |
|
---|