155{
156 if (num_samples == 0) {
157 return;
158 }
159
160 const size_t available = input_data.size();
162 const auto count =
static_cast<std::ptrdiff_t
>(num_samples);
163
164 m_cells.assign(num_samples, 0);
167
168 for (size_t i = 0; i < num_samples; ++i) {
169 uint8_t cell = (i < available && input_data[i] > 0.0) ? 1 : 0;
172 }
174 }
175
176 for (
size_t generation = 0; generation <
m_generations; ++generation) {
177 for (std::ptrdiff_t i = 0; i <
count; ++i) {
178 for (
size_t k = 0; k <
width; ++k) {
179 std::ptrdiff_t
at = i +
static_cast<std::ptrdiff_t
>(
m_radius) -
static_cast<std::ptrdiff_t
>(k);
180 double cell = 0.0;
181 if (at >= 0 && at <
count) {
186 }
188 }
190 }
192 }
193
194 for (size_t i = 0; i < num_samples; ++i) {
196 }
199 }
200}
std::vector< double > m_slots
Input slots handed to the node.
size_t m_generations
Automaton steps per block, 0 when off.
std::vector< double > m_logic_data
Stored logic processing results.
bool m_wrap
Whether the automaton's block ends meet.
std::vector< uint8_t > m_next_cells
Automaton cells of the next generation.
std::vector< uint8_t > m_previous_cells
Last automaton result, kept when memory is on.
std::vector< uint8_t > m_cells
Automaton cells.
size_t m_radius
Neighbourhood radius of the automaton.
std::shared_ptr< Nodes::Generator::Logic > m_logic
Logic node for processing.
bool m_memory
Whether blocks perturb the previous automaton result.