22
33#include " ConfigDirs.h"
44#include " Consts.h"
5+ #include " PriceType.h"
56
67// #include <Util/Except.hpp>
78#include < Ios/Osstream.hpp>
1112using namespace std ;
1213using namespace EnjoLib ;
1314
14- const char * ConfigTS::DEFAULT_SCRIPT_FILE_NAME = " ts-xform-script.txt" ;
15- const char * ConfigTS::DEFAULT_SCRIPT_FILE_NAME_R = " r-custom.R" ;
15+ const char * ConfigTS::DEFAULT_SCRIPT_FILE_NAME = " ts-xform-script.txt" ;
16+ const char * ConfigTS::DEFAULT_SCRIPT_FILE_NAME_R = " r-custom.R" ;
17+ const char * ConfigTS::DEFAULT_SCRIPT_FILE_NAME_PY = " py_statsmodels.py" ;
1618const char * ConfigTS::DEFAULT_SCRIPT_FILE_NAME_GEN = " data-generation.txt" ;
1719
1820
1921ConfigTS::~ConfigTS (){}
2022ConfigTS::ConfigTS ()
2123{
24+ const ConfigDirs dirs;
25+ m_scriptPathTxt = dirs.DIR_SCRIPTS2 + DEFAULT_SCRIPT_FILE_NAME;
26+ m_scriptPathTxtR = dirs.DIR_SCRIPTS2 + DEFAULT_SCRIPT_FILE_NAME_R;
27+ m_scriptPathTxtGen = dirs.DIR_SCRIPTS2 + DEFAULT_SCRIPT_FILE_NAME_GEN;
28+ m_scriptPathTxtPy = dirs.DIR_SCRIPTS2 + DEFAULT_SCRIPT_FILE_NAME_PY;
2229}
2330
2431EnjoLib::Str ConfigTS::GetFileNameProt () const
@@ -35,17 +42,19 @@ void ConfigTS::RegisterAndReadBools(EnjoLib::Istream & f)
3542 RegisterAndReadBool (f, crashOnRecoverableErrors, 0 , " Crash on err" , " Crash on recoverable errors" );
3643 RegisterAndReadBool (f, PLOT_SERIES, 1 , " Plot series" , " Plot output series after evaluation" );
3744 RegisterAndReadBool (f, PLOT_BASELINE, 1 , " Plot baseline" , " Plot baseline prediction in QT app" );
38- RegisterAndReadBool (f, PLOT_PYTHON, 0 , " Plot with Python" , " Plot the series in Python backend " );
45+ RegisterAndReadBool (f, PLOT_PYTHON, 0 , " Plot with Python" , DESCR_PLOT_PYTHON );
3946 RegisterAndReadBool (f, PLOT_PYTHON_ACF, 0 , " Plot ACF with Python" , " Plot the Auto Correlation Function in Python backend" );
4047 RegisterAndReadBool (f, MT_XFORM, 1 , " MT xform" , " Perform the transformations in a multithreaded way (still unstable)" );
4148 RegisterAndReadBool (f, MT_REPORT, 0 , " MT report" , " Generate report in multithreaded way (still unstable)" );
4249 RegisterAndReadBool (f, USE_VECTOR_PRED, 1 , " Opti vec pred" , " Use optimized vectored prediction" );
50+ RegisterAndReadBool (f, BENCHMARK, 0 , " Benchmark" , DESCR_BENCHMARK);
51+
4352}
4453
4554void ConfigTS::RegisterAndReadInts (EnjoLib::Istream & f)
4655{
4756 RegisterAndReadInt (f, PRED_TYPE, 0 );
48- RegisterAndReadInt (f, PRICE_TYPE, 0 );
57+ RegisterAndReadInt (f, PRICE_TYPE, static_cast < long int >(PriceType::HIGH) );
4958 RegisterAndReadInt (f, PLOT_LAGS_NUM, 30 );
5059 RegisterAndReadInt (f, PLOT_PERIOD_NUM, 30 );
5160}
@@ -54,13 +63,19 @@ void ConfigTS::RegisterAndReadFloats(EnjoLib::Istream & f)
5463}
5564void ConfigTS::RegisterAndReadStrs (EnjoLib::Istream & f)
5665{
57- const ConfigDirs dirs ;
58- RegisterAndReadStr (f, m_scriptPathTxt , dirs. DIR_SCRIPTS2 + DEFAULT_SCRIPT_FILE_NAME );
59- RegisterAndReadStr (f, m_scriptPathTxtR , dirs. DIR_SCRIPTS2 + DEFAULT_SCRIPT_FILE_NAME_R );
60- RegisterAndReadStr (f, m_scriptPathTxtGen , dirs. DIR_SCRIPTS2 + DEFAULT_SCRIPT_FILE_NAME_GEN );
66+ RegisterAndReadStr (f, m_scriptPathTxt, m_scriptPathTxt) ;
67+ RegisterAndReadStr (f, m_scriptPathTxtR , m_scriptPathTxtR );
68+ RegisterAndReadStr (f, m_scriptPathTxtGen , m_scriptPathTxtGen );
69+ RegisterAndReadStr (f, m_scriptPathTxtPy , m_scriptPathTxtPy );
6170 // RegisterAndReadStr(f, m_outDir, "");
6271}
6372
73+ void ConfigTS::SetScriptNamePy (const EnjoLib::Str & name)
74+ {
75+ const ConfigDirs dirs;
76+ m_scriptPathTxtPy = dirs.DIR_SCRIPTS2 + name;
77+ }
78+
6479PredictorType ConfigTS::GetPredType () const
6580{
6681 return static_cast <PredictorType>(PRED_TYPE);
@@ -92,4 +107,16 @@ void ConfigTS::UpdateFromOther(const ConfigTS & cfgTSCmdLine)
92107 {
93108 PLOT_PERIOD_NUM = cfgTSCmdLine.PLOT_PERIOD_NUM ;
94109 }
110+ if (cfgTSCmdLine.PRED_TYPE >= 0 )
111+ {
112+ PRED_TYPE = cfgTSCmdLine.PRED_TYPE ;
113+ }
114+ if (cfgTSCmdLine.BENCHMARK )
115+ {
116+ BENCHMARK = cfgTSCmdLine.BENCHMARK ;
117+ }
118+ if (cfgTSCmdLine.PLOT_PYTHON )
119+ {
120+ PLOT_PYTHON = cfgTSCmdLine.PLOT_PYTHON ;
121+ }
95122}
0 commit comments