00001 /************************************************************************ 00002 * Verve * 00003 * Copyright (C) 2004-2006 * 00004 * Tyler Streeter tylerstreeter@gmail.com * 00005 * All rights reserved. * 00006 * Web: http://verve-agents.sourceforge.net * 00007 * * 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of EITHER: * 00010 * (1) The GNU Lesser General Public License as published by the Free * 00011 * Software Foundation; either version 2.1 of the License, or (at * 00012 * your option) any later version. The text of the GNU Lesser * 00013 * General Public License is included with this library in the * 00014 * file license-LGPL.txt. * 00015 * (2) The BSD-style license that is included with this library in * 00016 * the file license-BSD.txt. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 00021 * license-LGPL.txt and license-BSD.txt for more details. * 00022 ************************************************************************/ 00023 00024 #ifndef VERVE_RBF_NEURON_H 00025 #define VERVE_RBF_NEURON_H 00026 00027 #include "Neuron.h" 00028 00029 namespace verve 00030 { 00031 struct RBFInputData; 00032 00036 enum RBFActivationCode 00037 { 00040 HIGH_ACTIVATION, 00041 00044 LOW_ACTIVATION, 00045 00049 NO_ACTIVATION 00050 }; 00051 00061 class RBFNeuron : public Neuron 00062 { 00063 public: 00064 VERVE_DECL RBFNeuron(unsigned int id); 00065 00066 VERVE_DECL virtual ~RBFNeuron(); 00067 00074 VERVE_DECL virtual void VERVE_CALL init(real stdDevWidth, 00075 real newRBFThreshold, const RBFInputData& inputData); 00076 00084 VERVE_DECL virtual RBFActivationCode VERVE_CALL updateFiringRate( 00085 const RBFInputData& inputData); 00086 00088 VERVE_DECL virtual unsigned int VERVE_CALL 00089 getNumDiscreteDimensions()const; 00090 00092 VERVE_DECL virtual unsigned int VERVE_CALL 00093 getNumContinuousDimensions()const; 00094 00096 VERVE_DECL virtual const unsigned int* VERVE_CALL 00097 getDiscretePosition()const; 00098 00101 VERVE_DECL virtual const real* VERVE_CALL 00102 getContinuousPosition()const; 00103 00104 protected: 00106 unsigned int mNumDiscreteDimensions; 00107 00109 unsigned int mNumContinuousDimensions; 00110 00112 unsigned int* mDiscretePosition; 00113 00115 real* mContinuousPosition; 00116 00119 real mRBFDenominatorInverse; 00120 00124 real mActivationThresholdDistanceSquared; 00125 00129 real mNewRBFThresholdDistanceSquared; 00130 }; 00131 } 00132 00133 #endif