IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.
|
Base class for loadable scripts for optimization problems. AGREEMENTS: The first argument to initialization and executable method is working directory where data between different applications is exchanged. If overrigding the InitializeThis(...) method, call the base class' method first, and keep the agreement that the first argument must be the working directory. When implementing the executable (RunThis(...)) method, its first argument should also be the working directory (the same as for initialization). This is to enable use of the class in scenarios where initialization and execution arguments must be the same. More...
Classes | |
class | AnalysisScript |
Public Member Functions | |
LoadableScriptOptBase () | |
Creates the LoadableScriptOptBase object. | |
abstract void | Analyse (IAnalysisResults anRes) |
Performs direct analysis for optimization problems. This method must be overridden in derived classes where one wants to have direct analysis defined. | |
Protected Member Functions | |
override void | InitializeThis (string[] arguments) |
Inializes the current script object. | |
Protected Attributes | |
StopWatch | _timer = null |
bool | _checkOptimizationDirectoryExistence = true |
Whether to check existence of optimization directory when set. Also applies to working directory. | |
Properties | |
StopWatch | Timer [get] |
virtual IRandomGenerator | Random [get, set] |
Random generator used by the current object. Lazy evaluation, created when needed for the first time.The generator is thread safe and initialized with a time dependent seed. | |
virtual string | OptimizationDirectory [get, set] |
Optimization directory. This directory is a base directory for data used optimization and neural network - based approximation servers and for other directories that contain data for specific tasks. | |
virtual string | WorkingDirectory [get, set] |
Working directory. This directory is a base directory for data used by the script. It is usually obtained as parent directory of the optimization directory. | |
virtual IAnalysis | Analysis [get, set] |
Direct analysis object used in optimization. Initialized when first accessed with the embedded class, whose analysis function calls Analyse(...). | |
Private Attributes | |
IRandomGenerator | _randGen |
string | _optimizationDirectory |
string | _workingDirectory |
IAnalysis | _analysis |
Base class for loadable scripts for optimization problems. AGREEMENTS: The first argument to initialization and executable method is working directory where data between different applications is exchanged. If overrigding the InitializeThis(...) method, call the base class' method first, and keep the agreement that the first argument must be the working directory. When implementing the executable (RunThis(...)) method, its first argument should also be the working directory (the same as for initialization). This is to enable use of the class in scenarios where initialization and execution arguments must be the same.
$A Igor Jul09
IG::Lib::LoadableScriptOptBase::LoadableScriptOptBase | ( | ) | [inline] |
Creates the LoadableScriptOptBase object.
override void IG::Lib::LoadableScriptOptBase::InitializeThis | ( | string[] | arguments | ) | [inline, protected, virtual] |
Inializes the current script object.
arguments | Initialization arguments. The first argument must be the working directory path. |
Implements IG::Lib::LoadableScriptBase.
Reimplemented in IG::Lib::LoadableScriptOptTest::LoadableScriptOptDerived.
abstract void IG::Lib::LoadableScriptOptBase::Analyse | ( | IAnalysisResults | anRes | ) | [pure virtual] |
Performs direct analysis for optimization problems. This method must be overridden in derived classes where one wants to have direct analysis defined.
anRes | IAnalysisResults object where input parameters are loaded on the call, and where analysis results are stored after the call. |
In order to perform the direct analysis, an embedded Analysis object is used. This object's analysis method calls the current Analyse method in order to actually perform the analysis.
Implemented in IG::Lib::LoadableScriptOptTest::LoadableScriptOptDerived.
StopWatch IG::Lib::LoadableScriptOptBase::_timer = null [protected] |
string IG::Lib::LoadableScriptOptBase::_optimizationDirectory [private] |
bool IG::Lib::LoadableScriptOptBase::_checkOptimizationDirectoryExistence = true [protected] |
Whether to check existence of optimization directory when set. Also applies to working directory.
string IG::Lib::LoadableScriptOptBase::_workingDirectory [private] |
StopWatch IG::Lib::LoadableScriptOptBase::Timer [get, protected] |
virtual IRandomGenerator IG::Lib::LoadableScriptOptBase::Random [get, set] |
Random generator used by the current object. Lazy evaluation, created when needed for the first time.The generator is thread safe and initialized with a time dependent seed.
virtual string IG::Lib::LoadableScriptOptBase::OptimizationDirectory [get, set] |
Optimization directory. This directory is a base directory for data used optimization and neural network - based approximation servers and for other directories that contain data for specific tasks.
virtual string IG::Lib::LoadableScriptOptBase::WorkingDirectory [get, set] |
Working directory. This directory is a base directory for data used by the script. It is usually obtained as parent directory of the optimization directory.
virtual IAnalysis IG::Lib::LoadableScriptOptBase::Analysis [get, set] |
Direct analysis object used in optimization. Initialized when first accessed with the embedded class, whose analysis function calls Analyse(...).
When getter is first accessed, this property is initialized with an object of the embedded AnalysisScript class that has Script property set to the current loadable script object. This object calls the Analyse(...) method on the currend loadable script object in order to actually perform the direct analysis. This method must be overridden in derived concrete classes. Various properties of the optimization problem such as number of parameters, number of constraints, etc., must be accessed through this object.