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

   1: /* NNMLToNet.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.neuralnet.Neuron;
  19: 
  20: /**
  21:  * NNMLToNet is used to construct a neural net from
  22:  * a NNML representation.
  23:  * NNMLToNet is abstract, so a concrete subclass has to
  24:  * be used.
  25:  * 
  26:  * @author Stefan Thesing<br>
  27:  * Website: <a href="http://www.webdings.de">http://www.webdings.de</a>
  28:  * @version 0.1 11.08.2005
  29:  */
  30: public abstract class NNMLToNet {
  31:     /**
  32:      * This method is concrete, yet it doesn't do anything
  33:      * on it's own. It simply calls the abstract method of 
  34:      * the same name.<br>
  35:      * The implementation is:<br>
  36:      * <code>
  37:      * public Neuron[][] convertToNet(char[] c) throws Exception {<br>
  38:      *  return convertToNet(new String(c));<br>
  39:      * }
  40:      * </code>
  41:      * So this method calls the method of a concrete 
  42:      * subclass of NNMLToNet.
  43:      * @param c NNML representation of a neural net
  44:      * @return array containing layers of Neurons
  45:      * @throws Exception
  46:      */
  47:     public Neuron[][] convertToNet(char[] c) throws Exception {
  48:         return convertToNet(new String(c));
  49:     }
  50:     /**
  51:      * This method is concrete, yet it doesn't do anything
  52:      * on it's own. It simply calls the abstract method of 
  53:      * the same name.<br>
  54:      * The implementation is:<br>
  55:      * <code>
  56:      * public Neuron[][] convertToNet(StringBuffer s) throws Exception {<br>
  57:      *  return convertToNet(new String(s));<br>
  58:      * }
  59:      * </code>
  60:      * So this method calls the method of a concrete 
  61:      * subclass of NNMLToNet.
  62:      * @param s NNML representation of a neural net
  63:      * @return array containing layers of Neurons
  64:      * @throws Exception
  65:      */
  66:     public Neuron[][] convertToNet(StringBuffer s) throws Exception {
  67:         return convertToNet(new String(s));
  68:     }
  69:     
  70:     /**
  71:      * This is an abstract method to be overwritten by
  72:      * concrete subclasses.
  73:      * @param s NNML representation of a neural net
  74:      * @return array containing layers of Neurons
  75:      * @throws Exception
  76:      */
  77:     public abstract Neuron[][] convertToNet(String s) throws Exception;
  78: }

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