NeurApp 1.1
NeurApp - software for exploring approximation by artificial neural networks on functions of one or two variables.

IG::Num::SimCastingRobertFileManager Class Reference

File manager for interfacing simulation casting simulator of Robert Vertnik. More...

Inheritance diagram for IG::Num::SimCastingRobertFileManager:

List of all members.

Public Member Functions

 SimCastingRobertFileManager (string rootDirectory, string projectName, string simulationName)
 Constructs a file manager for interfacing simulation casting simulator of Robert Vertnik.
void UpdateRootDirectory ()
 Updates the root directory path.
void RemoveTemporaryFilesFromExecutableDirpath ()
 Removes temporary files from teh executable directory. This is crucial for normal working of the interface (otherwise there are errors saying for some temporary files that they are readonly).
virtual void ReadInputParameters (ref IVector inputParameters)
 Reads optimization input parameters form the file at a standard location.
virtual void WriteInputParameters (IVector inputParameters)
 Writes optimization input parameters to the standard location.
virtual void DeleteOutputFiles ()
 Deletes the output files. It is recommendable to delete simulation output before running simulation. In this way, one would know if the simulation program has been broken because the output file would not exist or would be corrupted (otherwise, one could simply read the output file genenerated in some previout run, without noticing that something is wrong).
virtual void ReadOutputValues (ref IVector outputValues)
 Reads optimization output values form the file at a standard location. If for some reason the file does not exist or it is corrupted, the vector of output values is set to null.
virtual void WriteOutputValues (IVector outputValues)
 Writes optimization ouptut values to the standard location.
void RunSimulator ()
 Runs the simulaor interfaced by the current object. This method only runs the simulator, it does not prepare any input.
void RunSimulator (string[] commandlineArguments)
 Runns the simulator with the specified command-line arguments. Warning: this method should be used for testing only because the command-line arguments that should be passed to the simulator are specified by the interrface rules and can not be specified arbitrarily. Otherwise, run the overloaded method with no arguments. This method only runs the simulator, it does not prepare any input.
virtual void CalculateVectorResponse (IVector inputParameters, ref IVector outputValues)
 Calculates simulator's response at the specified input parameters.
override string ToString ()
 Returns a stirng that contains basic information about the current interfacing object, especially various relevant names (such as project name, etc.) and directory and file paths.

Protected Attributes

string _rootDirectory = null
string _projectName
string _simulationName
string _executableDirname = SimCastingRobertConst.ExecutableDirname
int _numInputParameters
int _numOutputValues

Static Protected Attributes

static string[] emptyCommandArguments = new string[0]

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.
int OutputLevel [get, set]
 Level of information that is output to the console by some methods.
string RootDirectory [get, set]
 Root directory for accessing casting simulator.
string ProjectName [get, set]
 Casting simulator project name, specifies names of subdirextories of the main directories, where data actually resides.
string SimulationName [get, set]
 Casting simulator simulation name, determines e.g. names of the optimization input and output files.
virtual string ExecutableDirpath [get, set]
 Path of the directory where executable is located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.
virtual string InputDirpath [get, set]
 Path of the directory where input files are located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.
virtual string OutputDirpath [get, set]
 Path of the directory where output files are located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.
virtual string PlotOutputDirpath [get, set]
 Path of the directory where plot files are located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.
virtual string MaterialDirpath [get, set]
 Path of the directory where material data is located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.
virtual string RootDirectoryContainingFilepath [get, set]
 File path of the file that contains the path of the directory containing the simulation directory structure. This file is important because it contents must be consistent with the actual location, otherwise simulation executable will not work. Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.
virtual string ExecutablePath [get, set]
 File path of simulator's executable. Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.
virtual string SimulationNamePath [get, set]
 Path to the file that contains the simulation name. Data found in this file specifies the names of input and output files. Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.
virtual string OptInputJsonPath [get, set]
 Path to the file that contains optimization input (usually stored by the caller of simulator). Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.
virtual string OptOutputJsonPath [get, set]
 Path to the file where optimization output values are stored by simulator. Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.
virtual int NumInputParameters [get, set]
 Number of input optimization parameters for the simulator.
virtual int NumOutputValues [get, set]
 Number of optimization output values produced by the simulator.

Private Member Functions

 SimCastingRobertFileManager ()

Private Attributes

