public static int getStateMetric(State s) {
    switch(STATE_METRIC) {
    case DIV:
      return (((s.rngState>>16)&0x3F)<<8) + ((s.rngState>>22)&0xFF);
    case DSum:
      return (((s.rngState>>8)&0xFF) + (s.rngState&0xFF))&0xFF;
    case RNG:
      return s.rngState & 0xFFFF;
    case RNG1:
      return s.rngState & 0xFF;
    case RNG2:
      return (s.rngState >> 8) & 0xFF;
    case RANDOM:
    default:
      return (int)(Math.random()*0x100);
    }
  }