OpenNN  2.2
Open Neural Networks Library
plug_in.cpp
1 /****************************************************************************************************************/
2 /* */
3 /* OpenNN: Open Neural Networks Library */
4 /* www.artelnics.com/opennn */
5 /* */
6 /* P L U G - I N C L A S S */
7 /* */
8 /* Roberto Lopez */
9 /* Artelnics - Making intelligent use of data */
11 /* */
12 /****************************************************************************************************************/
13 
14 // OpenNN includes
15 
16 #include "plug_in.h"
17 
18 namespace OpenNN
19 {
20 
21 // DEFAULT CONSTRUCTOR
22 
25 
27 {
28  set_default();
29 }
30 
31 
32 // XML CONSTRUCTOR
33 
37 
38 PlugIn::PlugIn(const tinyxml2::XMLDocument& plug_in_document)
39 : MathematicalModel(plug_in_document)
40 {
41 }
42 
43 
44 // DESTRUCTOR
45 
48 
50 {
51 }
52 
53 
54 // ASSIGNMENT OPERATOR
55 
56 // PlugIn& operator = (const PlugIn&) method
57 
61 
62 PlugIn& PlugIn::operator = (const PlugIn& other_plug_in)
63 {
64  if(this != &other_plug_in)
65  {
66  input_method = other_plug_in.input_method;
67 
68  template_file_name = other_plug_in.template_file_name;
69  input_file_name = other_plug_in.input_file_name;
70 
71  script_file_name = other_plug_in.script_file_name;
72 
73  output_file_name = other_plug_in.output_file_name;
74 
75  input_flags = other_plug_in.input_flags;
76 
77  output_rows_number = other_plug_in.output_rows_number;
79  }
80 
81  return(*this);
82 }
83 
84 
85 // EQUAL TO OPERATOR
86 
87 // bool operator == (const PlugIn&) const method
88 
93 
94 bool PlugIn::operator == (const PlugIn& other_plug_in) const
95 {
96  if(input_method == other_plug_in.input_method
97  && template_file_name == other_plug_in.template_file_name
98  && input_file_name == other_plug_in.input_file_name
99  && script_file_name == other_plug_in.script_file_name
100  && output_file_name == other_plug_in.output_file_name
101  && input_flags == other_plug_in.input_flags
102  && output_rows_number == other_plug_in.output_rows_number
103  && output_columns_number == other_plug_in.output_columns_number)
104  {
105  return(true);
106  }
107  else
108  {
109  return(false);
110  }
111 }
112 
113 
114 // METHODS
115 
116 // const InputMethod& get_input_method(void) const method
117 
119 
121 {
122  return(input_method);
123 }
124 
125 
126 // std::string write_input_method(void) const method
127 
129 
130 std::string PlugIn::write_input_method(void) const
131 {
132  switch(input_method)
133  {
134  case IndependentParametersInput:
135  {
136  return("IndependentParameters");
137  }
138  break;
139 
140  default:
141  {
142  std::ostringstream buffer;
143 
144  buffer << "OpenNN Exception: PlugIn class.\n"
145  << "std::string get_input_method_name(void) const method.\n"
146  << "Unknown inputs method.\n";
147 
148  throw std::logic_error(buffer.str());
149  }
150  break;
151  }
152 }
153 
154 
155 // const std::string& get_template_file_name(void) method
156 
158 
159 const std::string& PlugIn::get_template_file_name(void) const
160 {
161  return(template_file_name);
162 }
163 
164 
165 // const std::string& get_input_file_name(void) method
166 
168 
169 const std::string& PlugIn::get_input_file_name(void) const
170 {
171  return(input_file_name);
172 }
173 
174 
175 // const std::string& get_script_file_name(void) method
176 
178 
179 const std::string& PlugIn::get_script_file_name(void) const
180 {
181  return(script_file_name);
182 }
183 
184 
185 // const std::string& get_output_file_name(void) method
186 
188 
189 const std::string& PlugIn::get_output_file_name(void) const
190 {
191  return(output_file_name);
192 }
193 
194 
195 // const Vector<std::string>& get_input_flags(void) const method
196 
198 
200 {
201  return(input_flags);
202 }
203 
204 
205 // const std::string& get_input_flag(const size_t&) const method
206 
209 
210 const std::string& PlugIn::get_input_flag(const size_t& i) const
211 {
212  return(input_flags[i]);
213 }
214 
215 
216 // void set_default(void) method
217 
226 
228 {
229  input_method = IndependentParametersInput;
230 
231  template_file_name = "template.dat";
232  input_file_name = "input.dat";
233 
234  script_file_name = "batch.bat";
235 
236  output_file_name = "output.dat";
237 
238  display = true;
239 }
240 
241 
242 // void set_input_method(const InputMethod&) method
243 
246 
247 void PlugIn::set_input_method(const InputMethod& new_input_method)
248 {
249  input_method = new_input_method;
250 }
251 
252 
253 // void set_input_method(const std::string&) method
254 
257 
258 void PlugIn::set_input_method(const std::string& new_input_method)
259 {
260  if(new_input_method == "IndependentParameters")
261  {
262  set_input_method(IndependentParametersInput);
263  }
264  else
265  {
266  std::ostringstream buffer;
267 
268  buffer << "OpenNN Exception: PlugIn class.\n"
269  << "void set_input_method(const std::string&) method.\n"
270  << "Unknown plug-in method: " << new_input_method << ".\n";
271 
272  throw std::logic_error(buffer.str());
273  }
274 }
275 
276 
277 // void set_template_file_name(const std::string&) method
278 
281 
282 void PlugIn::set_template_file_name(const std::string& new_template_file_name)
283 {
284  template_file_name = new_template_file_name;
285 }
286 
287 
288 // void set_input_file_name(const std::string&) method
289 
292 
293 void PlugIn::set_input_file_name(const std::string& new_input_file_name)
294 {
295  input_file_name = new_input_file_name;
296 }
297 
298 
299 // void set_script_file_name(const std::string&) method
300 
303 
304 void PlugIn::set_script_file_name(const std::string& new_script_file_name)
305 {
306  script_file_name = new_script_file_name;
307 }
308 
309 
310 // void set_output_file_name(const std::string&) method
311 
314 
315 void PlugIn::set_output_file_name(const std::string& new_output_file_name)
316 {
317  output_file_name = new_output_file_name;
318 }
319 
320 
321 // void set_input_flags(const Vector<std::string>&) method
322 
325 
326 void PlugIn::set_input_flags(const Vector<std::string>& new_input_flags)
327 {
328  input_flags = new_input_flags;
329 }
330 
331 
332 // void write_input_file(const NeuralNetwork&) const method
333 
336 
337 void PlugIn::write_input_file(const NeuralNetwork& neural_network) const
338 {
339  switch(input_method)
340  {
341  case IndependentParametersInput:
342  {
344  }
345  break;
346 
347  default:
348  {
349  std::ostringstream buffer;
350 
351  buffer << "OpenNN Exception: PlugIn class.\n"
352  << "void write_input_file(const NeuralNetwork&) const method.\n"
353  << "Unknown input method.\n";
354 
355  throw std::logic_error(buffer.str());
356  }
357  break;
358  }
359 }
360 
361 
362 // void write_input_file_independent_parameters(const NeuralNetwork&) const method
363 
365 
367 {
368  const IndependentParameters* independent_parameters_pointer = neural_network.get_independent_parameters_pointer();
369 
370  #ifndef NDEBUG
371 
372  if(!independent_parameters_pointer)
373  {
374  std::ostringstream buffer;
375 
376  buffer << "OpenNN Exception: PlugIn class.\n"
377  << "void write_input_file_independent_parameters(void) const method.\n"
378  << "Pointer to independent parameters is null.\n";
379 
380  throw std::logic_error(buffer.str());
381  }
382 
383  #endif
384 
385  const Vector<double> independent_parameters = independent_parameters_pointer->get_parameters();
386 
387  //size_t input_flags_number = input_flags.size();
388 
389  //size_t independent_parameters_number = independent_parameters.size();
390 
392 
393  //if(input_flags_number != independent_parameters_number)
394  //{
395  // buffer << "OpenNN Exception: PlugIn class.\n"
396  // << "void write_input_file_independent_parameters(void) const method.\n"
397  // << "Number of inputs flags must be equal to number of independent parameters.\n";
398 
399  // throw std::logic_error(buffer.str());
400  //}
401 
403 
404  //std::ifstream template_file(template_file_name.c_str());
405 
406  //if(!template_file.is_open())
407  //{
408  // buffer << "OpenNN Exception: PlugIn class.\n"
409  // << "void write_input_file_independent_parameters(void) const method.\n"
410  // << "Cannot open template file.\n";
411  //
412  // throw std::logic_error(buffer.str());
413  //}
414 
415  //std::string file_string;
416  //std::string line;
417 
418  //while(getline(template_file, line))
419  //{
420  // file_string += line;
421  // file_string += "\n";
422  //}
423 
424  //template_file.close();
425 
427 
428  //Vector<std::string> independent_parameters_string = independent_parameters.get_string_vector();
429 
431 
432  //for(size_t i = 0; i < input_flags_number; i++)
433  //{
434  // while(file_string.find(input_flags[i]) != std::string::npos)
435  // {
436  // size_t found = file_string.find(input_flags[i]);
437 
438  // if(found != std::string::npos)
439  // {
440  // file_string.replace(file_string.find(input_flags[i]), input_flags[i].length(), independent_parameters_string[i]);
441  // }
442  // }
443  //}
444 
446 
447  //std::ofstream input_file(input_file_name.c_str());
448  //
449  //if(!input_file.is_open())
450  //{
451  // buffer << "OpenNN Exception: PlugIn class.\n"
452  // << "void write_input_file(void) const method.\n"
453  // << "Cannot open inputs file.\n";
454  //
455  // throw std::logic_error(buffer.str());
456  //}
457 
458  //input_file << file_string << "\n";
459 
460  //input_file.close();
461 }
462 
463 
464 // void run_script(void) const
465 
467 
468 void PlugIn::run_script(void) const
469 {
470  if(!script_file_name.empty())
471  {
472  int ok = system(script_file_name.c_str());
473 
474  if(ok == 0)
475  {
476  // Error message
477  }
478  }
479  else
480  {
481  std::ostringstream buffer;
482 
483  buffer << "OpenNN Exception: PlugIn class.\n"
484  << "void run_script(void) const.\n"
485  << "Batch file_name is empty.\n";
486 
487  throw std::logic_error(buffer.str());
488  }
489 }
490 
491 
492 // Matrix<double> read_output_file(void) const method
493 
496 
498 {
500 
501  return(data);
502 }
503 
504 
505 // Matrix<double> read_output_file_header(void) const method
506 
509 
511 {
512  // Open outputs file for reading
513 
514  std::ifstream output_file(output_file_name.c_str());
515 
516  if(!output_file.is_open())
517  {
518  std::ostringstream buffer;
519 
520  buffer << "OpenNN Exception: PlugIn class.\n"
521  << "Matrix<double> read_output_file_header(void) const method.\n"
522  << "Cannot open outputs file.\n";
523 
524  throw std::logic_error(buffer.str());
525  }
526 
527  std::string header;
528  getline(output_file, header);
529 
530  Matrix<double> data;
531 
532  output_file >> data;
533 
534  output_file.close();
535 
536  return(data);
537 }
538 
539 
540 // Matrix<double> calculate_solutions(const NeuralNetwork&) const method
541 
550 
552 {
553  write_input_file(neural_network);
554 
555  run_script();
556 
557  return(read_output_file());
558 }
559 
560 
561 // std::string to_string(void) const method
562 
564 
565 std::string PlugIn::to_string(void) const
566 {
567  std::ostringstream buffer;
568 
569  buffer << "Plug-in\n"
570  << "Independent variables number: " << independent_variables_number << "\n"
571  << "Dependent variables number: " << dependent_variables_number << "\n"
572  << "Input method: " << input_method << "\n"
573  << "Template file_name: " << template_file_name << "\n"
574  << "Input file_name: " << input_file_name << "\n"
575  << "Script file_name: " << script_file_name << "\n"
576  << "Output file_name: " << output_file_name << "\n"
577  << "Input flags: " << input_flags << "\n"
578  << "Output rows number: " << output_rows_number << "\n"
579  << "Output columns number: " << output_columns_number << "\n"
580  << "Display: " << display << "\n";
581 
582  return(buffer.str());
583 }
584 
585 
586 // tinyxml2::XMLDocument* to_XML(void) const method
587 
590 
591 tinyxml2::XMLDocument* PlugIn::to_XML(void) const
592 {
593  tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument;
594 
595  std::ostringstream buffer;
596 
597  tinyxml2::XMLElement* plug_in_element = document->NewElement("PlugIn");
598 
599  document->InsertFirstChild(plug_in_element);
600 
601  // Independent variables number
602 
603  {
604  tinyxml2::XMLElement* independent_variables_number_element = document->NewElement("IndependentVariablesNumber");
605  plug_in_element->LinkEndChild(independent_variables_number_element);
606 
607  buffer.str("");
609 
610  tinyxml2::XMLText* independent_variables_number_text = document->NewText(buffer.str().c_str());
611  independent_variables_number_element->LinkEndChild(independent_variables_number_text);
612  }
613 
614  // Dependent variables number
615 
616  {
617  tinyxml2::XMLElement* dependent_variables_number_element = document->NewElement("DependentVariablesNumber");
618  plug_in_element->LinkEndChild(dependent_variables_number_element);
619 
620  buffer.str("");
621  buffer << dependent_variables_number;
622 
623  tinyxml2::XMLText* dependent_variables_number_text = document->NewText(buffer.str().c_str());
624  dependent_variables_number_element->LinkEndChild(dependent_variables_number_text);
625  }
626 
627  // Input method
628 
629  {
630  tinyxml2::XMLElement* input_method_element = document->NewElement("InputMethod");
631  plug_in_element->LinkEndChild(input_method_element);
632 
633  std::string input_method_name = write_input_method();
634 
635  tinyxml2::XMLText* input_method_text = document->NewText(input_method_name.c_str());
636  input_method_element->LinkEndChild(input_method_text);
637  }
638 
639  // Template file_name
640 
641  {
642  tinyxml2::XMLElement* template_file_name_element = document->NewElement("TemplateFileName");
643  plug_in_element->LinkEndChild(template_file_name_element);
644 
645  tinyxml2::XMLText* template_file_name_text = document->NewText(template_file_name.c_str());
646  template_file_name_element->LinkEndChild(template_file_name_text);
647  }
648 
649  // Input file_name
650 
651  {
652  tinyxml2::XMLElement* input_file_name_element = document->NewElement("InputFileName");
653  plug_in_element->LinkEndChild(input_file_name_element);
654 
655  tinyxml2::XMLText* input_file_name_text = document->NewText(input_file_name.c_str());
656  input_file_name_element->LinkEndChild(input_file_name_text);
657  }
658 
659  // Batch file_name
660 
661  {
662  tinyxml2::XMLElement* script_file_name_element = document->NewElement("BatchFileName");
663  plug_in_element->LinkEndChild(script_file_name_element);
664 
665  tinyxml2::XMLText* script_file_name_text = document->NewText(script_file_name.c_str());
666  script_file_name_element->LinkEndChild(script_file_name_text);
667  }
668 
669  // Output file_name
670 
671  {
672  tinyxml2::XMLElement* output_file_name_element = document->NewElement("OutputFileName");
673  plug_in_element->LinkEndChild(output_file_name_element);
674 
675  tinyxml2::XMLText* output_file_name_text = document->NewText(output_file_name.c_str());
676  output_file_name_element->LinkEndChild(output_file_name_text);
677  }
678 
679  // Input flags
680 
681  {
682  tinyxml2::XMLElement* input_flags_element = document->NewElement("InputFlags");
683  plug_in_element->LinkEndChild(input_flags_element);
684 
685  buffer.str("");
686  buffer << input_flags;
687 
688  tinyxml2::XMLText* input_flags_text = document->NewText(buffer.str().c_str());
689  input_flags_element->LinkEndChild(input_flags_text);
690  }
691 
692  // Output rows number
693 
694  {
695  tinyxml2::XMLElement* output_rows_number_element = document->NewElement("OutputRowsNumber");
696  plug_in_element->LinkEndChild(output_rows_number_element);
697 
698  buffer.str("");
699  buffer << output_rows_number;
700 
701  tinyxml2::XMLText* output_rows_number_text = document->NewText(buffer.str().c_str());
702  output_rows_number_element->LinkEndChild(output_rows_number_text);
703  }
704 
705  // Output columns number
706 
707  {
708  tinyxml2::XMLElement* output_columns_number_element = document->NewElement("OutputColumnsNumber");
709  plug_in_element->LinkEndChild(output_columns_number_element);
710 
711  buffer.str("");
712  buffer << output_columns_number;
713 
714  tinyxml2::XMLText* output_columns_number_text = document->NewText(buffer.str().c_str());
715  output_columns_number_element->LinkEndChild(output_columns_number_text);
716  }
717 
718  // Display
719 
720  {
721  tinyxml2::XMLElement* display_element = document->NewElement("Display");
722  plug_in_element->LinkEndChild(display_element);
723 
724  buffer.str("");
725  buffer << display;
726 
727  tinyxml2::XMLText* display_text = document->NewText(buffer.str().c_str());
728  display_element->LinkEndChild(display_text);
729  }
730 
731  return(document);
732 }
733 
734 
735 // void from_XML(const tinyxml2::XMLDocument&) method
736 
740 
741 void PlugIn::from_XML(const tinyxml2::XMLDocument& document)
742 {
743  // Independent variables number
744  {
745  const tinyxml2::XMLElement* element = document.FirstChildElement("IndependentVariablesNumber");
746 
747  if(element)
748  {
749  const char* text = element->GetText();
750 
751  if(text)
752  {
753  try
754  {
756  }
757  catch(const std::logic_error& e)
758  {
759  std::cout << e.what() << std::endl;
760  }
761  }
762  }
763  }
764 
765  // Dependent variables number
766  {
767  const tinyxml2::XMLElement* element = document.FirstChildElement("DependentVariablesNumber");
768 
769  if(element)
770  {
771  const char* text = element->GetText();
772 
773  if(text)
774  {
775  try
776  {
777  set_dependent_variables_number(atoi(text));
778  }
779  catch(const std::logic_error& e)
780  {
781  std::cout << e.what() << std::endl;
782  }
783  }
784  }
785  }
786 
787  // Input method
788  {
789  const tinyxml2::XMLElement* input_method_element = document.FirstChildElement("InputMethod");
790 
791  if(input_method_element)
792  {
793  const char* input_method_text = input_method_element->GetText();
794 
795  if(input_method_text)
796  {
797  try
798  {
799  set_input_method(input_method_text);
800  }
801  catch(const std::logic_error& e)
802  {
803  std::cout << e.what() << std::endl;
804  }
805  }
806  }
807  }
808 
809  // Template file_name
810  {
811  const tinyxml2::XMLElement* template_file_name_element = document.FirstChildElement("TemplateFileName");
812 
813  if(template_file_name_element)
814  {
815  const char* template_file_name_text = template_file_name_element->GetText();
816 
817  if(template_file_name_text)
818  {
819  try
820  {
821  set_template_file_name(template_file_name_text);
822  }
823  catch(const std::logic_error& e)
824  {
825  std::cout << e.what() << std::endl;
826  }
827  }
828  }
829  }
830 
831  // Input file_name
832  {
833  const tinyxml2::XMLElement* input_file_name_element = document.FirstChildElement("InputFileName");
834 
835  if(input_file_name_element)
836  {
837  const char* input_file_name_text = input_file_name_element->GetText();
838 
839  if(input_file_name_text)
840  {
841  try
842  {
843  set_input_file_name(input_file_name_text);
844  }
845  catch(const std::logic_error& e)
846  {
847  std::cout << e.what() << std::endl;
848  }
849  }
850  }
851  }
852 
853  // Batch file_name
854  {
855  const tinyxml2::XMLElement* script_file_name_element = document.FirstChildElement("BatchFileName");
856 
857  if(script_file_name_element)
858  {
859  const char* script_file_name_text = script_file_name_element->GetText();
860 
861  if(script_file_name_text)
862  {
863  try
864  {
865  set_script_file_name(script_file_name_text);
866  }
867  catch(const std::logic_error& e)
868  {
869  std::cout << e.what() << std::endl;
870  }
871  }
872  }
873  }
874 
875  // Output file_name
876  {
877  const tinyxml2::XMLElement* output_file_name_element = document.FirstChildElement("OutputFileName");
878 
879  if(output_file_name_element)
880  {
881  const char* output_file_name_text = output_file_name_element->GetText();
882 
883  if(output_file_name_text)
884  {
885  try
886  {
887  set_output_file_name(output_file_name_text);
888  }
889  catch(const std::logic_error& e)
890  {
891  std::cout << e.what() << std::endl;
892  }
893  }
894  }
895  }
896 /*
897  // Input flags
898  {
899  tinyxml2::XMLElement* input_flags_element = document->FirstChildElement("InputFlags");
900 
901  if(input_flags_element)
902  {
903  const char* input_flags_text = input_flags_element->GetText();
904 
905  if(input_flags_text)
906  {
907  Vector<std::string> new_input_flags;
908  new_input_flags.parse(input_flags_text);
909 
910  try
911  {
912  set_input_flags(new_input_flags);
913  }
914  catch(const std::logic_error& e)
915  {
916  std::cout << e.what() << std::endl;
917  }
918  }
919  }
920  }
921 */
922  // Display
923  {
924  const tinyxml2::XMLElement* display_element = document.FirstChildElement("Display");
925 
926  if(display_element)
927  {
928  const char* display_text = display_element->GetText();
929 
930  if(display_text)
931  {
932  try
933  {
934  std::string display_string(display_text);
935 
936  set_display(display_string != "0");
937  }
938  catch(const std::logic_error& e)
939  {
940  std::cout << e.what() << std::endl;
941  }
942  }
943  }
944  }
945 }
946 
947 }
948 
949 // OpenNN: Open Neural Networks Library.
950 // Copyright (c) 2005-2015 Roberto Lopez.
951 //
952 // This library is free software; you can redistribute it and/or
953 // modify it under the terms of the GNU Lesser General Public
954 // License as published by the Free Software Foundation; either
955 // version 2.1 of the License, or any later version.
956 //
957 // This library is distributed in the hope that it will be useful,
958 // but WITHOUT ANY WARRANTY; without even the implied warranty of
959 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
960 // Lesser General Public License for more details.
961 
962 // You should have received a copy of the GNU Lesser General Public
963 // License along with this library; if not, write to the Free Software
964 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
void set_script_file_name(const std::string &)
Definition: plug_in.cpp:304
void set_input_file_name(const std::string &)
Definition: plug_in.cpp:293
const std::string & get_output_file_name(void) const
Returns the name of the output file.
Definition: plug_in.cpp:189
const std::string & get_input_file_name(void) const
Returns the name of the input file.
Definition: plug_in.cpp:169
InputMethod input_method
Type of data to be entered in the mathematical model.
Definition: plug_in.h:131
size_t output_columns_number
Number of columns in the output file.
Definition: plug_in.h:159
const InputMethod & get_input_method(void) const
Returns the method for including the information into the input file.
Definition: plug_in.cpp:120
const Vector< double > & get_parameters(void) const
Returns the values of the independent parameters.
const std::string & get_input_flag(const size_t &) const
Definition: plug_in.cpp:210
InputMethod
Enumeration of available methods for introducing neural network data into the input file...
Definition: plug_in.h:61
void set_input_flags(const Vector< std::string > &)
Definition: plug_in.cpp:326
const std::string & get_script_file_name(void) const
Returns the name of the script file.
Definition: plug_in.cpp:179
void write_input_file(const NeuralNetwork &) const
Definition: plug_in.cpp:337
const std::string & get_template_file_name(void) const
Returns the name of the template file.
Definition: plug_in.cpp:159
bool operator==(const PlugIn &) const
Definition: plug_in.cpp:94
Matrix< double > read_output_file_header(void) const
Definition: plug_in.cpp:510
void write_input_file_independent_parameters(const NeuralNetwork &) const
Definition: plug_in.cpp:366
virtual ~PlugIn(void)
Definition: plug_in.cpp:49
PlugIn(void)
Definition: plug_in.cpp:26
std::string write_input_method(void) const
Returns a string with the name of the method for including the information into the input file...
Definition: plug_in.cpp:130
std::string output_file_name
Name of output file.
Definition: plug_in.h:147
std::string script_file_name
Name of script file.
Definition: plug_in.h:143
size_t dependent_variables_number
Number of dependent variables defining the mathematical model.
bool display
Flag for displaying warnings.
std::string template_file_name
Name of template file.
Definition: plug_in.h:135
void set_dependent_variables_number(const size_t &)
void set_output_file_name(const std::string &)
Definition: plug_in.cpp:315
Matrix< double > calculate_solutions(const NeuralNetwork &) const
Definition: plug_in.cpp:551
Vector< std::string > input_flags
Vector of flags in the input file.
Definition: plug_in.h:151
IndependentParameters * get_independent_parameters_pointer(void) const
Returns a pointer to the independent parameters object composing this neural network.
const Vector< std::string > & get_input_flags(void) const
Returns the vector of input file flags.
Definition: plug_in.cpp:199
void set_input_method(const InputMethod &)
Definition: plug_in.cpp:247
std::string to_string(void) const
Returns a string representation of the current plug-in object.
Definition: plug_in.cpp:565
std::string input_file_name
Name of input file.
Definition: plug_in.h:139
Matrix< double > read_output_file(void) const
Definition: plug_in.cpp:497
size_t independent_variables_number
Number of independent variables defining the mathematical model.
size_t output_rows_number
Number of rows in the output file.
Definition: plug_in.h:155
PlugIn & operator=(const PlugIn &)
Definition: plug_in.cpp:62
void set_default(void)
Definition: plug_in.cpp:227
tinyxml2::XMLDocument * to_XML(void) const
Definition: plug_in.cpp:591
void from_XML(const tinyxml2::XMLDocument &)
Definition: plug_in.cpp:741
void set_template_file_name(const std::string &)
Definition: plug_in.cpp:282
void set_independent_variables_number(const size_t &)
void run_script(void) const
This method runs the script needed for executing the mathematical model.
Definition: plug_in.cpp:468