Same API as https://web.stanford.edu/class/cs168/qwop.py
, but much faster.
pip install qwop-fast
-
You can just follow the API of
https://web.stanford.edu/class/cs168/qwop.py
and just replaceimport qwop
withimport qwop_fast
.import numpy as np import qwop_fast plan = np.random.uniform(-1, 1, 40) qwop_fast.sim(plan) # return a float
-
You can also simulate in batches. Batches will be executed in parallel.
import numpy as np import qwop_fast plan = np.random.uniform(-1, 1, (100, 40)) qwop_fast.sim_batch(plan) # return a list of floats
-
Install Rust: https://rustup.rs/
-
Install Maturin:
pip install maturin
-
Build and install the package:
maturin develop --release