00001 /************************************************************************************************** 00002 * LibNeural++ v.0.4 - All-purpose library for managing neural networks * 00003 * Copyright (C) 2009, BlackLight * 00004 * * 00005 * This program is free software: you can redistribute it and/or modify it under the terms of the * 00006 * GNU General Public License as published by the Free Software Foundation, either version 3 of * 00007 * the License, or (at your option) any later version. This program is distributed in the hope * 00008 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * 00010 * more details. You should have received a copy of the GNU General Public License along with * 00011 * this program. If not, see <http://www.gnu.org/licenses/>. * 00012 **************************************************************************************************/ 00013 00014 #ifndef __NEURALPP_EXCEPTION 00015 #define __NEURALPP_EXCEPTION 00016 00017 #include <exception> 00018 00019 namespace neuralpp { 00024 class NetworkFileNotFoundException : public std::exception { 00025 public: 00026 NetworkFileNotFoundException() {} 00027 const char* what() const throw() { return "Attempt to load a neural network from an invalid network file"; } 00028 }; 00029 00035 class NetworkFileWriteException : public std::exception { 00036 public: 00037 NetworkFileWriteException() {} 00038 const char* what() const throw() { return "There was an error while writing the network file"; } 00039 }; 00040 00045 class InvalidXMLException : public std::exception { 00046 public: 00047 InvalidXMLException() {} 00048 const char* what() const throw() { return "Attempt to load an invalid XML file"; } 00049 }; 00050 00056 class NetworkIndexOutOfBoundsException : public std::exception { 00057 public: 00058 NetworkIndexOutOfBoundsException() {} 00059 const char* what() const throw() { return "Attempt to access a non-existing neuron"; } 00060 }; 00061 00067 class InvalidSynapticalWeightException : public std::exception { 00068 public: 00069 InvalidSynapticalWeightException() {} 00070 const char* what() const throw() { return "Attempt to set an invalid weight for the synapsis"; } 00071 }; 00072 } 00073 00074 #endif 00075