From c50bf6c05b5da1075a826c879e13c410ed19279c Mon Sep 17 00:00:00 2001 From: Mohcine Chraibi Date: Wed, 13 Mar 2024 15:28:24 +0100 Subject: [PATCH] Add documentation --- app.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/app.py b/app.py index fc2946e..40d7de3 100644 --- a/app.py +++ b/app.py @@ -193,6 +193,54 @@ def read_data(output_file: str) -> pd.DataFrame: min_value=min_value, ) + with st.expander("(click) to enlarge documentation"): + st.markdown("""### Default Strategy""") + st.markdown(r""" + $ + \textbf{motivation}(distance) = + \begin{cases} + 0 & \text{if\;} distance \geq \text{width}, \\ + e \cdot \text{height}\cdot\exp\left(\frac{1}{\left(\frac{distance}{\text{width}}\right)^2 - 1}\right) & \text{otherwise}. + \end{cases} + $ + + --- + --- + """) + st.markdown(r""" + ### EVC + $\textbf{motivation} = E\cdot V\cdot C,$ where + - $E$: expectancy + - $V$: value + - $C$: competition + + --- + """) + + st.markdown(r""" + $ + \textbf{expectancy}(distance) = + \begin{cases} + 0 & \text{if\;} distance \geq \text{width}, \\ + e \cdot \text{height}\cdot\exp\left(\frac{1}{\left(\frac{distance}{\text{width}}\right)^2 - 1}\right) & \text{otherwise}. + \end{cases}\\ + $ + + **Note:** this is the same function like default strategy + + --- + + $ + \textbf{competition} = 1 - \frac{N}{N_0}, + $ + + $N$: Agents still in the simulation and $N_0$ initial number of agents. + + --- + $\textbf{value} = random\_number \in [v_{\min}, v_{\max}].$ + + """) + figs = motivation_strategy.plot() with st.expander("Plot model", expanded=True): for fig in figs: