Source for de.webdings.jannis.neuralnet.nnml.NetToNNML

   1: /* NetToNNML.java - Copyright (c) 2005 by Stefan Thesing
   2:  <p>This file is part of Jannis.</p>
   3:  <p>Jannis is free software; you can redistribute it and/or modify
   4:  it under the terms of the GNU General Public License as published by
   5:  the Free Software Foundation; either version 2 of the License, or
   6:  (at your option) any later version.</p>
   7: <p>Jannis is distributed in the hope that it will be useful,
   8: but WITHOUT ANY WARRANTY; without even the implied warranty of
   9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10: GNU General Public License for more details.</p>
  11: <p>You should have received a copy of the GNU General Public License
  12: along with Jannis; if not, write to the<br>
  13: Free Software Foundation, Inc.,<br>
  14: 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA<br>
  15: */
  16: package de.webdings.jannis.neuralnet.nnml;
  17: 
  18: import de.webdings.jannis.exceptions.NeuronNotFoundException;
  19: import de.webdings.jannis.exceptions.NeuronTypeMismatchException;
  20: import de.webdings.jannis.neuralnet.NeuralNet;
  21: import de.webdings.jannis.neuralnet.Neuron;
  22: import de.webdings.jannis.neuralnet.NeuronIDFinder;
  23: 
  24: /**
  25:  * NetToNNML is used to convert a neural net of to a String 
  26:  * containing a NNML representation
  27:  * of that net. The purpose of this String is to be written
  28:  * to a file.
  29:  * NetToNNML is abstract, so a concrete subclass of 
  30:  * NetToNNML must be used.
  31:  * 
  32:  * @author Stefan Thesing<br>
  33:  * Website: <a href="http://www.webdings.de">http://www.webdings.de</a>
  34:  * @version 0.1 11.08.2005
  35:  */
  36: public abstract class NetToNNML {
  37:     /**
  38:      * the string to be returned by {@link #generateString(NeuralNet)} and
  39:      * {@link #generateString(Neuron[][])}
  40:      */
  41:     String s;
  42:     /**
  43:      * a {@link NeuronIDFinder} to identify the IDs of the contained neurons. The IDs are
  44:      * needed pieces of information for the NNML representation of the net.
  45:      */
  46:     NeuronIDFinder finder;
  47:     /**
  48:      * @param layers the layers of the net to be converted to NNML
  49:      * @return a String containing a NNML representation
  50:      * of the net
  51:      * @throws NeuronTypeMismatchException if the layers contain neurons of different types
  52:      * @throws NeuronNotFoundException 
  53:      */
  54:     public abstract String generateString(Neuron[][] layers) 
  55:         throws NeuronTypeMismatchException, NeuronNotFoundException;
  56:     /**
  57:      * @param net the net to be converted to NNML
  58:      * @return a String containing a NNML representation
  59:      * of the net
  60:      * @throws NeuronTypeMismatchException if the layers contain neurons of different types
  61:      * @throws NeuronNotFoundException 
  62:      */
  63:     public abstract String generateString(NeuralNet net)
  64:         throws NeuronTypeMismatchException, NeuronNotFoundException;
  65: }

© 2005 by Stefan Thesing;
Verbatim copying and redistribution of this entire page are permitted provided this notice is preserved.