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={})
NodeIdadd_pipeline (Graph &g, std::shared_ptr< simaai::neat::Node > node, std::string label={})
GraphRunbuild (Graph g, const GraphRunOptions &opt={})
voidchain (Graph &g, const std::vector< NodeId > &nodes)
voidchain (Graph &g, std::initializer_list< NodeId > nodes)

Functions

add_pipeline()

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

Definition at line 18 of file GraphHelpers.h.

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

add_pipeline()

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

Definition at line 24 of file GraphHelpers.h.

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

build()

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

Definition at line 31 of file GraphHelpers.h.

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

chain()

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

Definition at line 36 of file GraphHelpers.h.

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

chain()

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

Definition at line 44 of file GraphHelpers.h.

44inline void chain(Graph& g, std::initializer_list<NodeId> nodes) {
45 chain(g, std::vector<NodeId>(nodes));
46}

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.