simuLCS
Class ClassifierSet

java.lang.Object
  extended bysimuLCS.ClassifierSet
Direct Known Subclasses:
ZClassifierSet

public class ClassifierSet
extends java.lang.Object

Set of classifiers (might be ordered) used to describe a behaviour or the population inside the LCS.

Author:
Benoit
See Also:
Classifier

Field Summary
protected  java.util.Set classifiers
          The classifiers are in a Java Set.
protected  boolean isSorted
           
protected  Template template
           
 
Constructor Summary
ClassifierSet(Template t)
          Constructs a non sorted Set of Classifiers.
ClassifierSet(Template t, boolean isSort)
          Constructs a Set of Classifiers, sorted if isSort = true, non sorted otherwise.
ClassifierSet(Template template, java.util.Comparator order)
           
 
Method Summary
 void addClassifier(Classifier c)
           
 void addClassifierSet(ClassifierSet cs)
           
 boolean contains(Classifier c)
          Returns true if this Set contains the classifier c
 ClassifierSet getActionSet()
          Operate a selection among those Classifiers (the satisfied) By default, no selection, all the classifiers are kept Should be overriden by subclasses
 Classifier[] getClassifiers()
          Get an array with all the classifiers in this set
 java.util.Iterator getIterator()
           
 ClassifierSet getMatchSet(java.lang.String condToSatisfy)
          Extract the classifiers of the set which have a Condition part that satisfies the condToSatisfy i.e. each bit of the condition part of classifier is either '#' or the same symbol (0 or 1) as the condToSatisfy one.
 int getSize()
           
 Template getTemplate()
           
 void removeClassifier(Classifier c)
           
 void setTemplate(Template template)
           
 java.lang.String toString()
          Returns the list of the Classifiers to print them
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

template

protected Template template

isSorted

protected boolean isSorted

classifiers

protected java.util.Set classifiers
The classifiers are in a Java Set.

Constructor Detail

ClassifierSet

public ClassifierSet(Template t)
Constructs a non sorted Set of Classifiers.

Parameters:
t - the template of the classifiers

ClassifierSet

public ClassifierSet(Template t,
                     boolean isSort)
Constructs a Set of Classifiers, sorted if isSort = true, non sorted otherwise.

Parameters:
t - the template of the classifiers
isSort - determines if the Set has to be sorted.

ClassifierSet

public ClassifierSet(Template template,
                     java.util.Comparator order)
Parameters:
template -
order -
Method Detail

addClassifier

public void addClassifier(Classifier c)

addClassifierSet

public void addClassifierSet(ClassifierSet cs)

removeClassifier

public void removeClassifier(Classifier c)

contains

public boolean contains(Classifier c)
Returns true if this Set contains the classifier c

Parameters:
c -
Returns:

getIterator

public java.util.Iterator getIterator()

getSize

public int getSize()

getClassifiers

public Classifier[] getClassifiers()
Get an array with all the classifiers in this set

Returns:

getMatchSet

public ClassifierSet getMatchSet(java.lang.String condToSatisfy)
Extract the classifiers of the set which have a Condition part that satisfies the condToSatisfy i.e. each bit of the condition part of classifier is either '#' or the same symbol (0 or 1) as the condToSatisfy one.

Parameters:
condToSatisfy -
Returns:
an array of Classifiers satisfying the condition

getActionSet

public ClassifierSet getActionSet()
Operate a selection among those Classifiers (the satisfied) By default, no selection, all the classifiers are kept Should be overriden by subclasses


getTemplate

public Template getTemplate()

setTemplate

public void setTemplate(Template template)

toString

public java.lang.String toString()
Returns the list of the Classifiers to print them