gpsys.primitives
Class Xor

java.lang.Object
  |
  +--gpsys.Primitive
        |
        +--gpsys.Function
              |
              +--gpsys.primitives.Xor

public class Xor
extends Function

	BOOLEAN Xor(BOOLEAN b1, BOOLEAN b2)
 
Xor is a boolean function that returns the logical "exclusive or" of both arguments.

Version:
$Revision: 1.1 $, $Date: 2000/07/05 16:24:33 $
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
See Also:
Type, Primitive, Function, Serialized Form

Fields inherited from class gpsys.Function
argTypes
 
Fields inherited from class gpsys.Primitive
type
 
Constructor Summary
Xor()
          Construct an instance of the Xor Function.
 
Method Summary
 boolean evaluateBoolean(Individual i, Gene[] arguments)
          Perform the logical Xor of both arguments and return the result.
 Primitive instance()
          Creates an instance of this Function.
 java.lang.String toString()
          Returns a String representation of this Function.
 
Methods inherited from class gpsys.Function
evaluateByte, evaluateChar, evaluateDouble, evaluateFloat, evaluateInt, evaluateLong, evaluateObject, evaluateShort
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Constructor Detail

Xor

public Xor()
Construct an instance of the Xor Function. The Xor Function is of BOOLEAN Type and is hence typed accordingly.
Method Detail

evaluateBoolean

public final boolean evaluateBoolean(Individual i,
                                     Gene[] arguments)
                              throws EvaluationException
Perform the logical Xor of both arguments and return the result.
Parameters:
i - The individual being evaluated.
arguments - The Gene trees representing the arguments to be Anded.
Returns:
A boolean representing the logical xor of the arguments.
Throws:
EvaluationException - If there is an evaluation failure.
Overrides:
evaluateBoolean in class Function

instance

public final Primitive instance()
Creates an instance of this Function.
Returns:
A reference to this object.
Overrides:
instance in class Primitive

toString

public java.lang.String toString()
Returns a String representation of this Function.
Returns:
A String containing the name of the Function.
Overrides:
toString in class Primitive