# wasm-agent-based-models

> Reliable and efficient agent-based models in Rust and WebAssembly

Latest version **0.1.0** (published 2020-12-07) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install wasm-agent-based-models
pnpm add wasm-agent-based-models
yarn add wasm-agent-based-models
bun add wasm-agent-based-models
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-12-07 |
| First published | 2020-12-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 16 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Maintainers | facorread |

## Links

- npm: https://www.npmjs.com/package/wasm-agent-based-models
- Repository: https://github.com/facorread/wasm-agent-based-models
- Homepage: https://github.com/facorread/wasm-agent-based-models#readme
- Issues: https://github.com/facorread/wasm-agent-based-models/issues
- npm.io page: https://npm.io/package/wasm-agent-based-models

## Recent versions

- 0.1.0 (latest) — 2020-12-07

## README

# wasm-agent-based-models

Reliable and efficient agent-based models in Rust and WebAssembly

Copyright (C) 2020 Fabio Correa facorread@gmail.com

https://github.com/facorread/wasm-agent-based-models

https://gitlab.com/facorread/wasm-agent-based-models

## Introduction

Please check out the README for [rust-agent-based-models] first.

Agent-based models (ABM) are computer programs that define agents, virtual entities that imitate the decision-making processes and interactions of real people, animals, neurons, etc. [wasm-agent-based-models] is an interactive version of [rust-agent-based-models] that runs in a web browser. The researcher can copy code from one project into the other to explore model behavior. While [rust-agent-based-models] explores multiple, independent runs of the model under a wide range of parameter scenarios automatically, wasm-agent-based-models visualizes one run of the model while the researcher freely varies parameters, pauses the model, and explores alternative behavior using interactive controls.

## Why WebAssembly?

Rust offers a range of tools to develop [graphical user interfaces] (GUIs); in 2020, these projects were still experimental, but I needed stable tools for a modeling GUI. I decided to use WebAssembly because it has a longer track record and it is an open standard available on Windows, Linux, and Mac systems.

## Getting started

To get started with wasm-agent-based models, decent knowledge of html, css, and javascript is required. You should also read the [Rust and WebAssembly book], and follow the setup instructions therein. `npm` is strongly recommended.

After you have started with [rust-agent-based-models], [Clone this repository] (`https://github.com/facorread/wasm-agent-based-models.git`) and use your favorite terminal to run `wasm-pack build --target web`. Follow the instructions on screen.

Once you have verified that the code builds, take some time to understand the similarities and differences between this project and [rust-agent-based-models]. This allows you to see the code that needs to be copied from one project into the other, and decide what parameters you want to explore as you work on designing your own ABM.

To examine the differences between the two programs, you can use `[diff]`, for example:

```bash
diff -u rust-agent-based-models/src/main.rs wasm-agent-based-models/src/lib.rs
```

To examine the similarities between the two programs, you can use `[fgrep]`:

```bash
fgrep -xf rust-agent-based-models/src/main.rs wasm-agent-based-models/src/lib.rs
```

## Why make these two separate projects? / Do I need to copy code from one project into the other verbatim?

Sometimes you want to copy the full model from one project to another, and sometimes you want to explore changes to just one of the concepts or algorithms. These projects are complementary rather than redundant.

## Does this repository use `unsafe` code?

Not explicitly.

## Acknowledgements

This project was created using the [wasm-pack-template] template by the [rust-wasm] team.

The `www/` directory comes from the [create-wasm-app] template by Ashley Williams of the [rust-wasm] team.

[create-wasm-app]:https://github.com/rustwasm/create-wasm-app
[diff]:https://man7.org/linux/man-pages/man1/diff.1.html
[fgrep]:https://man7.org/linux/man-pages/man1/fgrep.1.html
[graphical user interfaces]:https://www.areweguiyet.com/
[rust-agent-based-models]:https://github.com/facorread/rust-agent-based-models
[Rust and WebAssembly book]:https://rustwasm.github.io/docs/book/
[rust-wasm]:https://rustwasm.github.io/
[wasm-pack-template]:https://github.com/rustwasm/wasm-pack-template

---
_Source: https://npm.io/package/wasm-agent-based-models · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
