SOMHunter Core
static-config.h
Go to the documentation of this file.
1 /* This file is part of SOMHunter.
2  *
3  * Copyright (C) 2021 Frantisek Mejzlik <frankmejzlik@protonmail.com>
4  * Mirek Kratochvil <exa.exa@gmail.com>
5  * Patrik Vesely <prtrikvesely@gmail.com>
6  *
7  * SOMHunter is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License as published by the Free
9  * Software Foundation, either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * SOMHunter is distributed in the hope that it will be useful, but WITHOUT ANY
13  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * SOMHunter. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef CONFIG_H_
22 #define CONFIG_H_
23 
24 #include <cstddef>
25 
26 namespace sh {
27 namespace sconfig {
28 
34 #define LOGLEVEL 3
35 
37 #define LOCK_STDOUT 0
38 
40 #define DEBUG_CURL_REQUESTS 0
41 
43 #define LOG_API_CALLS 0
44 
46 #define KW_TEMPORAL_SPAN 5
47 
49 #define MINIMAL_SCORE 1e-18f
50 
52 #define MAX_NUM_TEMP_WORKERS 4
53 
55 constexpr const char* EXIT_HTTP_API_LOOP_KEYWORD = "exit";
56 
58 constexpr std::size_t HTTP_API_LOOP_SLEEP = 1000;
59 
60 }; // namespace sconfig
61 
62 // ----------------------------------------
63 // Old
64 
65 /*
66  * Scoring/SOM stuff
67  */
68 #define TOPN_LIMIT 20000
69 #define TOPKNN_LIMIT 10000
70 #define SOM_ITERS 30000
71 
73 #define DISPLAY_GRID_WIDTH 6
74 
76 #define DISPLAY_GRID_HEIGHT 6
77 
79 constexpr float RANDOM_DISPLAY_WEIGHT = 3.0f;
80 
82 constexpr size_t SOM_DISPLAY_GRID_WIDTH = 8;
83 
85 constexpr size_t SOM_DISPLAY_GRID_HEIGHT = 8;
86 
88 constexpr size_t RELOCATION_GRID_WIDTH = 5;
89 
91 constexpr size_t RELOCATION_GRID_HEIGHT = 5;
92 
94 constexpr int MAX_TEMPORAL_SIZE = 2;
95 
96 /* ***********************************
97  * Logging names
98  * *********************************** */
99 namespace LOGGING_STRINGS {
100 namespace STD_CATEGORIES {
101 constexpr const char* BROWSING = "BROWSING";
102 constexpr const char* IMAGE = "IMAGE";
103 constexpr const char* TEXT = "TEXT";
104 }; // namespace STD_CATEGORIES
105 
106 namespace STD_TYPES {
107 constexpr const char* EXPLORATION = "exploration";
108 constexpr const char* RANKED_LIST = "rankedList";
109 constexpr const char* RANDOM_SELECTION = "randomSelection";
110 }; // namespace STD_TYPES
111 
112 namespace STD_VALUES {
113 constexpr const char* RANDOM_DISPLAY = "randomDisplay";
114 constexpr const char* SOM_DISPLAY = "somDisplay";
115 
116 constexpr const char* TOP_SCORED_DISPLAY = "topScoredDisplay";
117 constexpr const char* SOM_RELOC_DISPLAY = "somRelocationDisplay";
118 constexpr const char* TOP_SCORED_CONTEXT_DISPLAY = "topnContextDisplay";
119 }; // namespace STD_VALUES
120 
121 namespace STD_KEYS {
122 constexpr const char* ACTION_NAME = "actionName";
123 };
124 
125 namespace ACTION_NAMES {
126 constexpr const char* SHOW_RANDOM_DISPLAY = "showRandomDisplay";
127 constexpr const char* SHOW_SOM_DISPLAY = "showSomDisplay";
128 constexpr const char* SHOW_SOM_RELOC_DISPLAY = "showSomRelocationDisplay";
129 constexpr const char* SHOW_TOP_SCORED_DISPLAY = "showTopScoredDisplay";
130 constexpr const char* SHOW_TOP_SCORED_CONTEXT_DISPLAY = "showTopScoredContextDisplay";
131 
132 constexpr const char* RESET_ALL = "resetAll";
133 
134 }; // namespace ACTION_NAMES
135 }; // namespace LOGGING_STRINGS
136 
137 }; // namespace sh
138 
139 #endif // CONFIG_H_
constexpr const char * SHOW_SOM_DISPLAY
Definition: static-config.h:127
constexpr const char * RESET_ALL
Definition: static-config.h:132
constexpr const char * SHOW_TOP_SCORED_DISPLAY
Definition: static-config.h:129
constexpr const char * SHOW_TOP_SCORED_CONTEXT_DISPLAY
Definition: static-config.h:130
constexpr const char * SHOW_RANDOM_DISPLAY
Definition: static-config.h:126
constexpr const char * SHOW_SOM_RELOC_DISPLAY
Definition: static-config.h:128
constexpr const char * TEXT
Definition: static-config.h:103
constexpr const char * BROWSING
Definition: static-config.h:101
constexpr const char * IMAGE
Definition: static-config.h:102
constexpr const char * ACTION_NAME
Definition: static-config.h:122
constexpr const char * EXPLORATION
Definition: static-config.h:107
constexpr const char * RANDOM_SELECTION
Definition: static-config.h:109
constexpr const char * RANKED_LIST
Definition: static-config.h:108
constexpr const char * RANDOM_DISPLAY
Definition: static-config.h:113
constexpr const char * TOP_SCORED_DISPLAY
Definition: static-config.h:116
constexpr const char * SOM_DISPLAY
Definition: static-config.h:114
constexpr const char * SOM_RELOC_DISPLAY
Definition: static-config.h:117
constexpr const char * TOP_SCORED_CONTEXT_DISPLAY
Definition: static-config.h:118
constexpr const char * EXIT_HTTP_API_LOOP_KEYWORD
Keyword to type in to end the HTTP API listening loop.
Definition: static-config.h:55
constexpr std::size_t HTTP_API_LOOP_SLEEP
Sleep interval for the the HTTP API listening loop.
Definition: static-config.h:58
Definition: common-types.h:33
constexpr int TOP_N_SELECTED_FRAME_POSITION
Definition: static-config.h:78
constexpr float RANDOM_DISPLAY_WEIGHT
Definition: static-config.h:79
constexpr size_t SOM_DISPLAY_GRID_HEIGHT
SOM window image grid height.
Definition: static-config.h:85
constexpr size_t SOM_DISPLAY_GRID_WIDTH
SOM window image grid width.
Definition: static-config.h:82
constexpr int MAX_TEMPORAL_SIZE
Maximal size of temporal query.
Definition: static-config.h:94
constexpr size_t RELOCATION_GRID_HEIGHT
SOM relocation grid height.
Definition: static-config.h:91
constexpr size_t RELOCATION_GRID_WIDTH
SOM relocation grid width.
Definition: static-config.h:88