NeurApp 1.1
NeurApp - software for exploring approximation by artificial neural networks on functions of one or two variables.
|
File manager for neural network approximation file client and server. More...
Public Member Functions | |
NeuraApproximationFileManager (string directoryPath) | |
Nonstruct a new file manager for neural approximation file client/server that operates in the specified directory. | |
string | GetPath (string fileOrDirectoryName) |
Returns full path of the file or directory with the specified relative path within the data directory of the current file server/client. | |
void | SetNeuralBusy () |
Sets the falg that indicates that the approximation server is busy. | |
void | ClearNeuralBusy () |
Clears the falg that indicates that the approximation server is busy. | |
bool | IsNeuralBusy () |
Returns value of the falg that indicates whether the approximation server is busy. | |
void | SetNeuralInputReady () |
Sets the falg that indicates that the approximation input data is ready. | |
void | ClearNeuralInputReady () |
Clears the falg that indicates that the approximation input data is ready. | |
bool | IsNeuralInputReady () |
Returns value of the falg that indicates whether the approximation input data is ready. | |
void | SetNeuralOutputReady () |
Sets the falg that indicates that the approximation output data is ready. | |
void | ClearNeuralOutputReady () |
Clears the falg that indicates that the approximation output data is ready. | |
bool | IsNeuralOutputReady () |
Returns value of the falg that indicates whether the approximation output data is ready. | |
void | ClearMessages () |
Clears all messages for neural approximation client and server. | |
virtual void | ReadNeuralInput (ref IVector inputParameters) |
Reads neural approximator input parameters form the file at standard location. | |
virtual void | WriteNeuralInput (IVector inputParameters) |
Writes neural approximator input parameters to standard location. | |
virtual void | ReadNeuralOutput (ref IVector outputValues) |
Reads neural approximator output values from the file at standard location. | |
virtual void | WriteNeuralOutput (IVector outputValues) |
Writes neural approximator outut values to the file at standard location. | |
virtual void | LoadNeuralNetwork (ref INeuralApproximator trainedNetwork) |
Loads the trained neural network approximator from the file at standard location. | |
virtual void | ClientWriteNeuralInput (IVector inputParameters) |
Client writes input parameters for calculation of neural network based approximated values. Messages are set nad clears appropriately. | |
virtual void | ClientReadNeuralOutput (ref IVector outputValues) |
Client reads the results of neural network-based approximation (output values). Messages are set and clears appropriately. | |
virtual void | ClientSendRequestCalculateApproximation () |
Performs request to the server for calculation of neural network based approximated values. | |
virtual void | ClientCalculateApproximation (IVector inputParameters, ref IVector outputValues) |
Calculates approximation by using the neural network approximation server. | |
virtual void | ClientTestCalculateApproximation (string inputFilePath, string outputFilePath) |
Performs client-side test calculation of neural network based approximation where input parameters are read from a specified JSON file, and calculated output values are written to the specified file. | |
virtual void | ServerCalculateApproximation () |
Performs neural network-based approximation at prescribed input parameters and saves results. Messages are set and cleared appropriately. This method read input parameters from standard location, loads trained neural network, calculates approximated outpur values and stores them to the standard location. | |
Protected Attributes | |
string | _dataDirectory = null |
Properties | |
object | Lock [get] |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. | |
object | InternalLock [get] |
Used internally for locking access to internal fields. | |
string | DataDirectory [get, set] |
Directory for data and messages exchange through files. | |
string | NeuralNetworkPath [get, set] |
File path of the file where complete (usually trained) neural network is stored. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | NeuralDataDefinitionPath [get, set] |
File path of the input and output data definition file. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | SimulationDataDefinitionPath [get, set] |
File path of the input and output data definition file for simulator. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | NeuralVerificationDataPath [get, set] |
File path of the verification data file. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | NeuralTrainingDataPath [get, set] |
File path of the training data file. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | NeuralInputPath [get, set] |
File path of the file with input parameters. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | NeuralInputXmlPath [get, set] |
File path of the input parameters file in XML format. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | NeuralOutputPath [get, set] |
File path of the file for storing approximated output values. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | NeuralOutputeXmlPath [get, set] |
File path of the file for storing approximated output values in XML format. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | MsgNeuralBusyPath [get, set] |
File path of the message file indicating that approximator is busy by performing a job. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | MsgNeuralInputReadyPath [get, set] |
File path of the message file indicating taht input data is ready to be processed. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
string | MsgNeuralOutputReadyPath [get, set] |
File path of the message file indicating that the approximated output is ready to be read. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. | |
Private Member Functions | |
NeuraApproximationFileManager () | |
Private Attributes | |
object | _mainLock = new object() |
object | _internalLock = new object() |
string | _LockFileMutex = NeuralFileConst.LockFileMutex |
string | _neuralNetworkFilename = NeuralFileConst.NeuralNetworkFilename |
string | _neuralNetworkPath = null |
string | _neuralDataDefinitionFilename = NeuralFileConst.NeuralDataDefinitionFilename |
string | _neuralDataDefinitionPath = null |
string | _simulationDataDefinitionFilename = NeuralFileConst.SimulationDataDefinitionFilename |
string | _simulationDataDefinitionPath = null |
string | _neuralTrainingDataFilename = NeuralFileConst.NeuralTrainingDataFilename |
string | _neuralTrainingDataPath = null |
string | _neuralVerificationDataFilename = NeuralFileConst.NeuralVerificationDataFilename |
string | _neuralVerificationDataPath = null |
string | _neuralInputFilename = NeuralFileConst.NeuralInputFilename |
string | _neuralInputPath = null |
string | _neuralInputXmlFilename = NeuralFileConst.NeuralInputXmlFilename |
string | _neuralInputXmlPath = null |
string | _neuralOutputFilename = NeuralFileConst.NeuralOutputFilename |
string | _neuralOutputPath = null |
string | _neuralOutputXmlFilename = NeuralFileConst.NeuralOutputeXmlFilename |
string | _neuralOutputXmlPath = null |
string | _msgNeuralBusyFilename = NeuralFileConst.MsgNeuralBusyFilename |
string | _msgNeuralBusyPath = null |
string | _msgNeuralInputReadyFilename = NeuralFileConst.MsgNeuralInputReadyFilename |
string | _msgNeuralInputReadyPath = null |
string | _msgNeuralOutputReadyFilename = NeuralFileConst.MsgNeuralOutputReadyFilename |
string | _msgNeuralOutputReadyPath = null |
File manager for neural network approximation file client and server.
This class is modelled after the DragonFly optimization server. $A Igor Apr11;
IG::Neural::NeuraApproximationFileManager::NeuraApproximationFileManager | ( | ) | [inline, private] |
IG::Neural::NeuraApproximationFileManager::NeuraApproximationFileManager | ( | string | directoryPath | ) | [inline] |
Nonstruct a new file manager for neural approximation file client/server that operates in the specified directory.
directoryPath | Operation directory for data & message exchange through files. |
string IG::Neural::NeuraApproximationFileManager::GetPath | ( | string | fileOrDirectoryName | ) | [inline] |
Returns full path of the file or directory with the specified relative path within the data directory of the current file server/client.
fileOrDirectoryName | Relative path (with respect to data and messages exchange directory) |
void IG::Neural::NeuraApproximationFileManager::SetNeuralBusy | ( | ) | [inline] |
Sets the falg that indicates that the approximation server is busy.
void IG::Neural::NeuraApproximationFileManager::ClearNeuralBusy | ( | ) | [inline] |
Clears the falg that indicates that the approximation server is busy.
bool IG::Neural::NeuraApproximationFileManager::IsNeuralBusy | ( | ) | [inline] |
Returns value of the falg that indicates whether the approximation server is busy.
void IG::Neural::NeuraApproximationFileManager::SetNeuralInputReady | ( | ) | [inline] |
Sets the falg that indicates that the approximation input data is ready.
void IG::Neural::NeuraApproximationFileManager::ClearNeuralInputReady | ( | ) | [inline] |
Clears the falg that indicates that the approximation input data is ready.
bool IG::Neural::NeuraApproximationFileManager::IsNeuralInputReady | ( | ) | [inline] |
Returns value of the falg that indicates whether the approximation input data is ready.
void IG::Neural::NeuraApproximationFileManager::SetNeuralOutputReady | ( | ) | [inline] |
Sets the falg that indicates that the approximation output data is ready.
void IG::Neural::NeuraApproximationFileManager::ClearNeuralOutputReady | ( | ) | [inline] |
Clears the falg that indicates that the approximation output data is ready.
bool IG::Neural::NeuraApproximationFileManager::IsNeuralOutputReady | ( | ) | [inline] |
Returns value of the falg that indicates whether the approximation output data is ready.
void IG::Neural::NeuraApproximationFileManager::ClearMessages | ( | ) | [inline] |
Clears all messages for neural approximation client and server.
Reimplemented in IG::Neural::MappingApproximationFileManager.
virtual void IG::Neural::NeuraApproximationFileManager::ReadNeuralInput | ( | ref IVector | inputParameters | ) | [inline, virtual] |
Reads neural approximator input parameters form the file at standard location.
inputParameters | Object where parameters are stored. |
virtual void IG::Neural::NeuraApproximationFileManager::WriteNeuralInput | ( | IVector | inputParameters | ) | [inline, virtual] |
Writes neural approximator input parameters to standard location.
inputParameters | Parameters to be written. |
virtual void IG::Neural::NeuraApproximationFileManager::ReadNeuralOutput | ( | ref IVector | outputValues | ) | [inline, virtual] |
Reads neural approximator output values from the file at standard location.
outputValues | Object where the read outut values are stored. |
virtual void IG::Neural::NeuraApproximationFileManager::WriteNeuralOutput | ( | IVector | outputValues | ) | [inline, virtual] |
Writes neural approximator outut values to the file at standard location.
outputValues | Output values that are written. |
virtual void IG::Neural::NeuraApproximationFileManager::LoadNeuralNetwork | ( | ref INeuralApproximator | trainedNetwork | ) | [inline, virtual] |
Loads the trained neural network approximator from the file at standard location.
trainedNetwork | Object where the loaded neural network approximator is stored. |
virtual void IG::Neural::NeuraApproximationFileManager::ClientWriteNeuralInput | ( | IVector | inputParameters | ) | [inline, virtual] |
Client writes input parameters for calculation of neural network based approximated values. Messages are set nad clears appropriately.
inputParameters | Parameters to be written. |
virtual void IG::Neural::NeuraApproximationFileManager::ClientReadNeuralOutput | ( | ref IVector | outputValues | ) | [inline, virtual] |
Client reads the results of neural network-based approximation (output values). Messages are set and clears appropriately.
outputValues |
virtual void IG::Neural::NeuraApproximationFileManager::ClientSendRequestCalculateApproximation | ( | ) | [inline, virtual] |
Performs request to the server for calculation of neural network based approximated values.
virtual void IG::Neural::NeuraApproximationFileManager::ClientCalculateApproximation | ( | IVector | inputParameters, |
ref IVector | outputValues | ||
) | [inline, virtual] |
Calculates approximation by using the neural network approximation server.
inputParameters | Intput parameters for which approximation is calculated. |
outputValues | Vector where approximation output values are stored. |
virtual void IG::Neural::NeuraApproximationFileManager::ClientTestCalculateApproximation | ( | string | inputFilePath, |
string | outputFilePath | ||
) | [inline, virtual] |
Performs client-side test calculation of neural network based approximation where input parameters are read from a specified JSON file, and calculated output values are written to the specified file.
inputFilePath | Path to the JSON file where input parameters are read from. The file pointed at must exist. |
outputFilePath | Path of a file where the calculated approximated values are written to. It can be null or empty string, in this case parameters are not written to a file (but they are still output on console). |
virtual void IG::Neural::NeuraApproximationFileManager::ServerCalculateApproximation | ( | ) | [inline, virtual] |
Performs neural network-based approximation at prescribed input parameters and saves results. Messages are set and cleared appropriately. This method read input parameters from standard location, loads trained neural network, calculates approximated outpur values and stores them to the standard location.
object IG::Neural::NeuraApproximationFileManager::_mainLock = new object() [private] |
object IG::Neural::NeuraApproximationFileManager::_internalLock = new object() [private] |
string IG::Neural::NeuraApproximationFileManager::_dataDirectory = null [protected] |
string IG::Neural::NeuraApproximationFileManager::_LockFileMutex = NeuralFileConst.LockFileMutex [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralNetworkFilename = NeuralFileConst.NeuralNetworkFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralNetworkPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralDataDefinitionFilename = NeuralFileConst.NeuralDataDefinitionFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralDataDefinitionPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_simulationDataDefinitionFilename = NeuralFileConst.SimulationDataDefinitionFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_simulationDataDefinitionPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralTrainingDataFilename = NeuralFileConst.NeuralTrainingDataFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralTrainingDataPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralVerificationDataFilename = NeuralFileConst.NeuralVerificationDataFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralVerificationDataPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralInputFilename = NeuralFileConst.NeuralInputFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralInputPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralInputXmlFilename = NeuralFileConst.NeuralInputXmlFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralInputXmlPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralOutputFilename = NeuralFileConst.NeuralOutputFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralOutputPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralOutputXmlFilename = NeuralFileConst.NeuralOutputeXmlFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_neuralOutputXmlPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_msgNeuralBusyFilename = NeuralFileConst.MsgNeuralBusyFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_msgNeuralBusyPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_msgNeuralInputReadyFilename = NeuralFileConst.MsgNeuralInputReadyFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_msgNeuralInputReadyPath = null [private] |
string IG::Neural::NeuraApproximationFileManager::_msgNeuralOutputReadyFilename = NeuralFileConst.MsgNeuralOutputReadyFilename [private] |
string IG::Neural::NeuraApproximationFileManager::_msgNeuralOutputReadyPath = null [private] |
object IG::Neural::NeuraApproximationFileManager::Lock [get] |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.
object IG::Neural::NeuraApproximationFileManager::InternalLock [get, protected] |
Used internally for locking access to internal fields.
string IG::Neural::NeuraApproximationFileManager::DataDirectory [get, set] |
Directory for data and messages exchange through files.
string IG::Neural::NeuraApproximationFileManager::NeuralNetworkPath [get, set] |
File path of the file where complete (usually trained) neural network is stored. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::NeuralDataDefinitionPath [get, set] |
File path of the input and output data definition file. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::SimulationDataDefinitionPath [get, set] |
File path of the input and output data definition file for simulator. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::NeuralVerificationDataPath [get, set] |
File path of the verification data file. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::NeuralTrainingDataPath [get, set] |
File path of the training data file. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::NeuralInputPath [get, set] |
File path of the file with input parameters. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::NeuralInputXmlPath [get, set] |
File path of the input parameters file in XML format. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::NeuralOutputPath [get, set] |
File path of the file for storing approximated output values. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::NeuralOutputeXmlPath [get, set] |
File path of the file for storing approximated output values in XML format. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::MsgNeuralBusyPath [get, set] |
File path of the message file indicating that approximator is busy by performing a job. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::MsgNeuralInputReadyPath [get, set] |
File path of the message file indicating taht input data is ready to be processed. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.
string IG::Neural::NeuraApproximationFileManager::MsgNeuralOutputReadyPath [get, set] |
File path of the message file indicating that the approximated output is ready to be read. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called.