OpenNN::PlugIn Class Reference

#include <plug_in.h>

Inheritance diagram for OpenNN::PlugIn:

OpenNN::MathematicalModel

List of all members.

Public Types

enum  InputMethod { IndependentParametersInput }

Public Member Functions

 PlugIn (void)
 PlugIn (TiXmlElement *)
virtual ~PlugIn (void)
PlugInoperator= (const PlugIn &)
bool operator== (const PlugIn &) const
const InputMethodget_input_method (void) const
std::string write_input_method (void) const
const std::string & get_template_filename (void) const
const std::string & get_input_filename (void) const
const std::string & get_script_filename (void) const
const std::string & get_output_filename (void) const
const Vector< std::string > & get_input_flags (void) const
const std::string & get_input_flag (const unsigned int &) const
void set_default (void)
void set_input_method (const InputMethod &)
void set_input_method (const std::string &)
void set_template_filename (const std::string &)
void set_input_filename (const std::string &)
void set_script_filename (const std::string &)
void set_output_filename (const std::string &)
void set_input_flags (const Vector< std::string > &)
void write_input_file (const NeuralNetwork &) const
void write_input_file_independent_parameters (const NeuralNetwork &) const
void run_script (void) const
Matrix< double > read_output_file (void) const
Matrix< double > read_output_file_header (void) const
Matrix< double > calculate_solutions (const NeuralNetwork &) const
std::string to_string (void) const
TiXmlElement * to_XML (void) const
void from_XML (TiXmlElement *)


Detailed Description

This method represents an external mathematical model which communicates with OpenNN by means of input and output files.

Definition at line 35 of file plug_in.h.


Member Enumeration Documentation

Enumeration of available methods for introducing neural network data into the input file.

Definition at line 56 of file plug_in.h.


Constructor & Destructor Documentation

OpenNN::PlugIn::PlugIn ( void   )  [explicit]

Default constructor. It constructs a default plug-in object, with zero independent and dependent variables.

Definition at line 42 of file plug_in.cpp.

OpenNN::PlugIn::PlugIn ( TiXmlElement *  plug_in_element  )  [explicit]

XML constructor. It creates a plug-in and loads its members from a Tiny XML element.

Parameters:
plug_in_element Pointer to a XML element containing the plug-in members.

Definition at line 54 of file plug_in.cpp.

OpenNN::PlugIn::~PlugIn ( void   )  [virtual]

Destructor. It does not delete any object.

Definition at line 65 of file plug_in.cpp.


Member Function Documentation

PlugIn & OpenNN::PlugIn::operator= ( const PlugIn other_plug_in  ) 

Assignment operator. It assigns to this object the members of an existing plug-in object.

Parameters:
other_plug_in Plug-in object to be assigned.

Definition at line 78 of file plug_in.cpp.

bool OpenNN::PlugIn::operator== ( const PlugIn other_plug_in  )  const

Equal to operator. It compares this object with another object of the same class. It returns true if the members of the two objects have the same values, and false otherwise. @ param other_plug_in Plug-in to be compared with.

Definition at line 110 of file plug_in.cpp.

const PlugIn::InputMethod & OpenNN::PlugIn::get_input_method ( void   )  const

This method returns the method for including the information into the input file.

Definition at line 136 of file plug_in.cpp.

std::string OpenNN::PlugIn::write_input_method ( void   )  const

This method returns a string with the name of the method for including the information into the input file.

Definition at line 146 of file plug_in.cpp.

const std::string & OpenNN::PlugIn::get_template_filename ( void   )  const

This method returns the name of the template file.

Definition at line 175 of file plug_in.cpp.

const std::string & OpenNN::PlugIn::get_input_filename ( void   )  const

This method returns the name of the input file.

Definition at line 185 of file plug_in.cpp.

const std::string & OpenNN::PlugIn::get_script_filename ( void   )  const

This method returns the name of the script file.

Definition at line 195 of file plug_in.cpp.

const std::string & OpenNN::PlugIn::get_output_filename ( void   )  const

This method returns the name of the output file.

Definition at line 205 of file plug_in.cpp.

const Vector< std::string > & OpenNN::PlugIn::get_input_flags ( void   )  const

This method returns the vector of input file flags.

Definition at line 215 of file plug_in.cpp.

const std::string & OpenNN::PlugIn::get_input_flag ( const unsigned int &  i  )  const

This method returns a single input file flag.

Parameters:
i Index of flag.

Definition at line 226 of file plug_in.cpp.

void OpenNN::PlugIn::set_default ( void   )  [virtual]

This method sets the following default values in this object:

  • Input method: Independent parameters input.
  • Input filename: input.dat.
  • Script filename: batch.bat.
  • Output filename: output.dat.
  • Display: true.

Reimplemented from OpenNN::MathematicalModel.

Definition at line 243 of file plug_in.cpp.

void OpenNN::PlugIn::set_input_method ( const InputMethod new_input_method  ) 

This method sets the method for writting the input file.

Parameters:
new_input_method Method for inputing the input file.

Definition at line 263 of file plug_in.cpp.

void OpenNN::PlugIn::set_input_method ( const std::string &  new_input_method  ) 

This method sets the method for writting the input file from a string.

Parameters:
new_input_method Method for inputing the input file.

Definition at line 274 of file plug_in.cpp.

void OpenNN::PlugIn::set_template_filename ( const std::string &  new_template_filename  ) 

This method sets the name of the template file.

Parameters:
new_template_filename Name of template file.

Definition at line 298 of file plug_in.cpp.

void OpenNN::PlugIn::set_input_filename ( const std::string &  new_input_filename  ) 

This method sets the name of the input file.

Parameters:
new_input_filename Name of input file.

Definition at line 309 of file plug_in.cpp.

void OpenNN::PlugIn::set_script_filename ( const std::string &  new_script_filename  ) 

This method sets the name of the script file.

Parameters:
new_script_filename Name of script file.

Definition at line 320 of file plug_in.cpp.

void OpenNN::PlugIn::set_output_filename ( const std::string &  new_output_filename  ) 

This method sets the name of the output file.

Parameters:
new_output_filename Name of output file.

Definition at line 331 of file plug_in.cpp.

void OpenNN::PlugIn::set_input_flags ( const Vector< std::string > &  new_input_flags  ) 

This method sets the flags in the input file.

Parameters:
new_input_flags Flags strings.

Definition at line 342 of file plug_in.cpp.

void OpenNN::PlugIn::write_input_file ( const NeuralNetwork neural_network  )  const

Thise method writes the input file with values obtained from the neural network.

Parameters:
neural_network Neural network.

Definition at line 353 of file plug_in.cpp.

void OpenNN::PlugIn::write_input_file_independent_parameters ( const NeuralNetwork neural_network  )  const

Todo:

Definition at line 382 of file plug_in.cpp.

void OpenNN::PlugIn::run_script ( void   )  const

This method runs the script needed for executing the mathematical model.

Definition at line 484 of file plug_in.cpp.

Matrix< double > OpenNN::PlugIn::read_output_file ( void   )  const

This method reads the output file from the mathematical model. Here the output file only contains a data matrix.

Definition at line 508 of file plug_in.cpp.

Matrix< double > OpenNN::PlugIn::read_output_file_header ( void   )  const

This method reads the output file from the mathematical model. Here the output file contains a header file and a data matrix.

Definition at line 521 of file plug_in.cpp.

Matrix< double > OpenNN::PlugIn::calculate_solutions ( const NeuralNetwork neural_network  )  const [virtual]

This method returns the solutions to the mathematical model. which are given by the independent and the dependent variables. The process is as follows:

  • Write input file.
  • Run script.
  • Read output file.

Reimplemented from OpenNN::MathematicalModel.

Definition at line 562 of file plug_in.cpp.

std::string OpenNN::PlugIn::to_string ( void   )  const [virtual]

This method returns a string representation of the current plug-in object.

Reimplemented from OpenNN::MathematicalModel.

Definition at line 576 of file plug_in.cpp.

TiXmlElement * OpenNN::PlugIn::to_XML ( void   )  const [virtual]

This method serializes the plug-in object into a XML element of the TinyXML library. See the OpenNN manual for more information about the format of this element.

Reimplemented from OpenNN::MathematicalModel.

Definition at line 602 of file plug_in.cpp.

void OpenNN::PlugIn::from_XML ( TiXmlElement *  plug_in_element  )  [virtual]

This method deserializes a TinyXML element into this plug-in object.

Parameters:
plug_in_element Pointer to a XML element containing the member data.
Todo:

Reimplemented from OpenNN::MathematicalModel.

Definition at line 749 of file plug_in.cpp.


The documentation for this class was generated from the following files:

Generated on Sun Aug 26 11:58:17 2012 for OpenNN by  doxygen 1.5.9