Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OKBJavaConnector/ECJClient/src/ec/app/multiplexer/func/A1.java @ 6152

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

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

File size: 1.6 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.app.multiplexer.func;
9import ec.*;
10import ec.app.multiplexer.*;
11import ec.gp.*;
12import ec.util.*;
13
14/*
15 * A1.java
16 *
17 * Created: Wed Nov  3 18:26:37 1999
18 * By: Sean Luke
19 */
20
21/**
22 * @author Sean Luke
23 * @version 1.0
24 */
25
26public class A1 extends GPNode
27    {
28    final static int bitpos = 1;  /* A1 */
29
30    public String toString() { return "a1"; }
31
32    public void checkConstraints(final EvolutionState state,
33        final int tree,
34        final GPIndividual typicalIndividual,
35        final Parameter individualBase)
36        {
37        super.checkConstraints(state,tree,typicalIndividual,individualBase);
38        if (children.length!=0)
39            state.output.error("Incorrect number of children for node " +
40                toStringForError() + " at " +
41                individualBase);
42        }
43
44    public void eval(final EvolutionState state,
45        final int thread,
46        final GPData input,
47        final ADFStack stack,
48        final GPIndividual individual,
49        final Problem problem)
50        {
51        MultiplexerData md = (MultiplexerData)input;
52
53        if (md.status == MultiplexerData.STATUS_3)
54            md.dat_3 = Fast.M_3[bitpos];
55        else if (md.status == MultiplexerData.STATUS_6)
56            md.dat_6 = Fast.M_6[bitpos];
57        else // md.status == MultiplexerData.STATUS_11
58            System.arraycopy(Fast.M_11[bitpos],0,
59                md.dat_11,0,
60                MultiplexerData.MULTI_11_NUM_BITSTRINGS);
61        }
62    }
63
64
65
Note: See TracBrowser for help on using the repository browser.