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(*args, **kwargs)[source]
Base class for location objects.
- property actors: list
Return the list of actors affiliated with this location.
- Returns:
List of actors at this location.
- get_weight(actor)[source]
Return the edge weight between an actor and the location.
- Parameters:
actor (
Actor
) – Actor of which the edge weight should be returned.- Return type:
- Returns:
Edge weight.
- neighbors(actor)[source]
Returns a list of actors which are connected to the given actor via this location.
- Parameters:
actor (_actor.Actor) – Actor of whom the neighbors at this location are to be returned.
- Returns:
A list of all actors at this location except the passed actor.
- Return type:
ActorList
- project_weights(actor1, actor2)[source]
Calculates the edge weight between two actors assigned to the same location instance.
Defines how the weights are combined when the edge weight between two actors 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.
- remove_actor(actor)[source]
Removes the given actor from this location.
- Parameters:
actor (
Actor
) – Actor that is to be removed.- Return type: