Fix
This commit is contained in:
parent
03edcfad25
commit
8c179a05ce
|
@ -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 ) {
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue