Historical letters simulation
Agents
- class scicom.historicalletters.agents.RegionAgent(unique_id, model, geometry, crs, init_num_people=0)
- add_person(person)
- has_main_topic()
- init_num_people: int
- persons_in_region: list
- remove_person(person)
- class scicom.historicalletters.agents.SenderAgent(unique_id, model, geometry, crs, updateTopic, similarityThreshold, moveRange, letterRange)
- chooses_topic(receiver)
Choose the topic to write about in the letter.
Agents can choose to write a topic from their own ledger or in relation to the topics of the receiver. The choice is random.
- has_letter_contacts(neighbors=False)
List of already established and potential contacts.
Implements the ego-reinforcing by allowing mutliple entries of the same agent. In neighbourhods agents are added proportional to the number of letters they received, thus increasing the reinforcement.
- property has_topic
Current topic of the agent.
- move(neighbors)
The agent can randomly move to neighboring positions.
- sendLetter(neighbors)
Sending a letter based on an urn model.
- step()
Advance one step.
- class scicom.historicalletters.agents.SenderNode(unique_id, model, topicVec)
An agent representing the network node.
Only necessary for visualization purposes.
Space
- class scicom.historicalletters.space.Nuts2Eu
- add_person_to_region(person, region_id)
- add_regions(agents)
- add_sender(agent: SenderAgent) None
- get_random_region_id() str
- get_region_by_id(region_id) RegionAgent
- move_sender(agent: SenderAgent, pos: Tuple[float, float] | ndarray[Any, dtype[float]]) None
- num_people: int
- remove_person_from_region(person)
Model
- class scicom.historicalletters.model.HistoricalLetters(*args: Any, **kwargs: Any)
A letter sending model with historical informed initital positions.
Each agent has an initial topic vector, expressed as a RGB value. The initial positions of the agents is based on a weighted random draw based on data from [1]
Each step, agents generate two neighbourhoods for sending letters and potential targets to move towards. The probability to send letters is a self-reinforcing process. During each sending the internal topic of the sender is updated as a random rotation towards the receivers topic.
- [1] J. Lobo et al, Population-Area Relationship for Medieval European Cities,
PLoS ONE 11(10): e0162678.
- run(n)
Run the model for n steps.
- step()
A single step. Fill in here.
- scicom.historicalletters.model.getPrunedLedger(model)
Model reporter for simulation of archiving.
Returns statistics of ledger network of model run and various iterations of statistics of pruned networks.
Server
- scicom.historicalletters.server.topic_draw(agent)