An independent node with the same behaviour and fresh state.
Same mode, operator, thresholds, function and coefficient array as the array stands now, so a state-bearing kernel's clone continues from the current state. History, saved state and hooks are not copied. The input node, if any, is shared, and so is closure state captured by a function; the coefficient array is the state that is not.
Attach one clone per channel instead of one node to several.
133{
134 std::shared_ptr<Logic>
copy;
135
140 break;
143 break;
146 break;
149 break;
150 }
151 }
152
153 if (!copy) {
159 break;
162 break;
165 break;
169 copy->m_multi_input_function =
copy->default_multi_input_function();
170 copy->m_default_multi_input =
true;
171 }
172 break;
173 }
174 }
175
184}
SequentialFunction m_sequential_function
Function for sequential mode.
TemporalFunction m_temporal_function
Function for temporal mode.
DirectFunction m_direct_function
Function for direct mode.
CoefSequentialFunction m_coef_sequential_function
The function behind m_sequential_function while bound.
CoefDirectFunction m_coef_direct_function
The function behind m_direct_function while bound.
std::vector< std::shared_ptr< Node > > m_input_nodes
Nodes feeding the input slots in parallel input mode.
size_t m_history_size
Maximum size of the history buffer.
EdgeType m_edge_type
Type of edge to detect.
Logic(double threshold=0.5)
Constructs a Logic node with threshold quantization.
double m_threshold
Threshold for boolean conversion.
double m_high_threshold
High threshold for hysteresis.
CoefTemporalFunction m_coef_temporal_function
The function behind m_temporal_function while bound.
std::vector< double > m_coefficients
Coefficient array handed to coefficient-aware functions.
bool m_coef_bound
True while the active mode runs a coefficient function.
std::shared_ptr< Node > m_input_node
Input node for processing.
LogicOperator m_operator
Current logic operator.
bool m_default_multi_input
True while the parallel function is the built in all-above-threshold one.
double m_low_threshold
Low threshold for hysteresis.
MultiInputFunction m_multi_input_function
Function for recursive/feedforward mode.
CoefMultiInputFunction m_coef_multi_function
The function behind m_multi_input_function while bound.
LogicMode m_mode
Current processing mode.
size_t m_input_count
Expected number of inputs for multi-input mode.
@ SEQUENTIAL
State-based evaluation using history of inputs (sequential logic)
@ DIRECT
Stateless evaluation of current input only (combinational logic)
@ TEMPORAL
Time-dependent evaluation with timing constraints.
@ MULTI_INPUT
Parallel evaluation of multiple input signals.
@ CUSTOM
User-defined boolean function.
CopiedText copy(std::string_view text, const LayoutResult &layout, size_t a, size_t b)
Copy a byte range: the text it spans, and the quads that render it.