<commit_before>#ifndef HALITE_HLT_H
#define HALITE_HLT_H

#include <algorithm>
#include <cassert>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>

namespace hlt {
    /**
     * Quick-and-simple logging facility. Recommended to be replaced with
     * your own.
     */
    struct Log {
    private:
        std::ofstream file;

        auto initialize(std::string filename) -> void {
            if (!ENABLED) return;
            file.open(filename, std::ios::trunc | std::ios::out);
        }

    public:
        constexpr static auto ENABLED = true;

        static auto open(std::string filename) -> void {
            if (!ENABLED) return;
            get().initialize(filename);
        }

        static auto get() -> Log& {
            static Log instance{};
            return instance;
        }

        static auto log(std::string message) -> void {
            if (!ENABLED) return;
            get().file << message << '\n';
        }
    };

    typedef unsigned char PlayerId;
    typedef unsigned long EntityIndex;

    /** Global state */
    static PlayerId my_tag = 0;
    static unsigned short map_width;
    static unsigned short map_height;

    /**
     * Gameplay constants that may be tweaked (though they should be at their
     * default values in a tournament setting).
     */
    struct GameConstants {
        int PLANETS_PER_PLAYER = 6;
        unsigned int EXTRA_PLANETS = 4;

        int DRAG = 3;
        int MAX_SPEED = 30;
        int MAX_ACCELERATION = 10;

        unsigned short MAX_SHIP_HEALTH = 255;
        unsigned short BASE_SHIP_HEALTH = 127;
        unsigned short DOCKED_SHIP_REGENERATION = 32;

        unsigned int WEAPON_COOLDOWN = 1;
        int WEAPON_RADIUS = 5;
        int WEAPON_DAMAGE = 64;

        unsigned int MAX_DOCKING_DISTANCE = 4;
        unsigned int DOCK_TURNS = 5;
        int PRODUCTION_PER_SHIP = 100;

        static auto get_mut() -> GameConstants& {
            // Guaranteed initialized only once by C++11
            static GameConstants instance;
            return instance;
        }

        static auto get() -> const GameConstants& {
            return get_mut();
        }
    };

    /**
     * A location on the discretized Halite grid.
     */
    struct Location {
        unsigned short pos_x, pos_y;

        friend auto operator<< (std::ostream& ostream, const Location& location) -> std::ostream& {
            ostream << '(' << location.pos_x << ", " << location.pos_y << ')';
            return ostream;
        }
    };

    /**
     * The discretized velocity of a ship.
     */
    struct Velocity {
        short vel_x, vel_y;

        auto magnitude() const -> double {
            return sqrt(vel_x*vel_x + vel_y*vel_y);
        }

        auto angle() const -> double {
            return atan2(vel_y, vel_x);
        }
    };

    static bool operator==(const Location& l1, const Location& l2) {
        return l1.pos_x == l2.pos_x && l1.pos_y == l2.pos_y;
    }

    /**<commit_msg>Make sure C++ bot builds with GCC/G++<commit_after>#ifndef HALITE_HLT_H
#define HALITE_HLT_H

#include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>

namespace hlt {
    /**
     * Quick-and-simple logging facility. Recommended to be replaced with
     * your own.
     */
    struct Log {
    private:
        std::ofstream file;

        auto initialize(std::string filename) -> void {
            if (!ENABLED) return;
            file.open(filename, std::ios::trunc | std::ios::out);
        }

    public:
        constexpr static auto ENABLED = true;

        static auto open(std::string filename) -> void {
            if (!ENABLED) return;
            get().initialize(filename);
        }

        static auto get() -> Log& {
            static Log instance{};
            return instance;
        }

        static auto log(std::string message) -> void {
            if (!ENABLED) return;
            get().file << message << '\n';
        }
    };

    typedef unsigned char PlayerId;
    typedef unsigned long EntityIndex;

    /** Global state */
    static PlayerId my_tag = 0;
    static unsigned short map_width;
    static unsigned short map_height;

    /**
     * Gameplay constants that may be tweaked (though they should be at their
     * default values in a tournament setting).
     */
    struct GameConstants {
        int PLANETS_PER_PLAYER = 6;
        unsigned int EXTRA_PLANETS = 4;

        int DRAG = 3;
        int MAX_SPEED = 30;
        int MAX_ACCELERATION = 10;

        unsigned short MAX_SHIP_HEALTH = 255;
        unsigned short BASE_SHIP_HEALTH = 127;
        unsigned short DOCKED_SHIP_REGENERATION = 32;

        unsigned int WEAPON_COOLDOWN = 1;
        int WEAPON_RADIUS = 5;
        int WEAPON_DAMAGE = 64;

        unsigned int MAX_DOCKING_DISTANCE = 4;
        unsigned int DOCK_TURNS = 5;
        int PRODUCTION_PER_SHIP = 100;

        static auto get_mut() -> GameConstants& {
            // Guaranteed initialized only once by C++11
            static GameConstants instance;
            return instance;
        }

        static auto get() -> const GameConstants& {
            return get_mut();
        }
    };

    /**
     * A location on the discretized Halite grid.
     */
    struct Location {
        unsigned short pos_x, pos_y;

        friend auto operator<< (std::ostream& ostream, const Location& location) -> std::ostream& {
            ostream << '(' << location.pos_x << ", " << location.pos_y << ')';
            return ostream;
        }
    };

    /**
     * The discretized velocity of a ship.
     */
    struct Velocity {
        short vel_x, vel_y;

        auto magnitude() const -> double {
            return std::sqrt(vel_x*vel_x + vel_y*vel_y);
        }

        auto angle() const -> double {
            return std::atan2(vel_y, vel_x);
        }
    };

    static bool operator==(const Location& l1, const Location& l2) {
        return l1.pos_x == l2.pos_x && l1.pos_y == l2.pos_y;
    }

    /**
{'fraction_non_alphanumeric': 0.10316301703163017, 'fraction_numerical': 0.01103000811030008, 'mean_word_length': 1.9530651340996168, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4505569', 'n_tokens_mistral': 1907, 'n_tokens_neox': 1798, 'n_words': 528}