/* * File: NetworkInput.java * Author: Justin Basilico * Course: PO CS 152: Neural Networks * Assignment: Final Project * Updated: 2001.12.18 * Created: 2001.12.03 * * Description: * This file contains the NetworkInput interface, which is an interface that * describes an Object that is input to a NeuralNetwork. * * Copyright: Justin Basilico (2001). */ /** * NetworkInput interface * * This interface is for Objects that are used as inputs for a NeuralNetwork. * Specifically, it will be used by UnitEncoder objects to encode the * NetworkInput into an array of doubles that represent the activation values * of the input units in the network. * * The only methods to be implemented by classes that use this interface are * the getProperty() method. There are two versions of the method, one that * takes an integer property number and another that takes a String property * name. Both of these methods should return an Object which is the specified * property. The reason for doing this is so that it can be used along with a * UnitEncoder, which should know the proper property that it is retrieving * from the NetworkInput that it is to encode. The NetworkInput and * UnitEncoder interfaces really act as a pair. There is an integer and String * version of the methods so that you can choose which of the two methods to * use in order to get the best performance from the specific implementation. * * @author Justin Basilico * @version 2001.12.18 * @see UnitEncoder * @see NeuralNetwork * @see FeedForwardNetwork */ public interface NetworkInput { /** * getProperty (integer) * * This method takes an integer property number and returns the Object for * this NetworkInput corresponding to that property number. If there is no * corresponding Object, it returns null. * * This method should be used instead of the String version of * getProperty() in order to make things slightly faster. * * @param propertyNum The integer property number to get from this * NetworkInput. * @return The Object for this NetworkInput with the given property * number, or null if there is no such Object. * @see NetworkInput.getProperty(String) */ public Object getProperty( int propertyNum); // Property number to get. /** * getProperty (String) * * This method takes an String property name and returns the Object for * this NetworkInput corresponding to that property name. If there is no * corresponding Object, it returns null. * * This method should be used if the implementing NetworkInput has some * sort of Hashtable, otherwise the integer version of the method should * probably be used because it is faster. * * @param propertyNum The integer property number to get from this * NetworkInput. * @return The Object for this NetworkInput with the given property * number, or null if there is no such Object. * @see NetworkInput.getProperty(int) */ public Object getProperty( String propertyName); // Property name to get. }