19#include <nlohmann/json.hpp>
22#include <yaml-cpp/yaml.h>
74 std::vector<IntrospectionEdge>
edges;
82 [[nodiscard]] nlohmann::json
ToJSON()
const {
84 j[
"summary"][
"total_edges"] =
edges.size();
87 j[
"edges"] = nlohmann::json::array();
88 for (
const auto &edge :
edges) {
90 jedge[
"source"] = edge.source;
91 jedge[
"target"] = edge.target;
93 j[
"edges"].push_back(jedge);
111 out << YAML::BeginMap;
114 out << YAML::Key <<
"summary" << YAML::Value << YAML::BeginMap;
115 out << YAML::Key <<
"total_outputs" << YAML::Value <<
dictionary.total_outputs;
116 out << YAML::Key <<
"total_inputs" << YAML::Value <<
dictionary.total_inputs;
117 out << YAML::Key <<
"total_parameters" << YAML::Value <<
dictionary.total_parameters;
118 out << YAML::Key <<
"total_config" << YAML::Value <<
dictionary.total_config;
119 out << YAML::Key <<
"integrable_states" << YAML::Value <<
dictionary.integrable_states;
120 out << YAML::Key <<
"unwired_inputs" << YAML::Value <<
dictionary.unwired_inputs;
121 out << YAML::Key <<
"total_edges" << YAML::Value <<
edges.size();
127 out << YAML::Key <<
"edges" << YAML::Value << YAML::BeginSeq;
128 for (
const auto &edge :
edges) {
129 out << YAML::BeginMap;
130 out << YAML::Key <<
"source" << YAML::Value << edge.source;
131 out << YAML::Key <<
"target" << YAML::Value << edge.target;
132 out << YAML::Key <<
"kind" << YAML::Value
Complete catalog of simulation interface.
void WriteToFile(const std::string &path, WriteFunc write_content)
Helper to write content to a file with error handling.
Definition DataDictionary.hpp:27
Definition AggregationTypes.hpp:13
EdgeKind
Edge classification for the introspection graph.
Definition IntrospectionGraph.hpp:29
@ Resolve
Implicit dependency via Backplane::resolve() (source binding).
Definition IntrospectionGraph.hpp:31
@ Route
Explicit SignalRouter connection (input_path <- output_path).
Definition IntrospectionGraph.hpp:30
Complete catalog of simulation interface.
Definition DataDictionary.hpp:45
A single directed edge in the introspection graph.
Definition IntrospectionGraph.hpp:37
EdgeKind kind
Edge classification.
Definition IntrospectionGraph.hpp:40
std::string target
Target: signal path (routes) or component name (resolves).
Definition IntrospectionGraph.hpp:39
std::string source
Source signal path (e.g., "Rocket.Engine.force.x").
Definition IntrospectionGraph.hpp:38
Complete introspection graph: nodes (components) + typed edges.
Definition IntrospectionGraph.hpp:69
DataDictionary dictionary
The existing data dictionary (component nodes with signal lists).
Definition IntrospectionGraph.hpp:71
nlohmann::json ToJSON() const
Serialize the full graph to JSON.
Definition IntrospectionGraph.hpp:82
void ToYAMLFile(const std::string &path) const
Write the full graph to a YAML file.
Definition IntrospectionGraph.hpp:109
std::vector< IntrospectionEdge > edges
All topology edges (routes + resolves).
Definition IntrospectionGraph.hpp:74
void ToJSONFile(const std::string &path) const
Write the full graph to a JSON file.
Definition IntrospectionGraph.hpp:102