| IGLib 1.7.2 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Attributes | Properties | Private Member Functions | Private Attributes | List of all members
IG.Neural.NeuraApproximationFileManager Class Reference

File manager for neural network approximation file client and server. More...

Inheritance diagram for IG.Neural.NeuraApproximationFileManager:
[legend]
Collaboration diagram for IG.Neural.NeuraApproximationFileManager:
[legend]

## Public Member Functions
| NeuraApproximationFileManager (string directoryPath)
| Nonstruct a new file manager for neural approximation file client/server that operates in the specified directory. More...
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. More...
void | SetNeuralBusy ()
| Sets the falg that indicates that the approximation server is busy. More...
void | ClearNeuralBusy ()
| Clears the falg that indicates that the approximation server is busy. More...
bool | IsNeuralBusy ()
| Returns value of the falg that indicates whether the approximation server is busy. More...
void | SetNeuralInputReady ()
| Sets the falg that indicates that the approximation input data is ready. More...
void | ClearNeuralInputReady ()
| Clears the falg that indicates that the approximation input data is ready. More...
bool | IsNeuralInputReady ()
| Returns value of the falg that indicates whether the approximation input data is ready. More...
void | SetNeuralOutputReady ()
| Sets the falg that indicates that the approximation output data is ready. More...
void | ClearNeuralOutputReady ()
| Clears the falg that indicates that the approximation output data is ready. More...
bool | IsNeuralOutputReady ()
| Returns value of the falg that indicates whether the approximation output data is ready. More...
void | ClearMessages ()
| Clears all messages for neural approximation client and server. More...
virtual void | ReadNeuralInput (ref IVector inputParameters)
| Reads neural approximator input parameters form the file at standard location. More...
virtual void | WriteNeuralInput (IVector inputParameters)
| Writes neural approximator input parameters to standard location. More...
virtual void | ReadNeuralOutput (ref IVector outputValues)
| Reads neural approximator output values from the file at standard location. More...
virtual void | WriteNeuralOutput (IVector outputValues)
| Writes neural approximator outut values to the file at standard location. More...
virtual void | LoadNeuralNetwork (ref INeuralApproximator trainedNetwork)
| Loads the trained neural network approximator from the file at standard location. More...
virtual void | ClientWriteNeuralInput (IVector inputParameters)
| Client writes input parameters for calculation of neural network based approximated values. Messages are set nad clears appropriately. More...
virtual void | ClientReadNeuralOutput (ref IVector outputValues)
| Client reads the results of neural network-based approximation (output values). Messages are set and clears appropriately. More...
virtual void | ClientSendRequestCalculateApproximation ()
| Performs request to the server for calculation of neural network based approximated values. More...
virtual void | ClientCalculateApproximation (IVector inputParameters, ref IVector outputValues)
| Calculates approximation by using the neural network approximation server. More...
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. More...
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. More...

## 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. More...
object | InternalLock`[get]`
| Used internally for locking access to internal fields. More...
string | DataDirectory`[get, protected set]`
| Directory for data and messages exchange through files. More...
string | NeuralNetworkPath`[get, protected 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. More...
string | NeuralDataDefinitionPath`[get, protected 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. More...
string | SimulationDataDefinitionPath`[get, protected 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. More...
string | NeuralVerificationDataPath`[get, protected 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. More...
string | NeuralTrainingDataPath`[get, protected 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. More...
string | NeuralInputPath`[get, protected 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. More...
string | NeuralInputXmlPath`[get, protected 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. More...
string | NeuralOutputPath`[get, protected 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. More...
string | NeuralOutputeXmlPath`[get, protected 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. More...
string | MsgNeuralBusyPath`[get, protected 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. More...
string | MsgNeuralInputReadyPath`[get, protected 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. More...
string | MsgNeuralOutputReadyPath`[get, protected 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. More...
Properties inherited from IG.Lib.ILockable
object | Lock`[get]`

## Private Member Functions
| NeuraApproximationFileManager ()

## Private Attributes
object | _mainLock = new object()
object | _internalLock = new object()
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

## Detailed Description

File manager for neural network approximation file client and server.

This class is modelled after the DragonFly optimization server.

$A Igor Apr11;

## Constructor & Destructor Documentation

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.

Parameters

  directoryPath | Operation directory for data and message exchange through files.

## Member Function Documentation

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.

Parameters

  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.

Referenced by IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateApproximationServer(), and IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateMappingApproximationServer().

void IG.Neural.NeuraApproximationFileManager.ClearNeuralBusy | ( |  | ) |
| inline

Clears the falg that indicates that the approximation server is busy.

Referenced by IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateApproximationServer(), and IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateMappingApproximationServer().

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.

Referenced by IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateApproximationServer(), and IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateMappingApproximationServer().

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.

Referenced by IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateApproximationServer(), and IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateMappingApproximationServer().

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.

virtual void IG.Neural.NeuraApproximationFileManager.ReadNeuralInput | ( | ref IVector | inputParameters | ) |
| inline virtual

Reads neural approximator input parameters form the file at standard location.

Parameters

  inputParameters | Object where parameters are stored.

References IG.Num.VectorBase.LoadJson().

virtual void IG.Neural.NeuraApproximationFileManager.WriteNeuralInput | ( | IVector | inputParameters | ) |
| inline virtual

Writes neural approximator input parameters to standard location.

Parameters

  inputParameters | Parameters to be written.

References IG.Num.VectorBase.SaveJson().

virtual void IG.Neural.NeuraApproximationFileManager.ReadNeuralOutput | ( | ref IVector | outputValues | ) |
| inline virtual

Reads neural approximator output values from the file at standard location.

Parameters

  outputValues | Object where the read outut values are stored.

References IG.Num.VectorBase.LoadJson().

virtual void IG.Neural.NeuraApproximationFileManager.WriteNeuralOutput | ( | IVector | outputValues | ) |
| inline virtual

Writes neural approximator outut values to the file at standard location.

Parameters

  outputValues | Output values that are written.

References IG.Num.VectorBase.SaveJson().

virtual void IG.Neural.NeuraApproximationFileManager.LoadNeuralNetwork | ( | ref INeuralApproximator | trainedNetwork | ) |
| inline virtual

Loads the trained neural network approximator from the file at standard location.

Parameters

  trainedNetwork | Object where the loaded neural network approximator is stored.

References IG.Num.NeuralApproximatorBase.LoadJson().

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.

Parameters

  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.

Parameters

  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.

Parameters

  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.

Parameters

  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).

References IG.Num.VectorBase.LoadJson(), and IG.Num.VectorBase.SaveJson().

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.

## Member Data Documentation

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._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

## Property Documentation

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 protected set

Directory for data and messages exchange through files.

string IG.Neural.NeuraApproximationFileManager.NeuralNetworkPath
| get protected 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 protected 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.

Referenced by IG.Script.LoadableScriptShellNeuralBase.PrintNeuralData().

string IG.Neural.NeuraApproximationFileManager.SimulationDataDefinitionPath
| get protected 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 protected 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 protected 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 protected 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 protected 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 protected 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 protected 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 protected 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 protected 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 protected 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.

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

- igbase/numeric/approximation/neural/testneural/NeuralFileManager.cs