Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.core.common
Class ASCIIFileWriter

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.FileWriter
                  extended byorg.evolvica.core.common.ASCIIFileWriter
All Implemented Interfaces:
IGeneticOperator, IOperator, IProcessor, java.io.Serializable

public class ASCIIFileWriter
extends FileWriter

Processor for saving individual sets to plain ASCII files. This processor performs a toString() on each individual in the collection. Everytime the write() method is invoked the collection is written to a different file. A set written to an ASCII file cannot be restored from that file.

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

Field Summary
protected  boolean genotypeSurpressed
          Indicator if printing of genetic representation should be surpressed.
 
Fields inherited from class org.evolvica.core.common.FileWriter
body, directory, suffix
 
Fields inherited from class org.evolvica.engine.AbstractOperator
descriptor, element, id, name
 
Constructor Summary
ASCIIFileWriter()
          Constructor.
ASCIIFileWriter(java.lang.String body, java.lang.String suffix)
          Constructor with filename body and suffix.
 
Method Summary
 boolean isGenotypeSurpressed()
          Checks if the printing of the genotype will be surpressed.
 void setGenotypeSurpressed(boolean b)
          Sets a flag to surpress the printing of the genotype.
 void write(IIndividualSet set)
          Saves the individual collection to a file.
 
Methods inherited from class org.evolvica.core.common.FileWriter
getBody, getDirectory, getSuffix, setBody, setDirectory, setSuffix
 
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

genotypeSurpressed

protected boolean genotypeSurpressed
Indicator if printing of genetic representation should be surpressed. The default value is false.

Constructor Detail

ASCIIFileWriter

public ASCIIFileWriter()
Constructor.


ASCIIFileWriter

public ASCIIFileWriter(java.lang.String body,
                       java.lang.String suffix)
Constructor with filename body and suffix.

Parameters:
body - body of filename to write to
suffix - suffix to be used
Method Detail

write

public void write(IIndividualSet set)
Saves the individual collection to a file. The collection is saved to a file named <filename body>_<identifier>.<suffix>. The identifier is generated automatically to prevent overwriting old files. The default suffix is .txt.

Parameters:
set - individual set to be saved

isGenotypeSurpressed

public boolean isGenotypeSurpressed()
Checks if the printing of the genotype will be surpressed.

Returns:
true if printing is surpressed false instead

setGenotypeSurpressed

public void setGenotypeSurpressed(boolean b)
Sets a flag to surpress the printing of the genotype.

Parameters:
b - flag if genotype printing should be surpressed

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

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