-
Notifications
You must be signed in to change notification settings - Fork 0
Civ Sim
This wiki contains how-to instructions for running civilization sim.
The easiest way to run civ_sim is by using the .ipynb notebook. The notebook can be run on any jupyter server, with IDE extensions (e.g. VS Code), or if you have a Google account and want to keep the data from a simulation, Google Colab (linked above) allows you to run the notebook on their hardware without downloading or running anything on your own machine.
civ_sim can be also be downloaded and run locally as a CLI or as a webapp.
# clone the repo
git clone git@github.com:Isnor/civilization_sim.git
cd civilization_sim
# Create a virtual environment (Python 3.12+ required)
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install .Experiments can be configured and run via a UI packaged as a webapp using solara.
solara run app.pyWill start a local webserver and open a browser pointing at the app. See the solara page for more on using the web app.
Experiments can also be defined as YAML files, run with the CLI, and CSV output written to ./output e.g.:
python main.py --seed 42 --config config/experiment1.yaml --write-output --output ./output/experiment1/civ_sim can be installed with pip if you're interested in building something with it, but this is not recommended due to the instability, lack of testing, and lack of proper package distribution:
pip install git+https://github.com/Isnor/civilization_sim.gitfrom civ_sim.simulation.scenario import CivilizationScenario
from civ_sim.simulation.model import CivilizationModel
config = CivilizationScenario() # add overrides as kwargs here
model = CivilizationModel(scenario=config)