{"id":16371576,"url":"https://github.com/tom-draper/nlmrs","last_synced_at":"2025-10-26T08:30:15.524Z","repository":{"id":65181158,"uuid":"585284976","full_name":"tom-draper/nlmrs","owner":"tom-draper","description":"A Rust crate for building Neutral Landscape Models.","archived":false,"fork":false,"pushed_at":"2023-11-22T10:10:56.000Z","size":3817,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T16:55:29.990Z","etag":null,"topics":["data-visualization","environment","landscape","landscapes","landscaping","matplotlib","model","modeling","models","neutral-landscape-model","nlm","nlm-api","patterns","rust","rust-lang","simulation","visualization","world-building"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tom-draper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-04T19:34:35.000Z","updated_at":"2024-09-10T20:40:39.000Z","dependencies_parsed_at":"2023-02-16T10:16:12.152Z","dependency_job_id":"b9c990bc-5b48-4786-b3c0-0a3fd5b07862","html_url":"https://github.com/tom-draper/nlmrs","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":"0.33333333333333337","last_synced_commit":"394cdda2872ce57ae2ccb4ba3a13b0974501eb0b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-draper%2Fnlmrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-draper%2Fnlmrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-draper%2Fnlmrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-draper%2Fnlmrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tom-draper","download_url":"https://codeload.github.com/tom-draper/nlmrs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238293119,"owners_count":19448123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-visualization","environment","landscape","landscapes","landscaping","matplotlib","model","modeling","models","neutral-landscape-model","nlm","nlm-api","patterns","rust","rust-lang","simulation","visualization","world-building"],"created_at":"2024-10-11T03:08:55.018Z","updated_at":"2025-10-26T08:30:15.144Z","avatar_url":"https://github.com/tom-draper.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NLMrs\n\nA Rust crate for building \u003cb\u003eNeutral Landscape Models\u003c/b\u003e.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/41476809/211358340-8e4d68de-fdc4-4e75-846b-b7b5c6105bfb.png\" alt=\"\" /\u003e\n\nInspired by [nlmpy](https://pypi.org/project/nlmpy/) and [nlmr](https://github.com/ropensci/NLMR).\n\n## Installation\n\n```bash\ncargo add nlmrs\n```\n\n## Example\n\n```rs\nuse nlmrs;\n\nfn main() {\n    let arr: Vec\u003cVec\u003cf64\u003e\u003e = nlmrs::midpoint_displacement(10, 10, 1.);\n    println!(\"{:?}\", arr);\n}\n```\n\n### Export\n\nThe `export` module holds a collection of user-friendly functions to export your 2D NLM vector.\n\n```rs\nuse nlmrs::{distance_gradient, export};\n\nfn main() {\n    let arr: Vec\u003cVec\u003cf64\u003e\u003e = distance_gradient(50, 50);\n    export::write_to_csv(arr, \"./data/data.csv\");\n}\n```\n\n### Visualization\n\nRunning `scripts/visualize.py` will read any contents of `data/data.csv` and render them as a matplotlib plot.\n\n## Algorithms\n\n### Random\n\n`random(rows: 100, cols: 100)`\n\n\u003cimg src=\"https://user-images.githubusercontent.com/41476809/211366758-60cd60fa-bc7d-4bfb-b514-1aca1870dfa8.png\" alt=\"\" width=300 /\u003e\n\n### Random Element\n\n`random_element(rows: 100, cols: 100, n: 50000.)`\n\n\u003cimg src=\"https://user-images.githubusercontent.com/41476809/211366837-8912ddc8-a541-4060-b948-abb81aeb4c27.png\" alt=\"\" width=300 /\u003e\n\n### Planar Gradient\n\n`planar_gradient(rows: 100, cols: 100, direction: Some(60.))`\n\n\u003cimg src=\"https://user-images.githubusercontent.com/41476809/211367190-9ed6604f-7352-4fb8-a75a-957bd733e01a.png\" alt=\"\" width=300 /\u003e\n\n### Edge Gradient\n\n`edge_gradient(rows: 100, cols: 100, direction: Some(140.))`\n\n\u003cimg src=\"https://user-images.githubusercontent.com/41476809/211367676-e731dcc4-3da3-48d6-b7bf-d90b08a3645f.png\" alt=\"\" width=300 /\u003e\n\n### Distance Gradient\n\n`distance_gradient(rows: 100, cols: 100)`\n\n\u003cimg src=\"https://user-images.githubusercontent.com/41476809/211400760-8558426c-330b-4a01-9024-246b4432819a.png\" alt=\"\" width=300 /\u003e\n\n### Wave Gradient\n\n`wave_gradient(rows: 100, cols: 100, period: 2.5, direction: Some(90.))`\n\n\u003cimg src=\"https://user-images.githubusercontent.com/41476809/211368695-61bc245b-214c-4e7d-9f74-dcfc8dde0087.png\" alt=\"\" width=300 /\u003e\n\n### Midpoint Displacement\n\n`midpoint_displacement(rows: 100, cols: 100, h: 1.)`\n\n\u003cimg src=\"https://user-images.githubusercontent.com/41476809/211368739-3bfd4026-f47b-4b15-92ab-38e48c963d87.png\" alt=\"\" width=300 /\u003e\n\n### Hill Grow\n\n`hill_grow(rows: 100, cols: 100, n: 10000, runaway: true, kernel: None, only_grow: false)`\n\n\u003cimg src=\"https://user-images.githubusercontent.com/41476809/211400491-79c4767e-3caf-44ca-a58f-859fbbf2a8c7.png\" alt=\"\" width=300 /\u003e\n\n\n\n## Contributions\n\nContributions, issues and feature requests are welcome.\n\n- Fork it (https://github.com/tom-draper/nlmrs)\n- Create your feature branch (`git checkout -b my-new-feature`)\n- Commit your changes (`git commit -am 'Add some feature'`)\n- Push to the branch (`git push origin my-new-feature`)\n- Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-draper%2Fnlmrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom-draper%2Fnlmrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-draper%2Fnlmrs/lists"}