feat(policy): began addition of robust policy system

The policy system provides a way for users to ensure that they get a network with certain traits. For example being sure that the network they get has all of the proton proton reactions in its base reaction set. This is an extensible system which is intended to be used by researchers to build various determanistic network policies to make network results more reproducable
This commit is contained in:
2025-11-05 12:48:08 -05:00
parent 9bc6e9b0d4
commit 9fdbb57996
7 changed files with 406 additions and 1 deletions

View File

@@ -900,7 +900,6 @@ namespace gridfire {
const double rho,
const SparsityPattern &sparsityPattern
) const {
//TODO: The issue now seems to be that the jacobian is returning all zeros. I need to sort out why this is
SparsityPattern intersectionSparsityPattern;
for (const auto& entry : sparsityPattern) {
if (m_full_sparsity_set.contains(entry)) {

View File

@@ -417,6 +417,13 @@ namespace gridfire::reaction {
}
}
std::optional<std::unique_ptr<Reaction>> ReactionSet::get(const std::string_view &id) const {
if (!contains(id)) {
return std::nullopt;
}
return std::make_optional(m_reactions[m_reactionNameMap.at(std::string(id))]->clone());
}
void ReactionSet::remove_reaction(const Reaction& reaction) {
const auto reaction_id = std::string(reaction.id());
if (!m_reactionNameMap.contains(reaction_id)) {