package ac.essex.ecj.terminals;

import ec.EvolutionState;
import ac.essex.ecj.util.ERCAdapter;

/**
 * You may wonder what this is doing here. It is so the tree builder
 * can add a single boolean type if it needs to.
 *
 * @author Olly Oechsle, University of Essex, Date: 18-Aug-2006
 * @version 1.0
 */
public class BooleanERC extends ERCAdapter {

    public double setNumber(final EvolutionState state, final int thread) {
        return state.random[thread].nextDouble() > 0.5 ? 1 : 0;
    }

    public String name() {
        return "booleanERC";
    }

}
