nnfw/src/fakecluster.cpp

00001 /********************************************************************************
00002  *  Neural Network Framework.                                                   *
00003  *  Copyright (C) 2005-2011 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 "fakecluster.h"
00021 #include "liboutputfunctions.h"
00022 
00023 namespace farsa {
00024 
00025 FakeCluster::FakeCluster( unsigned int size, QString name )
00026     : Cluster( size, name) {
00027     // Outputs will point to same data of Inputs
00028     outputdataptr = inputdataptr;
00029 }
00030 
00031 FakeCluster::FakeCluster( ConfigurationParameters& params, QString prefix )
00032     : Cluster( params, prefix ) {
00033     // Outputs will point to same data of Inputs
00034     outputdataptr = inputdataptr;
00035     // there is no extra parameters to configure
00036 }
00037 
00038 FakeCluster::~FakeCluster() {
00039 }
00040 
00041 void FakeCluster::update() {
00042     setNeedReset( true );
00043     return;
00044 }
00045 
00046 void FakeCluster::randomize( double , double ) {
00047     return;
00048 }
00049 
00050 void FakeCluster::save(ConfigurationParameters& params, QString prefix) {
00051     Cluster::save( params, prefix );
00052     params.startObjectParameters( prefix, "FakeCluster", this );
00053     // there is no extra parameters to save
00054 }
00055 
00056 void FakeCluster::describe( QString type ) {
00057     Cluster::describe( type );
00058     addTypeDescription( type, "This Cluster collapse inputs and outputs", "The inputs and outputs values are always the same regardless the update method has been called or not. The OutFunction parameter has no effect" );
00059 }
00060 
00061 }