object _mainLock = new object()
object _internalLock = new object()
int _outputLevel = Util.OutputLevel
string _executableDirpath = null
string _inputDirname = SimCastingRobertConst.InputDirname
string _inputDirpath = null
string _outputDirname = SimCastingRobertConst.OutputDirname
string _outputDirpath = null
string _plotoutputDirname = SimCastingRobertConst.PlotoutputDirname
string _plotoutputDirpath = null
string _materialDirname = SimCastingRobertConst.MaterialDirname
string _materialDirpath = null
string _rootDirectoryContainingFilename = SimCastingRobertConst.RootDirectoryContainingFilename
string _rootDirectoryContainingPath = null
string _executableFilename = SimCastingRobertConst.ExecutableFilename
string _executablePath = null
string _simulationNameFilename = SimCastingRobertConst.SimulationNameFilename
string _simulationNamePath = null
string _simJsonExtension = SimCastingRobertConst.SimJsonExtension
string _optInputJsonFilename = null
string _optInputJsonPath = null
string _optOutputJsonFilename = null
string _optOutputJsonPath = null

Detailed Description

File manager for interfacing simulation casting simulator of Robert Vertnik.

$A Igor Jul11;


Constructor & Destructor Documentation

IG::Num::SimCastingRobertFileManager::SimCastingRobertFileManager ( ) [inline, private]
IG::Num::SimCastingRobertFileManager::SimCastingRobertFileManager ( string  rootDirectory,
string  projectName,
string  simulationName 
) [inline]

Constructs a file manager for interfacing simulation casting simulator of Robert Vertnik.

Parameters:
rootDirectoryRoot directory containing all base directories for simulator data.
projectNameName of the project, which determines nmes of subdirectories of base directories that contain data for the current project.
simulationNameSimulation name, which determines e.g. names of optimization input and output files used for data exchange between optimization and simulation.

Member Function Documentation

void IG::Num::SimCastingRobertFileManager::UpdateRootDirectory ( ) [inline]

Updates the root directory path.

void IG::Num::SimCastingRobertFileManager::RemoveTemporaryFilesFromExecutableDirpath ( ) [inline]

Removes temporary files from teh executable directory. This is crucial for normal working of the interface (otherwise there are errors saying for some temporary files that they are readonly).

virtual void IG::Num::SimCastingRobertFileManager::ReadInputParameters ( ref IVector  inputParameters) [inline, virtual]

Reads optimization input parameters form the file at a standard location.

Parameters:
inputParametersReference to an object where input parameters are stored.

Reimplemented in IG::Num::ConvectionRobertFileManager.

virtual void IG::Num::SimCastingRobertFileManager::WriteInputParameters ( IVector  inputParameters) [inline, virtual]

Writes optimization input parameters to the standard location.

Parameters:
outputValuesParameters to be written.

Reimplemented in IG::Num::ConvectionRev1RobertFileManager, and IG::Num::ConvectionRobertFileManager.

virtual void IG::Num::SimCastingRobertFileManager::DeleteOutputFiles ( ) [inline, virtual]

Deletes the output files. It is recommendable to delete simulation output before running simulation. In this way, one would know if the simulation program has been broken because the output file would not exist or would be corrupted (otherwise, one could simply read the output file genenerated in some previout run, without noticing that something is wrong).

Reimplemented in IG::Num::ConvectionRobertFileManager.

virtual void IG::Num::SimCastingRobertFileManager::ReadOutputValues ( ref IVector  outputValues) [inline, virtual]

Reads optimization output values form the file at a standard location. If for some reason the file does not exist or it is corrupted, the vector of output values is set to null.

Parameters:
outputValuesReference to an object where output parameters will be stored.

Reimplemented in IG::Num::ConvectionRobertFileManager.

virtual void IG::Num::SimCastingRobertFileManager::WriteOutputValues ( IVector  outputValues) [inline, virtual]

Writes optimization ouptut values to the standard location.

Parameters:
outputValuesValues to be written.

Reimplemented in IG::Num::ConvectionRobertFileManager.

void IG::Num::SimCastingRobertFileManager::RunSimulator ( ) [inline]

Runs the simulaor interfaced by the current object. This method only runs the simulator, it does not prepare any input.

void IG::Num::SimCastingRobertFileManager::RunSimulator ( string[]  commandlineArguments) [inline]

Runns the simulator with the specified command-line arguments. Warning: this method should be used for testing only because the command-line arguments that should be passed to the simulator are specified by the interrface rules and can not be specified arbitrarily. Otherwise, run the overloaded method with no arguments. This method only runs the simulator, it does not prepare any input.

Parameters:
commandlineArgumentsCommand-line arguments that are passed to the simulator program.
virtual void IG::Num::SimCastingRobertFileManager::CalculateVectorResponse ( IVector  inputParameters,
ref IVector  outputValues 
) [inline, virtual]

Calculates simulator's response at the specified input parameters.

Parameters:
inputParametersInput parameters for which response is calculated.
outputValuesVector object where the calculated response is stored after calculation.
override string IG::Num::SimCastingRobertFileManager::ToString ( ) [inline]

Returns a stirng that contains basic information about the current interfacing object, especially various relevant names (such as project name, etc.) and directory and file paths.


