Processes a single input sample through the logic function.
Evaluates the input according to the configured logic operation and computational model, producing a binary output (0.0 or 1.0).
113{
114 bool result = false;
116
122 } else {
125 }
126 }
127
130
135 result = current_bool;
136 break;
137
143 }
145 break;
146
149 if (current_bool != previous_bool_input) {
153 break;
156 break;
159 break;
160 }
161 }
163 break;
164 }
165
167 result = current_bool && previous_bool;
168 break;
169
171 result = current_bool || previous_bool;
172 break;
173
175 result = current_bool != previous_bool;
176 break;
177
179 result = !current_bool;
180 break;
181
183 result = !(current_bool && previous_bool);
184 break;
185
187 result = !(current_bool || previous_bool);
188 break;
189
192 break;
193
194 default:
195 result = current_bool;
196 }
197 break;
198
204 break;
205 }
206
210 break;
211 }
212
216 break;
217 }
218 }
219
221 auto current = result ? 1.0 : 0.0;
222
226 }
227
231 }
232
235}
SequentialFunction m_sequential_function
Function for sequential mode.
TemporalFunction m_temporal_function
Function for temporal mode.
DirectFunction m_direct_function
Function for direct mode.
EdgeType m_edge_type
Type of edge to detect.
double m_threshold
Threshold for boolean conversion.
double m_temporal_time
Time tracking for temporal mode.
double m_high_threshold
High threshold for hysteresis.
double m_input
Current input value for multi-input mode.
std::vector< double > m_input_buffer
std::shared_ptr< Node > m_input_node
Input node for processing.
LogicOperator m_operator
Current logic operator.
void history_push(bool val)
double m_low_threshold
Low threshold for hysteresis.
MultiInputFunction m_multi_input_function
Function for recursive/feedforward mode.
bool m_edge_detected
Whether an edge was detected in the last processing.
bool m_hysteresis_state
State for hysteresis operator.
LogicMode m_mode
Current processing mode.
std::span< bool > history_linearized_view()
void notify_tick(double value) override
Notifies all registered callbacks about a new sample.
void add_input(double input, size_t index)
bool m_state_saved
tracks if the node's state has been saved by a snapshot operation
bool m_networked_node
Flag indicating if the node is part of a NodeNetwork This flag is used to disable event firing when t...
double m_last_output
The most recent sample value generated by this oscillator.
bool m_fire_events_during_snapshot
Internal flag controlling whether notify_tick fires during state snapshots Default: false (events don...
uint32_t get_sample_rate()
Gets the sample rate from the default engine.
@ FALLING
High-to-low transition (1→0)
@ BOTH
Any state transition.
@ RISING
Low-to-high transition (0→1)
@ 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.
@ NOT
Logical NOT - inverts the input.
@ NOR
Logical NOR - inverted OR operation.
@ OR
Logical OR - true when any input is true.
@ NAND
Logical NAND - inverted AND operation.
@ THRESHOLD
Binary quantization - true when input exceeds threshold.
@ AND
Logical AND - true only when all inputs are true.
@ EDGE
Transition detector - identifies state changes.
@ HYSTERESIS
Threshold with memory - prevents rapid oscillation at boundary.
@ CUSTOM
User-defined boolean function.
@ XOR
Logical XOR - true when odd number of inputs are true.
void atomic_add_flag(std::atomic< Utils::NodeState > &state, Utils::NodeState flag)
Atomically adds a flag to a node state.
void try_reset_processed_state(std::shared_ptr< Node > node)
Attempts to reset the processed state of a node.
void atomic_inc_modulator_count(std::atomic< uint32_t > &count, int amount)
Atomically increments the modulator count by a specified amount.
void atomic_dec_modulator_count(std::atomic< uint32_t > &count, int amount)
Atomically decrements the modulator count by a specified amount.
@ PROCESSED
Node has been processed this cycle.