This commit is contained in:
Valentino Orlandi 2024-02-16 23:35:54 +01:00
parent 03edcfad25
commit 8c179a05ce
Signed by: elB4RTO
GPG Key ID: 1719E976DB2D4E71
2 changed files with 3 additions and 5 deletions

View File

@ -440,7 +440,7 @@ Direction Snake::predictDirection( const std::array<std::array<float,7>,4>& data
{ {
float results[]{ 1.f, 1.f, 1.f, 1.f }; float results[]{ 1.f, 1.f, 1.f, 1.f };
bool keep_current{ false }; bool keep_current{ false };
Direction class_label; Direction class_label{ this->head_direction };
// process data // process data
for ( size_t i{0}; i<4ul; ++i ) { for ( size_t i{0}; i<4ul; ++i ) {
@ -473,9 +473,7 @@ Direction Snake::predictDirection( const std::array<std::array<float,7>,4>& data
} }
// choose the best result // choose the best result
if ( keep_current ) { if ( ! keep_current ) {
class_label = this->head_direction;
} else {
max = 0.f; max = 0.f;
for ( size_t i{0}; i<4ul; ++i ) { for ( size_t i{0}; i<4ul; ++i ) {
if ( results[i] > max ) { if ( results[i] > max ) {

View File

@ -42,7 +42,7 @@ inline bool operator>=(const DialogsLevel lhs, const DialogsLevel rhs)
inline std::string toString(const WebServer ws) noexcept inline std::string toString(const WebServer ws)
{ {
switch (ws) { switch (ws) {
case WebServer::Apache: case WebServer::Apache: