Code Monkey home page Code Monkey logo

simsim's Introduction

simsim 🎲

What is simsim?

simsim is a framework for (sim)ple (sim)ulation of generalized, discrete-time dynamical systems written in pure Rust. A user implements a system, a state transition function, and a specification of the data they'd like to record, and simsim runs this simulation—and structures its results—in a straightforward manner.

How do I implement a simulation?

  1. Implement a system struct that inherits from the BaseSystem trait.
  2. Implement a state struct that inherits from the BaseState trait.
  3. Given the above, instantiate a Simulation object.
  4. Call the Simulation's run method.

For example, for a Lotka-Volterra simulation, these steps are respectively implemented here:

  1. System.
  2. State.
  3. Simulation.
  4. Run.

How do I run a simulation?

To run the Lotka-Volterra simulation above, run the following commands:

git clone [email protected]:cavaunpeu/simsim.git
cargo run \
  --manifest-path examples/lotka_volterra/Cargo.toml \
  -- \
  --runs 10 \
  --steps_per_run 5 \
  --output_dir output \
  --configs_path examples/lotka_volterra/configs.json

Where do the configs come from?

In simsim, you create your own (JSON) configs—however you see fit. For instance, you can do this manually, or programmatically in a language like Python.

We hope that forcing the user to explicitly provide all configs they desire to run simplifies the experience of using this tool.

What does simsim output?

Presently, we write the following two files to your specified --output_dir:

  1. results.csv: A .csv containing all of your State's (key, val) pairs in each step of each run.
  2. params.csv: Those (key, val) pairs in your config that you designate as system-level parameters. Nominally, these are constants that characterize a given configuration.

How should I get started?

Simply, we recommend duplicating the full Lotka-Volterra example then replacing its code with your own.

Additionally, if you are working from a fresh repository, you can specify the simsim dependency in your Cargo.toml as such:

[dependencies]
simsim = { git="https://github.com/cavaunpeu/simsim.git" }

Questions?

Please open an issue, or DM me on Twitter.

simsim's People

Contributors

cavaunpeu avatar

Stargazers

Emanuel Lima avatar nikete avatar Danilo Lessa Bernardineli avatar

Watchers

 avatar  avatar

Forkers

playfloor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.