| Crates.io | nlmrs |
| lib.rs | nlmrs |
| version | 0.1.7 |
| created_at | 2023-01-06 16:23:54.696088+00 |
| updated_at | 2023-01-18 20:05:44.786261+00 |
| description | A Rust crate for building Neutral Landscape Models. |
| homepage | |
| repository | https://github.com/tom-draper/nlmrs |
| max_upload_size | |
| id | 752397 |
| size | 223,397 |
A Rust crate for building Neutral Landscape Models.
cargo add nlmrs
use nlmrs;
fn main() {
let arr: Vec<Vec<f64>> = nlmrs::midpoint_displacement(10, 10, 1.);
println!("{:?}", arr);
}
The export module holds a collection of user-friendly functions to export your 2D NLM vector.
use nlmrs::{distance_gradient, export::write_to_csv};
fn main() {
let arr: Vec<Vec<f64>> = distance_gradient(50, 50);
write_to_csv(arr, "./data/data.csv");
}
Running script/viz.py will read any contents of data/data.csv and render them as a matplotlib plot.
random(100, 100)
random_element(100, 100, 50000.)
planar_gradient(100, 100, Some(60.))
edge_gradient(100, 100, Some(140.))
distance_gradient(100, 100)
wave_gradient(100, 100, 2.5, Some(90.))
midpoint_displacement(100, 100, 1.)
hill_grow(100, 100, 10000, true)
Contributions, issues and feature requests are welcome.
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)