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

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

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

Implements the generic handle to Agents for Instance Based Agents (GENIFER).

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.distance.Distance dis
          Distance function
protected  float[] fakNN
          KNN minimal values
protected  edu.uiuc.ge.illigal.gale.config.GALEConfiguration galeCnf
          The GALE environment configuration object
protected  java.util.Vector genVec
          Genetic material vector
protected  int[] iakNN
          KNN minimal position
protected  int[] iaPrune
          Prune information
protected  int iK
          K number of instances
protected  java.util.Random rnd
          Random number generator object
 
Constructor Summary
IBAgent()
          Builds a simple agent with null information
IBAgent(edu.uiuc.ge.illigal.gale.config.GALEConfiguration gale, edu.uiuc.ge.illigal.gale.data.AttributeSet att)
          Builds a simple agent.
 
Method Summary
protected  float boundedFloat(float lb, float ub)
          Generates a random bounded float using the random number generator.
 edu.uiuc.ge.illigal.gale.agents.Agent buildAgent(edu.uiuc.ge.illigal.gale.config.GALEConfiguration galeCnf, edu.uiuc.ge.illigal.gale.data.AttributeSet att)
          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.
 edu.uiuc.ge.illigal.gale.agents.AgentPerformance getPerformance()
          Provides the classification performance information.
static void main(java.lang.String[] sArgs)
           
 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.
 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(float[] faGen, 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


dis

protected edu.uiuc.ge.illigal.gale.distance.Distance dis
Distance function


genVec

protected java.util.Vector genVec
Genetic material vector


iK

protected int iK
K number of instances


fakNN

protected float[] fakNN
KNN minimal values


iakNN

protected int[] iakNN
KNN minimal position


iaPrune

protected int[] iaPrune
Prune information

Constructor Detail

IBAgent

public IBAgent()
Builds a simple agent with null information


IBAgent

public IBAgent(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
att - The attributes set information object
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 att)
Description copied from interface: Agent
Returns a random builded agent.

Specified by:
buildAgent in interface Agent
Parameters:
galeCnf - The GALE configuration object
att - 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

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

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

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

boundedFloat

protected float boundedFloat(float lb,
                             float ub)
Generates a random bounded float using the random number generator.

Parameters:
lb - lower bound
ub - upper bound

mutateGenotype

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


translateArray

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

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

main

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