<commit_before>#ifndef SPHERE_OF_INFLUENCE_GENE_H
#define SPHERE_OF_INFLUENCE_GENE_H

#include "Gene.h"

#include <string>
#include <memory>
#include <array>
#include <map>

#include "Game/Color.h"

class Board;

//! Scores a board based on the number of squares attacked by a side with bonus points for legality and moves close to the king.
class Sphere_of_Influence_Gene : public Gene
{
    public:
        Sphere_of_Influence_Gene();

        std::unique_ptr<Gene> duplicate() const override;

        std::string name() const override;

    protected:
        std::map<std::string, double> list_properties() const override;
        void load_properties(const std::map<std::string, double>& properties) override;

    private:
        double legal_square_score;
        double illegal_square_score;
        double king_target_factor;

        std::array<double, 8> scalar_cache;
        double score_board(const Board& board, Color perspective, const size_t depth) const override;
        void gene_specific_mutation() override;
        void recompute_scalar_cache();
};

#endif // SPHERE_OF_INFLUENCE_GENE_H<commit_msg>Group data member with associated method<commit_after>#ifndef SPHERE_OF_INFLUENCE_GENE_H
#define SPHERE_OF_INFLUENCE_GENE_H

#include "Gene.h"

#include <string>
#include <memory>
#include <array>
#include <map>

#include "Game/Color.h"

class Board;

//! Scores a board based on the number of squares attacked by a side with bonus points for legality and moves close to the king.
class Sphere_of_Influence_Gene : public Gene
{
    public:
        Sphere_of_Influence_Gene();

        std::unique_ptr<Gene> duplicate() const override;

        std::string name() const override;

    protected:
        std::map<std::string, double> list_properties() const override;
        void load_properties(const std::map<std::string, double>& properties) override;

    private:
        double legal_square_score;
        double illegal_square_score;
        double king_target_factor;

        double score_board(const Board& board, Color perspective, const size_t depth) const override;
        void gene_specific_mutation() override;

        std::array<double, 8> scalar_cache;
        void recompute_scalar_cache();
};

#endif // SPHERE_OF_INFLUENCE_GENE_H
{'fraction_non_alphanumeric': 0.08619173262972735, 'fraction_numerical': 0.0008795074758135445, 'mean_word_length': 3.934924078091106, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '4427538', 'n_tokens_mistral': 713, 'n_tokens_neox': 681, 'n_words': 196}