MCPcopy Create free account

hub / github.com/BirdbrainEngineer/lenia_ca / functions

Functions81 in github.com/BirdbrainEngineer/lenia_ca

↓ 24 callersMethodshape
Get the shape of the channels and convolution channels of the `Lenia` instance.
src/lib.rs:745
↓ 10 callersMethodchannels
Get the number of channels initialized in the `Lenia` instance.
src/lib.rs:750
↓ 6 callersFunctionsample_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 callersFunctioneuclidean_dist
Euclidean distance between points `a` and `b`.
src/lib.rs:137
↓ 5 callersMethodtransform
(&mut self, data: &mut [Complex<f64>])
src/fft.rs:60
↓ 4 callersMethodconv_channels
(&self)
src/lenias.rs:204
↓ 4 callersFunctionsigmoid
Sigmoid function.
src/growth_functions.rs:135
↓ 3 callersMethodget_convoluted_as_ref
(&self, conv_channel: usize)
src/lenias.rs:184
↓ 3 callersMethodinverse
(&self)
src/fft.rs:49
↓ 2 callersFunctionpass
Generates a kernel base of a single pixel with n-dimensions.
src/kernels.rs:310
↓ 2 callersMethodshape
(&self)
src/fft.rs:95
↓ 1 callersFunctionc
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 callersMethodconvolution_channels
Get the number of convolution channels initialized in the `Lenia` instance.
src/lib.rs:755
↓ 1 callersFunctiongaussian_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 callersMethodget_channel_as_mut_ref
Mutable version of `get_channel_as_ref()`.
src/lib.rs:621
↓ 1 callersMethodget_grown_as_ref
(&self, conv_channel: usize)
src/lenias.rs:188
↓ 1 callersMethodget_high
(&self)
src/lib.rs:112
↓ 1 callersMethodget_low
(&self)
src/lib.rs:109
↓ 1 callersFunctionnested_png_export
(bit_depth: png::BitDepth, path: String, data: &ndarray::ArrayD<f64>, indexes: &mut Vec<usize>, current_axis:
src/lib.rs:290
↓ 1 callersMethodset_conv_channels
(&mut self, num_conv_channels: usize)
src/lenias.rs:143
↓ 1 callersMethodset_growth
(&mut self, f: fn(f64, &[f64]) -> f64, growth_params: Vec<f64>, conv_channel: usize)
src/lenias.rs:159
↓ 1 callersMethodset_high
(&mut self, value: u8)
src/lib.rs:97
↓ 1 callersMethodset_low
(&mut self, value: u8)
src/lib.rs:93
↓ 1 callersMethodset_source_channel
(&mut self, conv_channel: usize, src_channel: usize)
src/lenias.rs:147
↓ 1 callersMethodshape
(&self)
src/lenias.rs:168
Methodchannels
(&self)
src/lenias.rs:200
Functionconway_game_of_life
Conway's "Game of life" growth function. `Rulestring: B3/S23`
src/growth_functions.rs:83
Functionconway_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
Methoddt
(&self)
src/lenias.rs:196
Methoddt
Get the current integration step (a.k.a. timestep) parameter `dt` of the `Lenia` instance.
src/lib.rs:740
Functionexport_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
Methodfill_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
Methodfmt
(&self, f: &mut fmt::Formatter<'_>)
src/lib.rs:860
Methodfmt
(&self, f: &mut fmt::Formatter<'_>)
src/fft.rs:20
Methodfrom
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
Functiongaussian_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
Methodget_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
Methodget_channel_as_mut_ref
(&mut self, channel: usize)
src/lenias.rs:180
Methodget_channel_as_ref
(&self, channel: usize)
src/lenias.rs:172
Methodget_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
Methodget_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
Methodget_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
Methodget_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
Methodget_deltas_as_ref
(&self, channel: usize)
src/lenias.rs:192
Methodget_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
Functionget_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
Methodget_kernel_as_ref
(&self, conv_channel: usize)
src/lenias.rs:176
Methodget_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
Methoditerate
(&mut self)
src/lenias.rs:107
Methoditerate
Performs a single iteration of the `Lenia` instance. Channels are updated with the resulting new state of the simulation.
src/lib.rs:574
Methodlength
(&self)
src/fft.rs:56
Functionload_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
Functionmulti_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
Functionmulti_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
Functionmultimodal_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
Methodnew
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
Methodnew
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
Methodnew
(length: usize, inverse: bool)
src/fft.rs:29
Functionpass
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
Functionpolynomial
Standard unimodal "polynomial bump". ### Parameters `params[0]` - mu `params[1]` - sigma `params[2]` - alpha
src/growth_functions.rs:48
Functionpolynomial_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
Functionprecalculated_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
Functionprecalculated_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
Methodremake
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
Functionsample_exponential
(x: f64, exponent: f64, peak: f64)
src/lib.rs:132
Methodset_channels
(&mut self, num_channels: usize)
src/lenias.rs:139
Methodset_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
Methodset_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
Methodset_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
Methodset_dt
(&mut self, new_dt: f64)
src/lenias.rs:164
Methodset_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
Methodset_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
Methodset_kernel
(&mut self, kernel: ndarray::ArrayD<f64>, conv_channel: usize)
src/lenias.rs:155
Methodset_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
Methodset_weights
(&mut self, new_weights: &[f64], conv_channel: usize)
src/lenias.rs:151
Methodset_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
Functionsmooth_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
Functionsmooth_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
Functionsmoothlife
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
Functionstandard_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
Methodweights
(&self, channel: usize)
src/lenias.rs:208