package ac.essex.gp.nodes.ercs;

import ac.essex.gp.params.NodeParams;
import ac.essex.gp.params.RangeTypes;

/**
 * An ERC set up in the range -1 to 1
 * Jittering may take it further from these boundaries however.
 *
 * @author Olly Oechsle, University of Essex, Date: 16-Feb-2007
 * @version 1.0
 */
public class TinyDoubleERC extends BasicERC {

    public void jitter() {
        // plus or minus 10%
        value *= (1.1 - (Math.random() * 0.2));
    }

    public double setValue() {
        return  1 - (2 * Math.random());
    }

    public int getReturnType() {
        return NodeParams.NUMBER;
    }

    public int getRangeID() {
        return RangeTypes.RANGE_TINY_DOUBLE;
    }

}
