First, go to a working directory, and get the sources :
HTTPS mode :
git clone https://github.com/historionomy/civilization.gitSSH mode :
git clone git@github.com:historionomy/civilization.gitThen, move to your directory :
cd civilizationThe project needs python >= 3.10 to run locally. You can either use your default python environment to execute it, but we recommand installing a dedicated conda python env :
conda create --name env_civ python=3.11Then, activate your conda environment :
conda activate env_civInstall the python packages requirements :
pip3 install -r requirements.txtIf you need to exit your conda environment :
conda deactivateTo run the app locally, run :
streamlit run civilization.py- The function
load_mapincivilization.pyload the fileeurope.png, as a RGB array - The Streamlit state variable
st.session_state.gridstores aGridclass object, theGridclass being defined inalgorithm.py - If the Counter is running, every second, the function
timestepis applied onst.session_state.grid - The model is executed in the
timestepfunction of classGridin filealgorithm.py
A detailed overview of the algorithm is available here in french.