nnfw/src/simplecluster.cpp

00001 /********************************************************************************
00002  *  Neural Network Framework.                                                   *
00003  *  Copyright (C) 2005-2009 Gianluca Massera <emmegian@yahoo.it>                *
00004  *                                                                              *
00005  *  This program is free software; you can redistribute it and/or modify        *
00006  *  it under the terms of the GNU General Public License as published by        *
00007  *  the Free Software Foundation; either version 2 of the License, or           *
00008  *  (at your option) any later version.                                         *
00009  *                                                                              *
00010  *  This program is distributed in the hope that it will be useful,             *
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
00013  *  GNU General Public License for more details.                                *
00014  *                                                                              *
00015  *  You should have received a copy of the GNU General Public License           *
00016  *  along with this program; if not, write to the Free Software                 *
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  *
00018  ********************************************************************************/
00019 
00020 #include "simplecluster.h"
00021 #include "outputfunction.h"
00022 
00023 namespace farsa {
00024 
00025 SimpleCluster::SimpleCluster( unsigned int numNeurons, QString name )
00026     : Cluster( numNeurons, name) {
00027 }
00028 
00029 SimpleCluster::SimpleCluster( ConfigurationParameters& params, QString prefix )
00030     : Cluster( params, prefix ) {
00031     // there is no extra parameters to configure
00032 }
00033 
00034 SimpleCluster::~SimpleCluster() {
00035 }
00036 
00037 void SimpleCluster::update() {
00038     outFunction()->apply( inputs(), outputs() );
00039     setNeedReset( true );
00040 }
00041 
00042 void SimpleCluster::save(ConfigurationParameters& params, QString prefix) {
00043     Cluster::save( params, prefix );
00044     params.startObjectParameters( prefix, "SimpleCluster", this );
00045     // there is no extra parameters to save
00046 }
00047 
00048 void SimpleCluster::describe( QString type ) {
00049     Cluster::describe( type );
00050     addTypeDescription( type, "A simple Cluster" );
00051 }
00052 
00053 }