Skip to main content

helpers Namespace

Definition

namespace simaai::neat::graph::helpers { ... }

Functions Index

NodeIdadd_pipeline (Graph &g, simaai::neat::NodeGroup group, std::string label={})

Wrap a NodeGroup in a PipelineNode and add it to the graph. More...

NodeIdadd_pipeline (Graph &g, std::shared_ptr< simaai::neat::Node > node, std::string label={})

Wrap a builder-Node in a PipelineNode and add it to the graph. More...

GraphRunbuild (Graph g, const GraphRunOptions &opt={})

Compile a Graph into a runnable GraphRun via a transient GraphSession. More...

voidchain (Graph &g, const std::vector< NodeId > &nodes)

Connect a sequence of nodes end-to-end (each nodes[i-1] -> nodes[i]). More...

voidchain (Graph &g, std::initializer_list< NodeId > nodes)

Initializer-list overload of chain for inline node sequences. More...

Functions

add_pipeline()

NodeId simaai::neat::graph::helpers::add_pipeline (Graph & g, simaai::neat::NodeGroup group, std::string label={})
inline

Wrap a NodeGroup in a PipelineNode and add it to the graph.

Definition at line 19 of file GraphHelpers.h.

19inline NodeId add_pipeline(Graph& g, simaai::neat::NodeGroup group, std::string label = {}) {
20 auto node = std::make_shared<simaai::neat::graph::nodes::PipelineNode>(std::move(group),
21 std::move(label));
22 return g.add(std::move(node));
23}

add_pipeline()

NodeId simaai::neat::graph::helpers::add_pipeline (Graph & g, std::shared_ptr< simaai::neat::Node > node, std::string label={})
inline

Wrap a builder-Node in a PipelineNode and add it to the graph.

Definition at line 26 of file GraphHelpers.h.

26inline NodeId add_pipeline(Graph& g, std::shared_ptr<simaai::neat::Node> node,
27 std::string label = {}) {
28 auto wrapper =
29 std::make_shared<simaai::neat::graph::nodes::PipelineNode>(std::move(node), std::move(label));
30 return g.add(std::move(wrapper));
31}

build()

GraphRun simaai::neat::graph::helpers::build (Graph g, const GraphRunOptions & opt={})
inline

Compile a Graph into a runnable GraphRun via a transient GraphSession.

Definition at line 34 of file GraphHelpers.h.

34inline GraphRun build(Graph g, const GraphRunOptions& opt = {}) {
35 GraphSession session(std::move(g));
36 return session.build(opt);
37}

chain()

void simaai::neat::graph::helpers::chain (Graph & g, const std::vector< NodeId > & nodes)
inline

Connect a sequence of nodes end-to-end (each nodes[i-1] -> nodes[i]).

Definition at line 40 of file GraphHelpers.h.

40inline void chain(Graph& g, const std::vector<NodeId>& nodes) {
41 if (nodes.size() < 2)
42 return;
43 for (std::size_t i = 1; i < nodes.size(); ++i) {
44 g.connect(nodes[i - 1], nodes[i]);
45 }
46}

chain()

void simaai::neat::graph::helpers::chain (Graph & g, std::initializer_list< NodeId > nodes)
inline

Initializer-list overload of chain for inline node sequences.

Definition at line 49 of file GraphHelpers.h.

49inline void chain(Graph& g, std::initializer_list<NodeId> nodes) {
50 chain(g, std::vector<NodeId>(nodes));
51}

The documentation for this namespace was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.