Member Data Documentation

object IG::Num::SimCastingRobertFileManager::_mainLock = new object() [private]
object IG::Num::SimCastingRobertFileManager::_internalLock = new object() [private]
int IG::Num::SimCastingRobertFileManager::_outputLevel = Util.OutputLevel [private]
string IG::Num::SimCastingRobertFileManager::_executableDirname = SimCastingRobertConst.ExecutableDirname [protected]
string IG::Num::SimCastingRobertFileManager::_inputDirname = SimCastingRobertConst.InputDirname [private]
string IG::Num::SimCastingRobertFileManager::_outputDirname = SimCastingRobertConst.OutputDirname [private]
string IG::Num::SimCastingRobertFileManager::_plotoutputDirname = SimCastingRobertConst.PlotoutputDirname [private]
string IG::Num::SimCastingRobertFileManager::_materialDirname = SimCastingRobertConst.MaterialDirname [private]
string IG::Num::SimCastingRobertFileManager::_rootDirectoryContainingFilename = SimCastingRobertConst.RootDirectoryContainingFilename [private]
string IG::Num::SimCastingRobertFileManager::_executableFilename = SimCastingRobertConst.ExecutableFilename [private]
string IG::Num::SimCastingRobertFileManager::_simulationNameFilename = SimCastingRobertConst.SimulationNameFilename [private]
string IG::Num::SimCastingRobertFileManager::_simJsonExtension = SimCastingRobertConst.SimJsonExtension [private]
string [] IG::Num::SimCastingRobertFileManager::emptyCommandArguments = new string[0] [static, protected]

Property Documentation

object IG::Num::SimCastingRobertFileManager::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::Num::SimCastingRobertFileManager::InternalLock [get, protected]

Used internally for locking access to internal fields.

int IG::Num::SimCastingRobertFileManager::OutputLevel [get, set]

Level of information that is output to the console by some methods.

string IG::Num::SimCastingRobertFileManager::RootDirectory [get, set]

Root directory for accessing casting simulator.

string IG::Num::SimCastingRobertFileManager::ProjectName [get, set]

Casting simulator project name, specifies names of subdirextories of the main directories, where data actually resides.

string IG::Num::SimCastingRobertFileManager::SimulationName [get, set]

Casting simulator simulation name, determines e.g. names of the optimization input and output files.

virtual string IG::Num::SimCastingRobertFileManager::ExecutableDirpath [get, set]

Path of the directory where executable is located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.

Reimplemented in IG::Num::ConvectionRobertFileManager.

virtual string IG::Num::SimCastingRobertFileManager::InputDirpath [get, set]

Path of the directory where input files are located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.

virtual string IG::Num::SimCastingRobertFileManager::OutputDirpath [get, set]

Path of the directory where output files are located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.

virtual string IG::Num::SimCastingRobertFileManager::PlotOutputDirpath [get, set]

Path of the directory where plot files are located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.

virtual string IG::Num::SimCastingRobertFileManager::MaterialDirpath [get, set]

Path of the directory where material data is located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called.

virtual string IG::Num::SimCastingRobertFileManager::RootDirectoryContainingFilepath [get, set]

File path of the file that contains the path of the directory containing the simulation directory structure. This file is important because it contents must be consistent with the actual location, otherwise simulation executable will not work. Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.

virtual string IG::Num::SimCastingRobertFileManager::ExecutablePath [get, set]

File path of simulator's executable. Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.

Reimplemented in IG::Num::ConvectionRobertFileManager.

virtual string IG::Num::SimCastingRobertFileManager::SimulationNamePath [get, set]

Path to the file that contains the simulation name. Data found in this file specifies the names of input and output files. Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.

virtual string IG::Num::SimCastingRobertFileManager::OptInputJsonPath [get, set]

Path to the file that contains optimization input (usually stored by the caller of simulator). Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.

Reimplemented in IG::Num::ConvectionRobertFileManager.

virtual string IG::Num::SimCastingRobertFileManager::OptOutputJsonPath [get, set]

Path to the file where optimization output values are stored by simulator. Only pure file name can be provided (if the full path is provided then only the file name is extracted, and the related path is calculated when firs needed). If set to null then file path is set to null and will be recalculated when getter is called.

Reimplemented in IG::Num::ConvectionRobertFileManager.

virtual int IG::Num::SimCastingRobertFileManager::NumInputParameters [get, set]

Number of input optimization parameters for the simulator.

Reimplemented in IG::Num::ConvectionRev1RobertFileManager, and IG::Num::ConvectionRobertFileManager.

virtual int IG::Num::SimCastingRobertFileManager::NumOutputValues [get, set]

Number of optimization output values produced by the simulator.

Reimplemented in IG::Num::ConvectionRobertFileManager.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties