All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gpsys.primitives.ConstantFloat

java.lang.Object
   |
   +----gpsys.Primitive
           |
           +----gpsys.Terminal
                   |
                   +----gpsys.primitives.ConstantFloat

public class ConstantFloat
extends Terminal
	FLOAT ConstantFloat
 
Creates a Terminal representing an ephemeral random constant of Type FLOAT.

Version:
1.1, 30th June '97
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
See Also:
Type, Primitive, Terminal

Variable Index

 o f
The value of this constant.

Constructor Index

 o ConstantFloat(Random, float, float)
Create a ephemeral random constant of type float in the range between from and to using the random number generator rng.

Method Index

 o evaluateFloat(Individual)
Evaluate this Terminal.
 o instance()
Creates a new FLOAT constant in exactly the same range as this constant, and using the same random number generator.
 o toString()
Returns the value of the constant as a String.

Variables

 o f
 public float f
The value of this constant.

Constructors

 o ConstantFloat
 public ConstantFloat(Random rng,
                      float from,
                      float to)
Create a ephemeral random constant of type float in the range between from and to using the random number generator rng.

Parameters:
rng - The random number generator to be used.
from - The smallest value that the constant can take.
to - The largest value that the constant can take.

Methods

 o evaluateFloat
 public final float evaluateFloat(Individual i) throws EvaluationException
Evaluate this Terminal.

Parameters:
i - The individual being evaluated.
Returns:
The value of the constant.
Throws: EvaluationException
If there is an evaluation failure.
Overrides:
evaluateFloat in class Terminal
 o instance
 public final Primitive instance()
Creates a new FLOAT constant in exactly the same range as this constant, and using the same random number generator.

Returns:
A new FLOAT constant in exactly the same range.
Overrides:
instance in class Primitive
 o toString
 public String toString()
Returns the value of the constant as a String.

Returns:
A String representing the value of this constant.
Overrides:
toString in class Primitive

All Packages  Class Hierarchy  This Package  Previous  Next  Index