scicom.knowledgespread.utils ============================ .. py:module:: scicom.knowledgespread.utils .. autoapi-nested-parse:: Utility functions for initial condition generation. Classes ------- .. autoapisummary:: scicom.knowledgespread.utils.GenerateInitalPopulation scicom.knowledgespread.utils.GenerateSocNet Functions --------- .. autoapisummary:: scicom.knowledgespread.utils.epistemicRange scicom.knowledgespread.utils.ageFunction Module Contents --------------- .. py:function:: epistemicRange(baseRange, age) Return the age dependent search radius for epistemic discovery. .. py:function:: ageFunction(agent, a, b, c, radius) Return 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. .. py:class:: GenerateInitalPopulation(numScientists, timesteps) Generate sets of initial conditions. .. py:attribute:: N .. py:attribute:: Tstep .. py:method:: epistemicFunc(fc, x, y, beta=8) Epistemic space initial sampling. .. py:method:: timeFunc(dataframe, step, fcT='saturate', slope=5, base=5) Population growth function. .. py:method:: sample(fcE='complex', fcT='saturate', beta=8, slope=5, base=5) Generate the sample population and add activation time. .. py:method:: _fullDist(fcE, beta) Full distribution to sample from. .. py:class:: GenerateSocNet(dataframe, minDist = 0.0001) .. py:attribute:: population .. py:attribute:: density :value: '' .. py:attribute:: allEdges :value: '' .. py:attribute:: socialNet :value: '' .. py:attribute:: minDist :value: 0.0001 .. py:method:: _getWeighted(row, degree) .. py:method:: initSocNet() 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 .. py:method:: 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 .. py:method:: 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. .. py:method:: run(nEdges=4, density=0.2, densityGrowth=0)