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:
@@ -1,4 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "gridfire/engine/types/building.h"
|
||||
#include "gridfire/engine/types/reporting.h"
|
||||
#include "gridfire/engine/types/reporting.h"
|
||||
|
||||
namespace gridfire {
|
||||
enum class EngineTypes {
|
||||
GRAPH_ENGINE,
|
||||
ADAPTIVE_ENGINE_VIEW,
|
||||
MULTISCALE_PARTITIONING_ENGINE_VIEW,
|
||||
PRIMING_ENGINE_VIEW,
|
||||
DEFINED_ENGINE_VIEW,
|
||||
FILE_DEFINED_ENGINE_VIEW
|
||||
};
|
||||
|
||||
inline std::string engine_type_to_string(const EngineTypes type) {
|
||||
switch (type) {
|
||||
case EngineTypes::GRAPH_ENGINE:
|
||||
return "GraphEngine";
|
||||
case EngineTypes::ADAPTIVE_ENGINE_VIEW:
|
||||
return "AdaptiveEngineView";
|
||||
case EngineTypes::MULTISCALE_PARTITIONING_ENGINE_VIEW:
|
||||
return "MultiscalePartitioningEngineView";
|
||||
case EngineTypes::PRIMING_ENGINE_VIEW:
|
||||
return "PrimingEngineView";
|
||||
case EngineTypes::DEFINED_ENGINE_VIEW:
|
||||
return "DefinedEngineView";
|
||||
case EngineTypes::FILE_DEFINED_ENGINE_VIEW:
|
||||
return "FileDefinedEngineView";
|
||||
}
|
||||
return "UnknownEngineType";
|
||||
}
|
||||
}
|
||||
@@ -24,10 +24,13 @@
|
||||
#include "fourdst/atomic/atomicSpecies.h"
|
||||
#include "gridfire/reaction/reaction.h"
|
||||
#include "gridfire/engine/engine_abstract.h"
|
||||
#include "gridfire/partition/partition.h"
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
#include "gridfire/engine/types/engine_types.h"
|
||||
|
||||
|
||||
namespace gridfire::policy {
|
||||
/**
|
||||
@@ -157,6 +160,12 @@ namespace gridfire::policy {
|
||||
* @endcode
|
||||
*/
|
||||
[[nodiscard]] virtual NetworkPolicyStatus getStatus() const = 0;
|
||||
|
||||
[[nodiscard]] virtual const std::vector<std::unique_ptr<DynamicEngine>> &get_engine_stack() const = 0;
|
||||
|
||||
[[nodiscard]] virtual std::vector<EngineTypes> get_engine_types_stack() const = 0;
|
||||
|
||||
[[nodiscard]] virtual const std::unique_ptr<partition::PartitionFunction>& get_partition_function() const = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -142,6 +142,12 @@ namespace gridfire::policy {
|
||||
* @return NetworkPolicyStatus The construction and verification status.
|
||||
*/
|
||||
[[nodiscard]] NetworkPolicyStatus getStatus() const override;
|
||||
|
||||
[[nodiscard]] const std::vector<std::unique_ptr<DynamicEngine>> &get_engine_stack() const override;
|
||||
|
||||
[[nodiscard]] std::vector<EngineTypes> get_engine_types_stack() const override;
|
||||
[[nodiscard]] const std::unique_ptr<partition::PartitionFunction>& get_partition_function() const override;
|
||||
|
||||
private:
|
||||
std::set<fourdst::atomic::Species> m_seed_species;
|
||||
|
||||
@@ -155,6 +161,8 @@ namespace gridfire::policy {
|
||||
static std::unique_ptr<partition::PartitionFunction> build_partition_function();
|
||||
[[nodiscard]] NetworkPolicyStatus check_status() const;
|
||||
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user