- class scicom.knowledgespread.agents.ScientistAgent(unique_id, model, pos: tuple, topicledger: list, geopos: tuple, birthtime: int, productivity: tuple, opposition: bool = False)
A scientist with an idea.
Each scientist has a geographic position, is related to other agents by a social network, and is intialized with a starttime, that describes the year at which the agent becomes active.
Change epistemic position based on distance in epistemic space.
Change epistemic position based on social network.
Agents activity starts after having reached the birthtime.
After initial start, at each step the agents age is increased by one. Each agent has a randomly generated age-dependent activation probability. Moveing happens first due to social connections. If no move due to social connections was possible, a move due to epistemic space search is attempted.
Once the possible activation weight drops below a threshold, the agent is removed from the schedule.
Create new links in agents social network.
Utility functions for initial condition generation.
- class scicom.knowledgespread.utils.GenerateInitalPopulation(numScientists, timesteps)
Generate sets of initial conditions,
- epistemicFunc(fc, x, y, beta=8)
Epistemic space initial sampling.
- sample(fcE='complex', fcT='saturate', beta=8, slope=5, base=5)
Generate the sample population and add activation time.
- timeFunc(dataframe, step, fcT='saturate', slope=5, base=5)
Population growth function.
- class scicom.knowledgespread.utils.GenerateSocNet(dataframe: DataFrame, minDist: float = 0.0001)
- growEdges(time, density, densityGrowth)
Add edges with weighted preferential attachement.
For a given time, select the current social network, including newly added nodes. Add weights by current degree and distances. Sample a suffiecient number of edges to keep density at a given level.
- growNodes(time, nEdges)
Add nodes with weighted preferential attachment.
For a time step select all new agents. For each agent query all potential edges to previously active agents. Weight these edges with the degree of the previous social network and the distances. From this select N edges for each new agent. Return the concatenated new edges
Generates initial social network sample from population.
The dataframe input should contain the colum names: id, x, y, z, t Returns social network sample with from_id, to_id, dist, time
- run(nEdges=4, density=0.2, densityGrowth=0)
- scicom.knowledgespread.utils.ageFunction(agent, a, b, c, radius)
Returns an age dependent radius.
Bell-shaped function with center at c, slop and width of plateau defined by a, b.
Can be used to show age-dependent activity of agents.
- scicom.knowledgespread.utils.epistemicRange(baseRange, age)
Returns the age dependent search radius for epistemic discovery.
- class scicom.knowledgespread.model.KnowledgeSpread(*args: Any, **kwargs: Any)
A model for knowledge spread.
Agents have an initial topic vector and are positioned in epistemic space.
Run model for n steps.
Run one simulation step.
Get all agents active at time t.
- scicom.knowledgespread.server.epiSpace_draw_altair(model, agent_portrayal)