IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Neural.NeuraApproximationFileManager Class Reference

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

+ Inheritance diagram for IG.Neural.NeuraApproximationFileManager:
+ Collaboration diagram for IG.Neural.NeuraApproximationFileManager:

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 ( )
inlineprivate
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
directoryPathOperation 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
fileOrDirectoryNameRelative path (with respect to data and messages exchange directory)
void IG.Neural.NeuraApproximationFileManager.SetNeuralBusy ( )
inline
void IG.Neural.NeuraApproximationFileManager.ClearNeuralBusy ( )
inline
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
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
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)
inlinevirtual

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

Parameters
inputParametersObject where parameters are stored.

References IG.Num.VectorBase.LoadJson().

virtual void IG.Neural.NeuraApproximationFileManager.WriteNeuralInput ( IVector  inputParameters)
inlinevirtual

Writes neural approximator input parameters to standard location.

Parameters
inputParametersParameters to be written.

References IG.Num.VectorBase.SaveJson().

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

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

Parameters
outputValuesObject where the read outut values are stored.

References IG.Num.VectorBase.LoadJson().

virtual void IG.Neural.NeuraApproximationFileManager.WriteNeuralOutput ( IVector  outputValues)
inlinevirtual

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

Parameters
outputValuesOutput values that are written.

References IG.Num.VectorBase.SaveJson().

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

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

Parameters
trainedNetworkObject where the loaded neural network approximator is stored.

References IG.Num.NeuralApproximatorBase.LoadJson().

virtual void IG.Neural.NeuraApproximationFileManager.ClientWriteNeuralInput ( IVector  inputParameters)
inlinevirtual

Client writes input parameters for calculation of neural network based approximated values. Messages are set nad clears appropriately.

Parameters
inputParametersParameters to be written.
virtual void IG.Neural.NeuraApproximationFileManager.ClientReadNeuralOutput ( ref IVector  outputValues)
inlinevirtual

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 ( )
inlinevirtual

Performs request to the server for calculation of neural network based approximated values.

virtual void IG.Neural.NeuraApproximationFileManager.ClientCalculateApproximation ( IVector  inputParameters,
ref IVector  outputValues 
)
inlinevirtual

Calculates approximation by using the neural network approximation server.

Parameters
inputParametersIntput parameters for which approximation is calculated.
outputValuesVector where approximation output values are stored.
virtual void IG.Neural.NeuraApproximationFileManager.ClientTestCalculateApproximation ( string  inputFilePath,
string  outputFilePath 
)
inlinevirtual

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
inputFilePathPath to the JSON file where input parameters are read from. The file pointed at must exist.
outputFilePathPath 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 ( )
inlinevirtual

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
getprotected

Used internally for locking access to internal fields.

string IG.Neural.NeuraApproximationFileManager.DataDirectory
getprotected set

Directory for data and messages exchange through files.

string IG.Neural.NeuraApproximationFileManager.NeuralNetworkPath
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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: