-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
In node classes that implement a random selection between their neighbors (for example EL), the method is defined as follows:
def get_neighbors(self, node=None):
return set(self.rng.sample(self.my_neighbors, self.degree))
With:
self.rngbeing the Random library.self.my_neighborsbeing a set of neighbors.
For Python >=3.9, the method Random.sample() is deprecated for sets. According to the documentation, "In the future, the population must be a sequence. Instances of set are no longer supported. The set must first be converted to a list or tuple, preferably in a deterministic order so that the sample is reproducible."
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels