feat(network): added ReaclibNetwork and functions to build network

This commit is contained in:
2025-06-18 15:22:58 -04:00
parent cbaab3d04c
commit d00e5646e7
5 changed files with 8890 additions and 8824 deletions

View File

@@ -26,6 +26,7 @@
#include "config.h"
#include "quill/Logger.h"
#include "composition.h"
#include "reaclib.h"
#include <unordered_map>
namespace serif::network {
@@ -105,7 +106,7 @@ namespace serif::network {
explicit Network(const NetworkFormat format = NetworkFormat::APPROX8);
virtual ~Network() = default;
NetworkFormat getFormat() const;
[[nodiscard]] NetworkFormat getFormat() const;
NetworkFormat setFormat(const NetworkFormat format);
/**
@@ -124,6 +125,19 @@ namespace serif::network {
NetworkFormat m_format; ///< Format of the network
};
class ReaclibNetwork final : public Network {
public:
explicit ReaclibNetwork(const NetworkFormat format = NetworkFormat::APPROX8);
explicit ReaclibNetwork(serif::composition::Composition composition, const NetworkFormat format = NetworkFormat::APPROX8);
NetOut evaluate(const NetIn &netIn) override;
private:
serif::network::reaclib::REACLIBReactionSet m_reactions; ///< Set of REACLIB reactions
};
serif::network::reaclib::REACLIBReactionSet build_reaclib_nuclear_network(const serif::composition::Composition &composition);
serif::network::reaclib::REACLIBReactionSet build_reaclib_nuclear_network(const serif::composition::Composition &composition, double culling, double T9 = 1.0);
} // namespace nuclearNetwork