Current value.
71 {
72 if (
const auto* constant = std::get_if<double>(&
m_value)) {
74 }
75 if (
const auto* node = std::get_if<std::shared_ptr<Node>>(&
m_value)) {
76 return *node ? (*node)->get_last_output() : 0.0;
77 }
78 if (
const auto*
index = std::get_if<NetworkIndex>(&
m_value)) {
79 return index->network ?
index->network->get_node_output(
index->index).value_or(0.0) : 0.0;
80 }
81 const auto& function = std::get<Function>(
m_value);
82 return function ? function() : 0.0;
83 }
std::variant< double, std::shared_ptr< Node >, NetworkIndex, Function > m_value
Tendency< D, R > constant(R value)
Tendency returning a fixed value regardless of input.