Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.core.common
Class ConsoleWriter

java.lang.Object
  extended byorg.evolvica.engine.AbstractOperator
      extended byorg.evolvica.core.common.AbstractGeneticOperator
          extended byorg.evolvica.core.common.AbstractWriter
              extended byorg.evolvica.core.common.ConsoleWriter
All Implemented Interfaces:
IGeneticOperator, IOperator, IProcessor, java.io.Serializable

public class ConsoleWriter
extends AbstractWriter

Processor for printing individual collections.

Since:
0.4.0
Version:
$Revision: 1.12 $ $Date: 2004/05/26 11:57:58 $
Author:
Andreas Rummler
See Also:
Serialized Form

Field Summary
protected  java.lang.String pattern
          Pattern that is to be written for each individual.
protected  java.io.PrintWriter writer
          Printwriter to write information to.
 
Fields inherited from class org.evolvica.engine.AbstractOperator
descriptor, element, id, name
 
Constructor Summary
ConsoleWriter()
          Default constructor.
ConsoleWriter(java.io.PrintWriter pw)
          Constructor with printwriter.
 
Method Summary
 java.lang.String getPattern()
          Returns the current print pattern.
 void setPattern(java.lang.String string)
          Sets the pattern to be used when printing individuals.
 void write(IIndividualSet set)
          Prints all individuals to the console.
 
Methods inherited from class org.evolvica.core.common.AbstractWriter
process
 
Methods inherited from class org.evolvica.engine.AbstractOperator
attachDescriptor, attachElement, descriptor, element, getId, getName, setId, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.evolvica.engine.IOperator
attachDescriptor, attachElement, descriptor, element, getId, getName, setId, setName
 

Field Detail

writer

protected java.io.PrintWriter writer
Printwriter to write information to.


pattern

protected java.lang.String pattern
Pattern that is to be written for each individual. The pattern string is expanded as follows:
%f - expands to the fitness value of an individual
%g - expands to the genotype of an individual
%i - an optional index
%s - expands to the score of an individual

Constructor Detail

ConsoleWriter

public ConsoleWriter()
Default constructor. This sets the printwriter to System.out.


ConsoleWriter

public ConsoleWriter(java.io.PrintWriter pw)
Constructor with printwriter.

Parameters:
pw - printwriter to write to
Method Detail

write

public void write(IIndividualSet set)
Prints all individuals to the console.

Parameters:
set - individual set to be written

getPattern

public java.lang.String getPattern()
Returns the current print pattern.

Returns:
pattern used when printing individuals.

setPattern

public void setPattern(java.lang.String string)
                throws java.beans.PropertyVetoException
Sets the pattern to be used when printing individuals.

Parameters:
string - print pattern
Throws:
java.beans.PropertyVetoException

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems