ucs
Class Indiv

java.lang.Object
  extended byucs.Indiv
All Implemented Interfaces:
java.lang.Cloneable

public class Indiv
extends java.lang.Object
implements java.lang.Cloneable

A population member for use in UCS.

Author:
Gavin Brown

Field Summary
 double accuracy
          The current accuracy of this rule.
 double action
          The action suggested by this rule
 RuleCondition condition
          The RuleCondition object defining the matching input space for this rule.
 int correctSetSize
          Average size of the correct sets that this rule participates in.
 int numCorrect
          The number of examples correctly classified by this rule
 int numMatches
          The number of examples matched by this rule, also known as experience in the LCS literature.
static int numOutputs
          The total number of possible actions.
 
Constructor Summary
Indiv(int length, UCSconfig conf)
          Constructor for this class.
 
Method Summary
 java.lang.Object clone()
          Clones this Indiv object.
 double fitness()
          Returns the fitness of this individual, determined by the current UCSconfig object.
 boolean matches(double[] input)
          Checks whether the provided input is matched by this individual.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

accuracy

public double accuracy
The current accuracy of this rule.


action

public double action
The action suggested by this rule


condition

public RuleCondition condition
The RuleCondition object defining the matching input space for this rule.


correctSetSize

public int correctSetSize
Average size of the correct sets that this rule participates in.


numCorrect

public int numCorrect
The number of examples correctly classified by this rule


numMatches

public int numMatches
The number of examples matched by this rule, also known as experience in the LCS literature.


numOutputs

public static int numOutputs
The total number of possible actions.

Constructor Detail

Indiv

public Indiv(int length,
             UCSconfig conf)
Constructor for this class.

Parameters:
length - The length of the conditions to be used in this run.
conf - A UCSconfig object specifying the workings of this UCS run.
Method Detail

clone

public java.lang.Object clone()
Clones this Indiv object.

Returns:
An exact copy of this object.

fitness

public double fitness()
Returns the fitness of this individual, determined by the current UCSconfig object.

Returns:
The fitness, exactly as returned by the call: params.fitfunc.evaluate(this).

matches

public boolean matches(double[] input)
Checks whether the provided input is matched by this individual.

Parameters:
input - An input to check.
Returns:
True if this individual matches the input, otherwise false. If the system is not in TESTMODE, an update is made to this individual's numMatches count.

toString

public java.lang.String toString()
Returns a string representation of this object.

Returns:
A String representation of this Individual, using '#' as the "don't care" symbol.