From ec0fb04f7bdfdacda889695a35ca6cdcddea84c8 Mon Sep 17 00:00:00 2001 From: Maddie Busig Date: Tue, 6 May 2025 23:57:24 -0700 Subject: [PATCH] Add axiom to ruleset --- include/fractal.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/fractal.hpp b/include/fractal.hpp index 6e5e75f..db5c5bc 100644 --- a/include/fractal.hpp +++ b/include/fractal.hpp @@ -100,7 +100,10 @@ private: etl::vector m_branch_rules; + group_id_t m_axiom = 0; + public: + /** * @brief Checks if the maximum number of tokens has been reached * @@ -219,6 +222,14 @@ public: */ branch_rule_id_t add_branch_rule_weighted(token_id_t match, weighted_group_id_t wgroup); + /** @brief Sets the axiom + * + * @exception @c mtl::invalid_argument if an invalid group ID was supplied + */ + void set_axiom(group_id_t axiom) { + m_axiom = valid_group_characteristic(axiom) ? axiom : throw mtl::invalid_argument(); + } + group_id_t get_axiom() const { return m_axiom; } };