Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.28 KB

README.md

File metadata and controls

51 lines (34 loc) · 1.28 KB

gillrocky

Rocket Gillespie

An implementation of the Gillespie algorithm in Rust.

a discrete, stochastic process instead of a continuous, deterministic process[a]

Example

cargo build
cargo run
use gillrocky::{Reactor, Process};

struct State { ... }
struct Reaction { ... }

impl Process<State> for Reaction {
  fn rate(&self, state: &State) -> f64 { ... }
  fn perform(&mut self, state: &mut State) { ... }
}

let mut reactor = Reactor::new(seed);
reactor.add(Reaction { ... });
reactor.add(Reaction { ... });

let state = State { ... };
loop {
  reactor.step(&mut state);
  // output: reactor.time, state.*, etc
}

See also

References

License

This project is licensed under the terms of the MIT license.

Icon derived from work by Selman Design.