Location
The location class represents a base class that can be used to implement realistic location in which agents can meet and interact.
- class pop2net.Location(model)[source]
Base class for location objects.
- property agents: AgentList
Return the list of agents affiliated with this location.
- Returns:
List of agents at this location.
- neighbors(agent)[source]
Returns a list of agents which are connected to the given agent via this location.
- Parameters:
agent (
Agent
) – Agent of whom the neighbors at this location are to be returned.- Returns:
A list of all agents at this location except the passed agent.
- Return type:
AgentList
- project_weights(agent1, agent2)[source]
Calculates the edge weight between two agents assigned to the same location instance.
Defines how the weights are combined when the edge weight between two agents is determined. Can be completely rewritten to have location-specific methods of this kind with the same name or can be used as it is in the simulation code.