NLMrs

A Rust crate for building Neutral Landscape Models.

Inspired by nlmpy and nlmr.

Installation

bash cargo add nlmrs

Example

```rs use nlmrs;

fn main() { let arr: Vec> = nlmrs::midpoint_displacement(10, 10, 1.); println!("{:?}", arr); } ```

Export

The export module holds a collection of user-friendly functions to export your 2D NLM vector.

```rs use nlmrs::{distancegradient, export::writeto_csv};

fn main() { let arr: Vec> = distancegradient(50, 50); writeto_csv(arr, "./data/data.csv"); } ```

Algorithms

Random

Random Element

Planar Gradient

Edge Gradient

Distance Gradient

Wave Gradient

Midpoint Displacement

Visualisation

Running script/vis.py will read any contents of data/data.csv and render them in a matplotlib plot.

Contributions

Contributions, issues and feature requests are welcome.