|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgap.impl.JGAPFactory
public class JGAPFactory
Central factory for creating default objects to use, e.g. random generators. Could be made configurable. An instance of JGAPFactory can be accessed via
Genotype.getConfiguration().getJGAPFactory();
To use your own factory class instead, use:
System.setProperty(Configuration.PROPERTY_JGAPFACTORY_CLASS, "myFactory");
with "myFactory" representing the name of your class to use.
| Constructor Summary | |
|---|---|
JGAPFactory(boolean a_useCaching)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object a_other)
|
RandomGenerator |
createRandomGenerator()
|
boolean |
equals(java.lang.Object a_other)
The equals-method |
protected IHandler |
findHandlerFor(java.lang.Object a_obj,
java.lang.Class a_class,
java.util.List a_list,
IHandler a_default,
java.lang.String a_listID)
Helper: Finds a handler for a given Object or Class, returns the default handler, if one is provided. |
ICloneHandler |
getCloneHandlerFor(java.lang.Object a_obj,
java.lang.Class a_classToClone)
Retrieves a clone handler capable of clone the given class. |
ICompareToHandler |
getCompareToHandlerFor(java.lang.Object a_obj,
java.lang.Class a_classToCompareTo)
Retrieves a handler capable of comparing two instances of the given class. |
IGeneticOperatorConstraint |
getGeneticOperatorConstraint()
|
IInitializer |
getInitializerFor(java.lang.Object a_obj,
java.lang.Class a_class)
Retrieves an initializer capable of initializing the Object of the given class. |
java.util.Collection |
getParameters()
|
java.lang.String |
getUniqueKey(java.lang.String a_context)
Returns a unique key for the given context. |
boolean |
isUseCaching()
|
int |
registerCloneHandler(ICloneHandler a_cloneHandler)
Registers a clone handler that could be retrieved by getCloneHandlerFor(Class). |
int |
registerCompareToHandler(ICompareToHandler a_compareToHandler)
Registers a compareTo-handler that could be retrieved by getCompareToHandlerFor(Class). |
int |
registerInitializer(IInitializer a_chromIniter)
Registers an initializer that could be retrieved by getInitializerFor(Class). |
ICloneHandler |
removeCloneHandler(int a_index)
Removes a clone handler at a given index (which is obtained from registerCloneHandler). |
ICompareToHandler |
removeCompareToHandler(int a_index)
Removes a compareTo-handler at a given index (which is obtained from registerCompareToHandler). |
IInitializer |
removeInitializer(int a_index)
Removes an initializer at a given index (which is obtained from registerInitializer). |
void |
setGeneticOperatorConstraint(IGeneticOperatorConstraint a_constraint)
|
void |
setParameters(java.util.Collection a_parameters)
Allows setting (generic because unknown) parameters for creating objects. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JGAPFactory(boolean a_useCaching)
| Method Detail |
|---|
public void setParameters(java.util.Collection a_parameters)
setParameters in interface IJGAPFactorya_parameters - Collection of generic parameterspublic java.util.Collection getParameters()
public RandomGenerator createRandomGenerator()
createRandomGenerator in interface IJGAPFactorypublic int registerCloneHandler(ICloneHandler a_cloneHandler)
registerCloneHandler in interface IJGAPFactorya_cloneHandler - the ICloneHandler to register
public ICloneHandler removeCloneHandler(int a_index)
a_index - the index of the clone handler to remove
public ICloneHandler getCloneHandlerFor(java.lang.Object a_obj,
java.lang.Class a_classToClone)
getCloneHandlerFor in interface IJGAPFactorya_obj - the object to clone (maybe null)a_classToClone - the class to clone an object of (maybe null)
public int registerInitializer(IInitializer a_chromIniter)
registerInitializer in interface IJGAPFactorya_chromIniter - the IChromosomeInitializer to register
public IInitializer removeInitializer(int a_index)
a_index - the index of the initializer to remove
public IInitializer getInitializerFor(java.lang.Object a_obj,
java.lang.Class a_class)
getInitializerFor in interface IJGAPFactorya_obj - the object to init (maybe null)a_class - the object class to init (maybe null)
public void setGeneticOperatorConstraint(IGeneticOperatorConstraint a_constraint)
setGeneticOperatorConstraint in interface IJGAPFactorypublic IGeneticOperatorConstraint getGeneticOperatorConstraint()
getGeneticOperatorConstraint in interface IJGAPFactory
public ICompareToHandler getCompareToHandlerFor(java.lang.Object a_obj,
java.lang.Class a_classToCompareTo)
getCompareToHandlerFor in interface IJGAPFactorya_obj - the object to compare (maybe null)a_classToCompareTo - the class instances to compare (maybe null)
public int registerCompareToHandler(ICompareToHandler a_compareToHandler)
registerCompareToHandler in interface IJGAPFactorya_compareToHandler - the ICompareToHandler to register
public ICompareToHandler removeCompareToHandler(int a_index)
a_index - the index of the handler to remove
protected IHandler findHandlerFor(java.lang.Object a_obj,
java.lang.Class a_class,
java.util.List a_list,
IHandler a_default,
java.lang.String a_listID)
a_obj - the object to find a handler for (maybe null)a_class - the class to find a handler for (maybe null)a_list - list of available handlersa_default - a default handler to return in none other is founda_listID - arbitrary unique string for accessing the cache
public boolean isUseCaching()
public java.lang.Object clone()
clone in interface ICloneableclone in class java.lang.Objectpublic boolean equals(java.lang.Object a_other)
equals in class java.lang.Objecta_other - sic
public int compareTo(java.lang.Object a_other)
compareTo in interface java.lang.Comparablea_other - other object to compare
public java.lang.String getUniqueKey(java.lang.String a_context)
a_context - the context to get the next key for, like "Chromosome".
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||