#include <Framework.h>
Public Member Functions | |
Framework () | |
~Framework () | |
Static Public Member Functions | |
static void | setDatasetType (bool isClassification) |
static bool | getDatasetType () |
static void | setMaxThreads (int n) |
static int | getMaxThreads () |
static void | setRandomSeed (int n) |
static int | getRandomSeed () |
static void | setFrameworkMode (int mode) |
static int | getFrameworkMode () |
static void | setAdditionalStartupParameter (char *s) |
static int | getAdditionalStartupParameter () |
static uint | convertDateToInt (uint day, uint month, uint year, uint hour, uint minute, uint second) |
static void | convertIntToDate (uint date, uint &day, uint &month, uint &year, uint &hour, uint &minute, uint &second, uint &weekday) |
Static Private Attributes | |
static bool | m_isClassificationDataset |
static int | m_maxThreads |
static int | m_randomSeed |
static int | m_frameworkMode |
static int | m_additionalStartupParameter |
The global status vars can be accessed from everywhere by static methods
Definition at line 22 of file Framework.h.
Framework::Framework | ( | ) |
Framework::~Framework | ( | ) |
uint Framework::convertDateToInt | ( | uint | day, | |
uint | month, | |||
uint | year, | |||
uint | hour, | |||
uint | minute, | |||
uint | second | |||
) | [static] |
Convert a date to a unix time_t stamp
day | The day: 1..31 | |
month | The month: 1..12 | |
year | The year | |
hour | The hour: 0..23 | |
minute | The minute: 0..59 | |
second | The second: 0..59 |
Definition at line 147 of file Framework.cpp.
00148 { 00149 struct tm t; 00150 t.tm_year = year - 1900; 00151 t.tm_mon = month - 1; 00152 t.tm_mday = day; 00153 t.tm_hour = hour; 00154 t.tm_min = minute; 00155 t.tm_sec = second; 00156 t.tm_isdst = 0; 00157 time_t tt = mktime(&t); 00158 00159 time_t secondsFromNow = time(0); 00160 tm* t0 = gmtime(&secondsFromNow); 00161 00162 if(t0->tm_isdst == 0) 00163 tt += 3600; 00164 00165 return tt; 00166 }
void Framework::convertIntToDate | ( | uint | date, | |
uint & | day, | |||
uint & | month, | |||
uint & | year, | |||
uint & | hour, | |||
uint & | minute, | |||
uint & | second, | |||
uint & | weekday | |||
) | [static] |
Convert the unix time stamp back to individual values.
date | Input: unix time stamp | |
day | Reference value, return parameter | |
month | Reference value, return parameter | |
year | Reference value, return parameter | |
hour | Reference value, return parameter | |
minute | Reference value, return parameter | |
second | Reference value, return parameter |
Definition at line 179 of file Framework.cpp.
00180 { 00181 time_t seconds = date; 00182 struct tm t = *gmtime(&seconds); 00183 day = t.tm_mday; 00184 month = t.tm_mon + 1; 00185 year = t.tm_year + 1900; 00186 hour = t.tm_hour; 00187 minute = t.tm_min; 00188 second = t.tm_sec; 00189 weekday = t.tm_wday; // 0..6 days since Sunday 00190 }
int Framework::getAdditionalStartupParameter | ( | ) | [static] |
Return additional run parameter on startup
Definition at line 131 of file Framework.cpp.
bool Framework::getDatasetType | ( | ) | [static] |
Returns the stored type
Definition at line 43 of file Framework.cpp.
int Framework::getFrameworkMode | ( | ) | [static] |
Return Framework mode
Definition at line 108 of file Framework.cpp.
int Framework::getMaxThreads | ( | ) | [static] |
int Framework::getRandomSeed | ( | ) | [static] |
void Framework::setAdditionalStartupParameter | ( | char * | s | ) | [static] |
Set additional run parameter on startup
s | Random Seed |
Definition at line 118 of file Framework.cpp.
00119 { 00120 int n = -1; 00121 sscanf ( s,"%d",&n ); 00122 m_additionalStartupParameter = n; 00123 cout<<"additionalStartupParameter: "<<m_additionalStartupParameter<<endl; 00124 }
void Framework::setDatasetType | ( | bool | isClassification | ) | [static] |
Set the dataset type
isClassification | True: the dataset is a classification dataset |
Definition at line 32 of file Framework.cpp.
00033 { 00034 m_isClassificationDataset = isClassification; 00035 cout<<"isClassificationDataset: "<<m_isClassificationDataset<<endl; 00036 }
void Framework::setFrameworkMode | ( | int | mode | ) | [static] |
Set Framework mode train(0), predict(1), blend(2)
mode | The mode |
Definition at line 97 of file Framework.cpp.
void Framework::setMaxThreads | ( | int | n | ) | [static] |
Set max threads
n | Max. threads for OPENMP |
Definition at line 53 of file Framework.cpp.
00054 { 00055 m_maxThreads = n; 00056 omp_set_num_threads ( m_maxThreads ); // set this value for OPENMP pragmas 00057 cout<<"maxThreads(OPENMP): "<<m_maxThreads<<endl; 00058 }
void Framework::setRandomSeed | ( | int | s | ) | [static] |