32 static constexpr const char* TEMPLATE_RANDOM_ENTRY =
33 "Functions: {path_a} AND {path_b}. Similarity: {similarity} ";
36 double minimum_similarity;
37 double maximum_similarity;
38 double maximum_quantity;
40 const int seed = 123456789;
41 std::mt19937 rng = std::mt19937(seed);
54 std::vector<SimilarPair> get_similarity_pairs_filtered();
61 std::vector<SimilarPair> make_random_selection(std::vector<SimilarPair> path_pairs);
67 void print_path_pairs(std::vector<SimilarPair> path_pairs);
77 "Select random pairs of functions within a specified similarity range. "
78 "The provided MIN_SIMILARITY and MAX_SIMILARITY parameters define the "
79 "inclusive similarity interval, and up to MAX_QUANTITY pairs are randomly "
80 "selected and displayed.")
const CliOption * options() const final
Random pair selector for similar code segments.
bool validate(const ParsedOptions &options) override
Validate the arguments already analyzed.
bool run(const ParsedOptions &options) override
Handles random selection command.
static constexpr CliOption options_[]
COMMAND_DESCRIPTION("Select random pairs of functions within a specified similarity range. " "The provided MIN_SIMILARITY and MAX_SIMILARITY parameters define the " "inclusive similarity interval, and up to MAX_QUANTITY pairs are randomly " "selected and displayed.") explicit RandomSelector(Similarity_Table *_similarity_table)
Constructs selector with configuration.
Represents a similarity graph between functions (paths).
#define OPTION_END
This marks the end of a long array of options.
Logical path abstraction for source code elements.
Similarity relationships storage and analysis.