feat(policy network stack): Policies can now return the network stack
Policies can now return the network stack which allows the caller more control over settings and running a solver against various levels of the stack. Further, policies can return the partition function used as well as a vector of enums which describe the structure of the network stack.
This commit is contained in:
@@ -55,7 +55,6 @@ namespace gridfire::policy {
|
||||
);
|
||||
|
||||
auto& graphRepr = dynamic_cast<GraphEngine&>(*m_network_stack.back().get());
|
||||
// graphRepr.setPrecomputation(false);
|
||||
graphRepr.setUseReverseReactions(false);
|
||||
|
||||
|
||||
@@ -97,6 +96,25 @@ namespace gridfire::policy {
|
||||
return m_status;
|
||||
}
|
||||
|
||||
const std::vector<std::unique_ptr<DynamicEngine>> &MainSequencePolicy::get_engine_stack() const {
|
||||
if (m_status != NetworkPolicyStatus::INITIALIZED_VERIFIED) {
|
||||
throw exceptions::PolicyError("Cannot get engine stack from MainSequencePolicy: Policy is not initialized and verified. Call construct() first.");
|
||||
}
|
||||
return m_network_stack;
|
||||
}
|
||||
|
||||
std::vector<EngineTypes> MainSequencePolicy::get_engine_types_stack() const {
|
||||
return {
|
||||
EngineTypes::GRAPH_ENGINE,
|
||||
EngineTypes::MULTISCALE_PARTITIONING_ENGINE_VIEW,
|
||||
EngineTypes::ADAPTIVE_ENGINE_VIEW
|
||||
};
|
||||
}
|
||||
|
||||
const std::unique_ptr<partition::PartitionFunction>& MainSequencePolicy::get_partition_function() const {
|
||||
return m_partition_function;
|
||||
}
|
||||
|
||||
inline NetworkPolicyStatus MainSequencePolicy::check_status() const {
|
||||
for (const auto& species : m_seed_species) {
|
||||
if (!m_initializing_composition.contains(species)) {
|
||||
|
||||
Reference in New Issue
Block a user