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 | * Progn4.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 Progn4 extends GPNode implements EvalPrint
|
---|
26 | {
|
---|
27 | public String toString() { return "progn4"; }
|
---|
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!=4)
|
---|
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 | children[3].eval(state,thread,input,stack,individual,problem);
|
---|
53 | }
|
---|
54 |
|
---|
55 | public void evalPrint(final EvolutionState state,
|
---|
56 | final int thread,
|
---|
57 | final GPData input,
|
---|
58 | final ADFStack stack,
|
---|
59 | final GPIndividual individual,
|
---|
60 | final Problem problem,
|
---|
61 | final int[][] map2)
|
---|
62 | {
|
---|
63 | // Evaluate children. Easy as cake.
|
---|
64 | ((EvalPrint)children[0]).evalPrint(state,thread,input,stack,individual,problem,map2);
|
---|
65 | ((EvalPrint)children[1]).evalPrint(state,thread,input,stack,individual,problem,map2);
|
---|
66 | ((EvalPrint)children[2]).evalPrint(state,thread,input,stack,individual,problem,map2);
|
---|
67 | ((EvalPrint)children[3]).evalPrint(state,thread,input,stack,individual,problem,map2);
|
---|
68 | }
|
---|
69 | }
|
---|
70 |
|
---|
71 |
|
---|
72 |
|
---|