Coverage for .tox/p311/lib/python3.10/site-packages/scicom/knowledgespread/interface.py: 0%
5 statements
« prev ^ index » next coverage.py v7.5.0, created at 2024-04-26 11:45 +0200
« prev ^ index » next coverage.py v7.5.0, created at 2024-04-26 11:45 +0200
1"""The interface to control and run the Knowledgespread ABM."""
2from mesa.experimental import JupyterViz
4from scicom.knowledgespread.model import (
5 KnowledgeSpread,
6)
7from scicom.knowledgespread.server import (
8 agent_draw_altair,
9 chart_draw_altair_agents,
10 chart_draw_altair_communities,
11 epiSpace_draw_altair,
12 socialNetwork_draw_altair,
13)
15model_params = {
16 "num_scientists": {
17 "type": "SliderInt",
18 "value": 50,
19 "label": "Initial number of scientists",
20 "min": 10,
21 "max": 200,
22 "step": 10,
23 },
24 "num_timesteps": {
25 "type": "SliderInt",
26 "value": 10,
27 "label": "How long is the number of agents growing?",
28 "min": 5,
29 "max": 100,
30 "step": 5,
31 },
32 "epiInit": {
33 "type": "Select",
34 "value": "complex",
35 "label": "Choose initial conditions for epistemic space",
36 "values": ["complex", "central", "polarized"],
37 },
38 "timeInit": {
39 "type": "Select",
40 "value": "saturate",
41 "label": "Choose initial conditions for population growth.",
42 "values": ["saturate", "linear", "exponential"],
43 },
44 "epiRange": {
45 "type": "SliderFloat",
46 "value": 0.01,
47 "label": "Basic range of visibility in epistemic space",
48 "min": 0.005,
49 "max": 0.3,
50 "step": 0.005,
51 },
52}
55page = JupyterViz(
56 KnowledgeSpread,
57 model_params,
58 measures=[socialNetwork_draw_altair, chart_draw_altair_agents, chart_draw_altair_communities],
59 name="Knowledge spread",
60 agent_portrayal=agent_draw_altair,
61 space_drawer=epiSpace_draw_altair,
62)