示例#1
0
文件: And.java 项目: swapon15/ecj-1
  public void eval(
      final EvolutionState state,
      final int thread,
      final GPData input,
      final ADFStack stack,
      final GPIndividual individual,
      final Problem problem) {
    MultiplexerData md = (MultiplexerData) input;
    long[] dat_11 = null; // quiets compiler complaints
    long dat_6 = 0L;
    byte dat_3 = 0;

    // No shortcuts for now
    children[0].eval(state, thread, input, stack, individual, problem);

    if (md.status == MultiplexerData.STATUS_3) dat_3 = md.dat_3;
    else if (md.status == MultiplexerData.STATUS_6) dat_6 = md.dat_6;
    else // md.status == MultiplexerData.STATUS_11
    {
      dat_11 = md.popDat11();
      System.arraycopy(md.dat_11, 0, dat_11, 0, MultiplexerData.MULTI_11_NUM_BITSTRINGS);
    }

    children[1].eval(state, thread, input, stack, individual, problem);

    // modify

    if (md.status == MultiplexerData.STATUS_3) md.dat_3 &= dat_3;
    else if (md.status == MultiplexerData.STATUS_6) md.dat_6 &= dat_6;
    else // md.status == MultiplexerData.STATUS_11
    {
      for (int x = 0; x < MultiplexerData.MULTI_11_NUM_BITSTRINGS; x++) md.dat_11[x] &= dat_11[x];
      md.pushDat11(dat_11);
    }
  }
示例#2
0
  public void eval(
      final EvolutionState state,
      final int thread,
      final GPData input,
      final ADFStack stack,
      final GPIndividual individual,
      final Problem problem) {
    MultiplexerData md = (MultiplexerData) input;

    if (md.status == MultiplexerData.STATUS_3)
      md.dat_3 = Fast.M_3[bitpos + MultiplexerData.STATUS_3];
    else if (md.status == MultiplexerData.STATUS_6)
      md.dat_6 = Fast.M_6[bitpos + MultiplexerData.STATUS_6];
    else // md.status == MultiplexerData.STATUS_11
    System.arraycopy(
          Fast.M_11[bitpos + MultiplexerData.STATUS_11],
          0,
          md.dat_11,
          0,
          MultiplexerData.MULTI_11_NUM_BITSTRINGS);
  }