package ac.essex.gp.nodes.shape;

import ac.essex.gp.tree.Terminal;
import ac.essex.gp.params.NodeParams;
import ac.essex.gp.params.RangeTypes;
import ac.essex.gp.util.DataStack;

/**
 * Returns the balance of the ends (are they all on one side or the other?)
 *
 * @author Olly Oechsle, University of Essex, Date: 17-Apr-2007
 * @version 1.0
 */
public class BalanceYEnds extends Terminal {

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

    public double execute(DataStack data) {
        data.usesImaging = true;
        data.value = data.shape.getEndBalanceY();
        return debugger.record(data.value);
    }

    public String toJava() {
        return "shape.getEndBalanceY()";
    }

    public int getDefaultRangeType() {
        return RangeTypes.RANGE_PERCENTAGE;
    }

}
