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).
116{
117 bool result = false;
119
125 } else {
128 }
129 }
130
133
138 result = current_bool;
139 break;
140
146 }
148 break;
149
152 if (current_bool != previous_bool_input) {
156 break;
159 break;
162 break;
163 }
164 }
166 break;
167 }
168
170 result = current_bool && previous_bool;
171 break;
172
174 result = current_bool || previous_bool;
175 break;
176
178 result = current_bool != previous_bool;
179 break;
180
182 result = !current_bool;
183 break;
184
186 result = !(current_bool && previous_bool);
187 break;
188
190 result = !(current_bool || previous_bool);
191 break;
192
195 break;
196
197 default:
198 result = current_bool;
199 }
200 break;
201
207 }
209 break;
210 }
211
215 break;
216 }
217
221 break;
222 }
223 }
224
226 auto current = result ? 1.0 : 0.0;
227
230
234 }
235
238}
SequentialFunction m_sequential_function
Function for sequential mode.
TemporalFunction m_temporal_function
Function for temporal mode.
DirectFunction m_direct_function
Function for direct mode.
size_t m_history_size
Maximum size of the history buffer.
EdgeType m_edge_type
Type of edge to detect.
double m_threshold
Threshold for boolean conversion.
std::deque< bool > m_history
Buffer of input values for feedforward mode.
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.
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.
void notify_tick(double value) override
Notifies all registered callbacks about a new sample.
void add_input(double input, size_t index)
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.