edu.uiuc.ge.illigal.gale.agents
Class CLAgent

java.lang.Object
  |
  +--edu.uiuc.ge.illigal.gale.agents.CLAgent
All Implemented Interfaces:
Agent, java.lang.Cloneable, java.io.Serializable

public class CLAgent
extends java.lang.Object
implements Agent, java.io.Serializable, java.lang.Cloneable

Implements the generic handle to Agents for Rule based agents.

Since:
0.9alpha
Version:
0.9alpha
Author:
Xavier Llorà <xllora@illigal.ge.uiuc.edu>
See Also:
Serialized Form

Field Summary
protected  edu.uiuc.ge.illigal.gale.agents.AgentPerformance agnPer
          Agent Performance object
protected  edu.uiuc.ge.illigal.gale.data.AttributeSet attCnf
          The attributes information for instances
protected  edu.uiuc.ge.illigal.gale.config.GALEConfiguration galeCnf
          The GALE environment configuration object
protected  java.util.Vector genVec
          Genetic material vector
protected  int[] iaMatch
          Match information
protected  int[] iaPrune
          Prune information
protected  java.util.Random rnd
          Random number generator object
 
Constructor Summary
CLAgent()
          Builds a simple agent with null information
CLAgent(edu.uiuc.ge.illigal.gale.config.GALEConfiguration gale, edu.uiuc.ge.illigal.gale.data.AttributeSet att)
          Builds a simple agent.
 
Method Summary
 edu.uiuc.ge.illigal.gale.agents.Agent buildAgent(edu.uiuc.ge.illigal.gale.config.GALEConfiguration galeCnf, edu.uiuc.ge.illigal.gale.data.AttributeSet attSet)
          Returns a random builded agent.
 int classify(edu.uiuc.ge.illigal.gale.data.Instance ins)
          Classifies the given instance
 java.lang.Object clone()
          Clones the handled agent.
 float complexity()
          Returns a complexity measure.
protected  boolean equalRules(int[] ia1, int[] ia2)
          Check if the rules are equal.
 edu.uiuc.ge.illigal.gale.agents.AgentPerformance getPerformance()
          Provides the classification performance information.
static void main(java.lang.String[] sArgs)
           
protected  boolean matched(int[] ia, edu.uiuc.ge.illigal.gale.data.Instance ins)
          Check if the rule is matched by the instance.
 edu.uiuc.ge.illigal.gale.agents.Agent merge(edu.uiuc.ge.illigal.gale.agents.Agent agn)
          Merges two agents.
protected  void mutateGenotype()
          Mutates the genetic material of instances.
 edu.uiuc.ge.illigal.gale.agents.Agent prune()
          Clean spurious issues.
protected  void removeRepeatedRules(java.util.Vector vec)
          Remove the repeated rules.
 void resetPerformance()
          Resets the agents' performance.
 edu.uiuc.ge.illigal.gale.agents.Agent split()
          Splits an agent
 java.lang.String toString()
          Returns the stringfied form of the agent
protected  java.util.Vector translateArray(int[] iaGen, int iLen)
          Build the vector representation of a genetic array.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

galeCnf

protected edu.uiuc.ge.illigal.gale.config.GALEConfiguration galeCnf
The GALE environment configuration object


attCnf

protected edu.uiuc.ge.illigal.gale.data.AttributeSet attCnf
The attributes information for instances


agnPer

protected edu.uiuc.ge.illigal.gale.agents.AgentPerformance agnPer
Agent Performance object


rnd

protected java.util.Random rnd
Random number generator object


genVec

protected java.util.Vector genVec
Genetic material vector


iaPrune

protected int[] iaPrune
Prune information


iaMatch

protected int[] iaMatch
Match information

Constructor Detail

CLAgent

public CLAgent()
Builds a simple agent with null information


CLAgent

public CLAgent(edu.uiuc.ge.illigal.gale.config.GALEConfiguration gale,
               edu.uiuc.ge.illigal.gale.data.AttributeSet att)
Builds a simple agent. The Agent is build using the GALE configuration object.

Parameters:
gale - The GALE configuration
Method Detail

buildAgent

public edu.uiuc.ge.illigal.gale.agents.Agent buildAgent(edu.uiuc.ge.illigal.gale.config.GALEConfiguration galeCnf,
                                                        edu.uiuc.ge.illigal.gale.data.AttributeSet attSet)
Description copied from interface: Agent
Returns a random builded agent.

Specified by:
buildAgent in interface Agent
Parameters:
galeCnf - The GALE configuration object
attSet - The attributes set information object
Returns:
The agent

resetPerformance

public void resetPerformance()
Description copied from interface: Agent
Resets the agents' performance.

Specified by:
resetPerformance in interface Agent

getPerformance

public edu.uiuc.ge.illigal.gale.agents.AgentPerformance getPerformance()
Description copied from interface: Agent
Provides the classification performance information.

Specified by:
getPerformance in interface Agent
Returns:
The handle to the classification performance

merge

public edu.uiuc.ge.illigal.gale.agents.Agent merge(edu.uiuc.ge.illigal.gale.agents.Agent agn)
Description copied from interface: Agent
Merges two agents.

Specified by:
merge in interface Agent
Parameters:
agn - The second agent to be merged
Returns:
The merged agent

removeRepeatedRules

protected void removeRepeatedRules(java.util.Vector vec)
Remove the repeated rules.

Parameters:
vec - the vector to process

equalRules

protected boolean equalRules(int[] ia1,
                             int[] ia2)
Check if the rules are equal.

Parameters:
ia1 - the first rule
ia2 - the second rule
Returns:
true if the two rules are equal

translateArray

protected java.util.Vector translateArray(int[] iaGen,
                                          int iLen)
Build the vector representation of a genetic array.

Parameters:
iaGen - the float array to translate
iLen - the length of useful information in the array
Returns:
the vector

split

public edu.uiuc.ge.illigal.gale.agents.Agent split()
Description copied from interface: Agent
Splits an agent

Specified by:
split in interface Agent
Returns:
The splitted agent

mutateGenotype

protected void mutateGenotype()
Mutates the genetic material of instances.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: Agent
Clones the handled agent.

Specified by:
clone in interface Agent
Overrides:
clone in class java.lang.Object
Returns:
The cloned agent
Throws:
java.lang.CloneNotSupportedException - Thrown when the agent cannot be cloned

complexity

public float complexity()
Description copied from interface: Agent
Returns a complexity measure.

Specified by:
complexity in interface Agent
Returns:
The complexity measure

prune

public edu.uiuc.ge.illigal.gale.agents.Agent prune()
Description copied from interface: Agent
Clean spurious issues.

Specified by:
prune in interface Agent

classify

public int classify(edu.uiuc.ge.illigal.gale.data.Instance ins)
Description copied from interface: Agent
Classifies the given instance

Specified by:
classify in interface Agent
Returns:
The predicted class

matched

protected boolean matched(int[] ia,
                          edu.uiuc.ge.illigal.gale.data.Instance ins)
Check if the rule is matched by the instance.

Parameters:
ia - the rule to be check
ins - the instance
Returns:
true if the rule is matched

toString

public java.lang.String toString()
Description copied from interface: Agent
Returns the stringfied form of the agent

Specified by:
toString in interface Agent
Overrides:
toString in class java.lang.Object
Returns:
The stringfied agent

main

public static void main(java.lang.String[] sArgs)