Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/BirdbrainEngineer/lenia_ca
/ functions
Functions
81 in github.com/BirdbrainEngineer/lenia_ca
⨍
Functions
81
◇
Types & classes
12
↓ 24 callers
Method
shape
Get the shape of the channels and convolution channels of the `Lenia` instance.
src/lib.rs:745
↓ 10 callers
Method
channels
Get the number of channels initialized in the `Lenia` instance.
src/lib.rs:750
↓ 6 callers
Function
sample_normal
Samples the normal distribution where the peak (at `x = mu`) is 1. This is not suitable for use as a gaussian probability density function! ### Param
src/lib.rs:127
↓ 5 callers
Function
euclidean_dist
Euclidean distance between points `a` and `b`.
src/lib.rs:137
↓ 5 callers
Method
transform
(&mut self, data: &mut [Complex<f64>])
src/fft.rs:60
↓ 4 callers
Method
conv_channels
(&self)
src/lenias.rs:204
↓ 4 callers
Function
sigmoid
Sigmoid function.
src/growth_functions.rs:135
↓ 3 callers
Method
get_convoluted_as_ref
(&self, conv_channel: usize)
src/lenias.rs:184
↓ 3 callers
Method
inverse
(&self)
src/fft.rs:49
↓ 2 callers
Function
pass
Generates a kernel base of a single pixel with n-dimensions.
src/kernels.rs:310
↓ 2 callers
Method
shape
(&self)
src/fft.rs:95
↓ 1 callers
Function
c
Refer to Lenia paper or someone more versed in mathematics, I have no clue... I just translated the math into code...
src/kernels.rs:261
↓ 1 callers
Method
convolution_channels
Get the number of convolution channels initialized in the `Lenia` instance.
src/lib.rs:755
↓ 1 callers
Function
gaussian_donut_2d
Generates a kernel base of a gaussian donut in 2d. The mean (position of the highest value) is placed at `0.5` in the range `[0.0..1.0]`, where `0.0`
src/kernels.rs:20
↓ 1 callers
Method
get_channel_as_mut_ref
Mutable version of `get_channel_as_ref()`.
src/lib.rs:621
↓ 1 callers
Method
get_grown_as_ref
(&self, conv_channel: usize)
src/lenias.rs:188
↓ 1 callers
Method
get_high
(&self)
src/lib.rs:112
↓ 1 callers
Method
get_low
(&self)
src/lib.rs:109
↓ 1 callers
Function
nested_png_export
(bit_depth: png::BitDepth, path: String, data: &ndarray::ArrayD<f64>, indexes: &mut Vec<usize>, current_axis:
src/lib.rs:290
↓ 1 callers
Method
set_conv_channels
(&mut self, num_conv_channels: usize)
src/lenias.rs:143
↓ 1 callers
Method
set_growth
(&mut self, f: fn(f64, &[f64]) -> f64, growth_params: Vec<f64>, conv_channel: usize)
src/lenias.rs:159
↓ 1 callers
Method
set_high
(&mut self, value: u8)
src/lib.rs:97
↓ 1 callers
Method
set_low
(&mut self, value: u8)
src/lib.rs:93
↓ 1 callers
Method
set_source_channel
(&mut self, conv_channel: usize, src_channel: usize)
src/lenias.rs:147
↓ 1 callers
Method
shape
(&self)
src/lenias.rs:168
Method
channels
(&self)
src/lenias.rs:200
Function
conway_game_of_life
Conway's "Game of life" growth function. `Rulestring: B3/S23`
src/growth_functions.rs:83
Function
conway_game_of_life
Moore neighborhood with radius of 1 in 2D. This is the kernel to use for Conway's game of life.
src/kernels.rs:273
Method
dt
(&self)
src/lenias.rs:196
Method
dt
Get the current integration step (a.k.a. timestep) parameter `dt` of the `Lenia` instance.
src/lib.rs:740
Function
export_frame_as_png
Export a frame as a png or a bunch of png-s if multidimensional. The function returns a `JoinHandle` because the exporting takes place on a separate
src/lib.rs:268
Method
fill_channel
Fills a channel with user data. The shapes of the `data` and the channel(s) in the `Lenia` instance must be the same. ### Parameters `data` - Refer
src/lib.rs:592
Method
fmt
(&self, f: &mut fmt::Formatter<'_>)
src/lib.rs:860
Method
fmt
(&self, f: &mut fmt::Formatter<'_>)
src/fft.rs:20
Method
from
Creates a new Kernel struct from an n-dimensional array (`ndarray::ArrayD<f64>`). Creates the normalized version of the kernel. Creates a version of
src/lib.rs:910
Function
gaussian_donut_nd
Generates a kernel base of a gaussian donut in n-dimensions. The mean (position of the highest value) is placed at `0.5` in the range `[0.0..1.0]`, w
src/kernels.rs:101
Method
get_activated_as_ref
Retrieve a reference to the specified convolution channel's "activations". Activations are the results from passing the convolution results through t
src/lib.rs:723
Method
get_channel_as_mut_ref
(&mut self, channel: usize)
src/lenias.rs:180
Method
get_channel_as_ref
(&self, channel: usize)
src/lenias.rs:172
Method
get_channel_as_ref
Retrieve a referenced to the specified channel's data. ### Parameters `channel` - Index of the channel to get a reference from. ### Panics If the
src/lib.rs:613
Method
get_convoluted
Exists for backwards-compatibility with `lenia_ca 0.1.0`; use `get_convolved()` instead. Retrieves a `convolution_channel`'s convoution result and ex
src/lib.rs:664
Method
get_convolved
Retrieves a `convolution_channel`'s convoution result and extracts only the real component. Convolution result is also called the "potential distribu
src/lib.rs:683
Method
get_convolved_as_ref
Retrieve a reference to the specified convolution channel's convolution result. Convolution result is also called the "potential distribution". Note
src/lib.rs:704
Method
get_deltas_as_ref
(&self, channel: usize)
src/lenias.rs:192
Method
get_deltas_as_ref
Retrieve a reference to the specified channel's "deltas". Deltas are the amounts added onto the previous iteration's result to get the current iterat
src/lib.rs:643
Function
get_frame
Extract data from n-dimensional array into a 2-dimensional array. Extract a 2d array (`ndarray::Array2`) of `f64` values of a 2d slice of a channel's
src/lib.rs:160
Method
get_kernel_as_ref
(&self, conv_channel: usize)
src/lenias.rs:176
Method
get_kernel_as_ref
Retrieve the kernel being used for the specified convolution channels' convolution. ### Parameters `convolution_channel` - Index of the convolution
src/lib.rs:735
Method
iterate
(&mut self)
src/lenias.rs:107
Method
iterate
Performs a single iteration of the `Lenia` instance. Channels are updated with the resulting new state of the simulation.
src/lib.rs:574
Method
length
(&self)
src/fft.rs:56
Function
load_from_png
Loads a png into an `ndarray`. ### Parameters `file_path` - Path to the 2d slice of a frame to load. ### Panics If the bit-depth of the png is les
src/lib.rs:203
Function
multi_gaussian_donut_2d
Generates a kernel base of multiple concentric gaussian "donuts" in 2d. Each donut/ring is a single index in the list of parameters. ### Parameters
src/kernels.rs:60
Function
multi_gaussian_donut_nd
Generates a kernel base of multiple radial gaussian "hyper-donuts" in n-dimensions. Each donut/ring is a single index in the list of parameters. ###
src/kernels.rs:146
Function
multimodal_normal
Multimodal "gaussian bumps" growth function. While the Lenia paper calls for a unimodal growth function, then strictly speaking, there are no rules!
src/growth_functions.rs:31
Method
new
Create and initialize a new instance of "Standard Lenia". This version of Lenia can have only a single channel and a single convolution channel and w
src/lenias.rs:65
Method
new
Initialize a Lenia simulator. Barring wanting to change the type of the `Lenia` instance used by the `Simulator`, this should ever need to be called
src/lib.rs:385
Method
new
(length: usize, inverse: bool)
src/fft.rs:29
Function
pass
Pass number on virtually unchanged. Returns `num` multiplied by `params[0]`. Use this growth function if you would like to not use a growth function,
src/growth_functions.rs:143
Function
polynomial
Standard unimodal "polynomial bump". ### Parameters `params[0]` - mu `params[1]` - sigma `params[2]` - alpha
src/growth_functions.rs:48
Function
polynomial_nd
Generates a kernel base of "polynomial donuts". The peaks of the individual rings are equally spaced around the center of the kernel. Refer to Lenia
src/kernels.rs:227
Function
precalculated_linear
Samples from a precalculated distribution. The distribution is made of evenly spaced points from `0.0` to `1.0`. In the likely event of the sample fa
src/growth_functions.rs:71
Function
precalculated_linear
Generates a kernel base of a radially symmetric sampling of precalculated values. ### Parameters `radius` - Radius of the kernel field to generate.
src/kernels.rs:189
Method
remake
Re-initialize a Lenia simulator. Re-initializes the `Lenia` instance, losing **all** of the previous changes, such as kernel changes, channel additio
src/lib.rs:413
Function
sample_exponential
(x: f64, exponent: f64, peak: f64)
src/lib.rs:132
Method
set_channels
(&mut self, num_channels: usize)
src/lenias.rs:139
Method
set_channels
Set the number of channels in the `Lenia` instance. In case the number of channels is less than the current number of channels, it is up to the user
src/lib.rs:440
Method
set_convolution_channel_source
Set the source channel a given convolution channel should act on. ### Parameters `convolution_channel` - The convolution channel which will have its
src/lib.rs:488
Method
set_convolution_channels
Set the number of convolution channels in the `Lenia` instance. If the new number of convolution channels is less than currently, then any convolutio
src/lib.rs:466
Method
set_dt
(&mut self, new_dt: f64)
src/lenias.rs:164
Method
set_dt
Set the integration step (a.k.a. timestep) parameter `dt` of the `Lenia` instance. ### Parameters `dt` - The new dt value for the `Lenia` instance t
src/lib.rs:567
Method
set_growth_function
Set the growth function and its parameters of the specified convolution channel. ### Parameters `f` - Growth function to use. `growth_parameters` -
src/lib.rs:537
Method
set_kernel
(&mut self, kernel: ndarray::ArrayD<f64>, conv_channel: usize)
src/lenias.rs:155
Method
set_kernel
Set and make the kernel of the specified convolution channel. ### Parameters `kernel` - n-dimensional array (`ndarray::ArrayD<f64>`), where the numb
src/lib.rs:513
Method
set_weights
(&mut self, new_weights: &[f64], conv_channel: usize)
src/lenias.rs:151
Method
set_weights
Set the convolution channel weights for a specific channel. If the length of weights is greater than the number of convolution channels, then the spa
src/lib.rs:558
Function
smooth_life
Basic Smooth Life growth function. Not faithful to proper SmoothLife, and is not capable of simulating every SmoothLife. `params[0]` - Birth range s
src/growth_functions.rs:101
Function
smooth_life_sigmoid_smoothed
Smooth Life growth function with smoothed stepping. Not faithful to proper SmoothLife and is not capable of simulating every SmoothLife. Step width
src/growth_functions.rs:126
Function
smoothlife
Generates a kernel base of a "SmoothLife" outer kernel. Not completely faithful to SmoothLife. ### Parameters `radius` - Radius of the kernel to ge
src/kernels.rs:291
Function
standard_lenia
Standard unimodal "gaussian bump". ### Parameters `params[0]` - **mu**: The position of the mean / highest point of the growth function. `params[1]
src/growth_functions.rs:16
Method
weights
(&self, channel: usize)
src/lenias.rs:208