# Atmosim
A library for experimenting with explosive gas mixes of [Space Station 14](https://github.com/space-wizards/space-station-14) game.
Based on the original Ilya246's [atmosim](https://github.com/Ilya246/atmosim), but rewritten from scratch in Rust.
## Usage
### Installing
```sh
cargo add atmosim
```
`main.rs`
```rs
use atmosim::prelude::*;
// also this if you want to use optimizer
// use atmosim::optimizer::Optimizer;
```
### API
Should be simple enough:
```rs
let engine = Atmosim::new(GameConfig::wizden_pmr());
let mix = engine.create_mixture(
gases! {
Gas::Oxygen => 0.95,
Gas::Plasma => 0.31,
Gas::Tritium => 0.52,
_ => 0.,
},
373.149,
);
let mut tank = GasContainer::new(mix);
tank.step_all();
```
```
```
Check integration tests and reference implementations (crabmos) for more examples.
### Features
- optimizer - adds optimizer module and Optimizer, which is basically the search engine for the best gas mix.
- optimizer-rayon - same, but with multithreading.
- serde - makes GameConfig and some other stuff de- and serializable.
- no-std - [yes](https://codeberg.org/pheenty/crabmosim-embedded). Incompatible with any of the above.
## Progress
- [X] The core simulation engine.
- [X] Wizden gases and reaction effects.
- [X] Gas container explosion logic (both tanks and canisters).
- [X] Maxcap parameter optimizer (argmin).
- [ ] Good maxcap parameter optimizer (won't be argmin).
- [ ] Measuring maxcap tolerances.
- [X] Legacy reactions (old tritium fire) and old gas tank explosion logic.
- [X] Gases and reactions of various forks.
- [X] Config loading (serde).
- [X] Integration tests.
- [ ] Final polishing (whatever this is supposed to mean).