Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error sampling with ForestFire #30

Open
fernandobarraza opened this issue Apr 17, 2024 · 0 comments
Open

Error sampling with ForestFire #30

fernandobarraza opened this issue Apr 17, 2024 · 0 comments

Comments

@fernandobarraza
Copy link

I tried to code the example in the docs:

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

@fernandobarraza fernandobarraza changed the title Error sampling with FireForest Error sampling with ForestFire Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant