00001 /****************************************************************************************************************/ 00002 /* */ 00003 /* OpenNN: Open Neural Networks Library */ 00004 /* www.opennn.cimne.com */ 00005 /* */ 00006 /* T I M E S E R I E S P R E D I C T I O N T E S T I N G C L A S S */ 00007 /* */ 00008 /* Roberto Lopez */ 00009 /* International Center for Numerical Methods in Engineering (CIMNE) */ 00010 /* Technical University of Catalonia (UPC) */ 00011 /* Barcelona, Spain */ 00012 /* E-mail: rlopez@cimne.upc.edu */ 00013 /* */ 00014 /****************************************************************************************************************/ 00015 00016 // System includes 00017 00018 #include <iostream> 00019 #include <fstream> 00020 #include <string> 00021 #include <sstream> 00022 #include <cmath> 00023 00024 // OpenNN includes 00025 00026 #include "time_series_prediction_testing.h" 00027 00028 namespace OpenNN 00029 { 00030 00031 // DEFAULT CONSTRUCTOR 00032 00035 00036 TimeSeriesPredictionTesting::TimeSeriesPredictionTesting(void) 00037 : neural_network_pointer(NULL), 00038 data_set_pointer(NULL) 00039 { 00040 set_default(); 00041 } 00042 00043 00044 // NEURAL NETWORK CONSTRUCTOR 00045 00049 00050 TimeSeriesPredictionTesting::TimeSeriesPredictionTesting(NeuralNetwork* new_neural_network_pointer) 00051 : neural_network_pointer(new_neural_network_pointer), 00052 data_set_pointer(NULL) 00053 { 00054 set_default(); 00055 } 00056 00057 00058 // DATA SET CONSTRUCTOR 00059 00063 00064 TimeSeriesPredictionTesting::TimeSeriesPredictionTesting(DataSet* new_data_set_pointer) 00065 : neural_network_pointer(NULL), 00066 data_set_pointer(new_data_set_pointer) 00067 { 00068 set_default(); 00069 } 00070 00071 00072 // GENERAL CONSTRUCTOR 00073 00078 00079 TimeSeriesPredictionTesting::TimeSeriesPredictionTesting(NeuralNetwork* new_neural_network_pointer, DataSet* new_data_set_pointer) 00080 : neural_network_pointer(new_neural_network_pointer), 00081 data_set_pointer(new_data_set_pointer) 00082 { 00083 set_default(); 00084 } 00085 00086 00087 // XML CONSTRUCTOR 00088 00093 00094 TimeSeriesPredictionTesting::TimeSeriesPredictionTesting(TiXmlElement* time_series_prediction_testing_element) 00095 : neural_network_pointer(NULL), 00096 data_set_pointer(NULL) 00097 { 00098 set_default(); 00099 00100 from_XML(time_series_prediction_testing_element); 00101 } 00102 00103 00104 00105 // DESTRUCTOR 00106 00109 00110 TimeSeriesPredictionTesting::~TimeSeriesPredictionTesting() 00111 { 00112 } 00113 00114 00115 // METHODS 00116 00117 // NeuralNetwork* get_neural_network_pointer(void) const method 00118 00120 00121 NeuralNetwork* TimeSeriesPredictionTesting::get_neural_network_pointer(void) const 00122 { 00123 return(neural_network_pointer); 00124 } 00125 00126 00127 // DataSet* get_data_set_pointer(void) const method 00128 00130 00131 DataSet* TimeSeriesPredictionTesting::get_data_set_pointer(void) const 00132 { 00133 return(data_set_pointer); 00134 } 00135 00136 00137 // const bool& get_display(void) const method 00138 00141 00142 const bool& TimeSeriesPredictionTesting::get_display(void) const 00143 { 00144 return(display); 00145 } 00146 00147 00148 // void set_neural_network_pointer(NeuralNetwork*) method 00149 00152 00153 void TimeSeriesPredictionTesting::set_neural_network_pointer(NeuralNetwork* new_neural_network_pointer) 00154 { 00155 neural_network_pointer = new_neural_network_pointer; 00156 } 00157 00158 00159 // void set_data_set_pointer(DataSet*) method 00160 00163 00164 void TimeSeriesPredictionTesting::set_data_set_pointer(DataSet* new_data_set_pointer) 00165 { 00166 data_set_pointer = new_data_set_pointer; 00167 } 00168 00169 00170 // void set_display(const bool&) method 00171 00174 00175 void TimeSeriesPredictionTesting::set_display(const bool& new_display) 00176 { 00177 display = new_display; 00178 } 00179 00180 00181 // void set_default(void) method 00182 00187 00188 void TimeSeriesPredictionTesting::set_default(void) 00189 { 00190 display = true; 00191 } 00192 00193 00194 // std::string to_string(void) const method 00195 00197 00198 std::string TimeSeriesPredictionTesting::to_string(void) const 00199 { 00200 std::ostringstream buffer; 00201 00202 buffer << "Time series prediction testing\n" 00203 << "Display: " << display << "\n"; 00204 00205 return(buffer.str()); 00206 } 00207 00208 00209 // TiXmlElement* to_XML(void) const method 00210 00212 00213 TiXmlElement* TimeSeriesPredictionTesting::to_XML(void) const 00214 { 00215 return(NULL); 00216 } 00217 00218 00219 // void from_XML(TiXmlElement*) method 00220 00222 // @param time_series_prediction_element Pointer to a XML element containing the member data. 00224 00225 void TimeSeriesPredictionTesting::from_XML(TiXmlElement*) 00226 { 00227 } 00228 00229 00230 } 00231 00232 00233 // OpenNN: Open Neural Networks Library. 00234 // Copyright (C) 2005-2012 Roberto Lopez 00235 // 00236 // This library is free software; you can redistribute it and/or 00237 // modify it under the terms of the GNU Lesser General Public 00238 // License as published by the Free Software Foundation; either 00239 // version 2.1 of the License, or any later version. 00240 // 00241 // This library is distributed in the hope that it will be useful, 00242 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00243 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00244 // Lesser General Public License for more details. 00245 00246 // You should have received a copy of the GNU Lesser General Public 00247 // License along with this library; if not, write to the Free Software 00248 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00249