001    package aima.learning.neural;
002    
003    import java.util.Hashtable;
004    
005    /*
006     * a holder for config data for neural networks and possibly for other
007     * learning systems.
008     */
009    public class NNConfig {
010            private final Hashtable<String, Object> hash;
011    
012            public NNConfig(Hashtable<String, Object> hash) {
013                    this.hash = hash;
014            }
015    
016            public NNConfig() {
017                    this.hash = new Hashtable<String, Object>();
018            }
019    
020            public double getParameterAsDouble(String key) {
021    
022                    return (Double) hash.get(key);
023            }
024    
025            public int getParameterAsInteger(String key) {
026    
027                    return (Integer) hash.get(key);
028            }
029    
030            public void setConfig(String key, Double value) {
031                    hash.put(key, value);
032            }
033    
034            public void setConfig(String key, int value) {
035                    hash.put(key, value);
036            }
037    }