You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from littleballoffur import ForestFireSampler
import networkx as nx
graph = nx.newman_watts_strogatz_graph(1000, 20, 0.05)
model = ForestFireSampler()
new_graph = model.sample(graph)
but I got:
Traceback (most recent call last):
File "/Users/decanoingenierias/PycharmProjects/h_extended/sampling_network.py", line 12, in
new_graph = model.sample(graph)
^^^^^^^^^^^^^^^^^^^
File "/Users/decanoingenierias/anaconda3/lib/python3.11/site-packages/littleballoffur/exploration_sampling/forestfiresampler.py", line 101, in sample
self._start_a_fire(graph)
File "/Users/decanoingenierias/anaconda3/lib/python3.11/site-packages/littleballoffur/exploration_sampling/forestfiresampler.py", line 78, in _start_a_fire
burned_neighbors = random.sample(unvisited_neighbors, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/decanoingenierias/anaconda3/lib/python3.11/random.py", line 439, in sample
raise TypeError("Population must be a sequence. "
TypeError: Population must be a sequence. For dicts or sets, use sorted(d).
Process finished with exit code 1
I'm using python 3.11.5
The text was updated successfully, but these errors were encountered:
fernandobarraza
changed the title
Error sampling with FireForest
Error sampling with ForestFire
Apr 17, 2024
I tried to code the example in the docs:
but I got:
Traceback (most recent call last):
File "/Users/decanoingenierias/PycharmProjects/h_extended/sampling_network.py", line 12, in
new_graph = model.sample(graph)
^^^^^^^^^^^^^^^^^^^
File "/Users/decanoingenierias/anaconda3/lib/python3.11/site-packages/littleballoffur/exploration_sampling/forestfiresampler.py", line 101, in sample
self._start_a_fire(graph)
File "/Users/decanoingenierias/anaconda3/lib/python3.11/site-packages/littleballoffur/exploration_sampling/forestfiresampler.py", line 78, in _start_a_fire
burned_neighbors = random.sample(unvisited_neighbors, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/decanoingenierias/anaconda3/lib/python3.11/random.py", line 439, in sample
raise TypeError("Population must be a sequence. "
TypeError: Population must be a sequence. For dicts or sets, use sorted(d).
Process finished with exit code 1
I'm using python 3.11.5
The text was updated successfully, but these errors were encountered: