Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OKBJavaConnector/ECJClient/src/ec/gp/ADM.java @ 9598

Last change on this file since 9598 was 6152, checked in by bfarka, 14 years ago

added ecj and custom statistics to communicate with the okb services #1441

File size: 1.2 KB
Line 
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
8package ec.gp;
9import ec.*;
10
11/*
12 * ADM.java
13 *
14 * Created: Tue Oct 26 15:29:57 1999
15 * By: Sean Luke
16 */
17
18/**
19 * An ADM is an ADF which doesn't evaluate its arguments beforehand, but
20 * instead only evaluates them (and possibly repeatedly) when necessary
21 * at runtime.  For more information, see ec.gp.ADF.
22 * @see ec.gp.ADF
23 *
24 * @author Sean Luke
25 * @version 1.0
26 */
27
28public class ADM extends ADF
29    {
30    public void eval(final EvolutionState state,
31        final int thread,
32        final GPData input,
33        final ADFStack stack,
34        final GPIndividual individual,
35        final Problem problem)
36        {
37        // prepare a context
38        ADFContext c = stack.push(stack.get());
39        c.prepareADM(this);
40       
41        // evaluate the top of the associatedTree
42        individual.trees[associatedTree].child.eval(
43            state,thread,input,stack,individual,problem);
44
45        // pop the context off, and we're done!
46        if (stack.pop(1) != 1)
47            state.output.fatal("Stack prematurely empty for " + toStringForError());
48        }
49    }
Note: See TracBrowser for help on using the repository browser.