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 horizontal symmetry for an object that has had half of it flipped over.
 *
 * @author Olly Oechsle, University of Essex, Date: 16-Apr-2007
 * @version 1.0
 */
public class InverseHorizontalSymmetry extends Terminal {

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

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

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

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

}
