-
Notifications
You must be signed in to change notification settings - Fork 159
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
Sunfish search error #10
Comments
sorry, not sure what's going on :( |
What should I show you to help you understand my error? |
When i run the command: export PYTHONPATH=/home/username/.sunfish/, it runs fine. I tried running python in the terminal, and it seems that sunfish does not even have a search module?
|
sorry – i don't have time to look into this. you are on your own :) |
Okay thank you anyway - any place you would recommend I start? |
sorry i don't have any pointers (haven't looked at the code for like 2 years) |
I think I can shed some light on this. Recent versions of sunfish no longer has a global search function, but a Searcher class of which you should make an instance. Basically this is just to encapsulate things like "nodes searcehd". |
@thomasahle Unfortunately I am quite the beginner at this, so would you mind explaining to me what changes I would make to the code? I'm not very familiar with sunfish and python, and don't know how to implement the Searcher class. |
Same error here. If I'm not mistaken, @thomasahle is saying that the 'search' function has been refactored as an instance method of the Searcher class to fix this, you will need to replace the line 196, which reads Let me know if that works |
great if you can send a pull request if you get it working! thanks |
Thank you @mitni455! Your searcher class implementation worked!
Does this have anything to do with lines 350-352 in sunfish? |
Here is how it's used in main() of sunfish
|
Thank you for the explanation. Does this mean that sunfish has migrated completely away from maxn? In other words, does this mean in order to make deep pink work, I need to modify it to use secs instead of maxn? |
If I can get all this to work, I'll happily send a pull request @erikbern |
Yes. Though if it's easier you can also use the _search method, which returns an iterator that can be stopped when enough nodes are searched. See the implementation of the search method. |
Did anyone end up getting this to work? |
after the
line 182
line 184
line 197
after line 214 add
line 221
here is working now |
or..if you want you can use this verision of sunfish wich have maxn instead of secs
|
I made a pull-request with basically FF27's changes. |
When I run play.py, i get the following error:
Traceback (most recent call last):
File "play.py", line 226, in game
gn_current = player.move(gn_current)
File "play.py", line 196, in move
move, score = sunfish.search(self._pos, maxn=self._maxn)
AttributeError: 'module' object has no attribute 'search'
What does this error mean?
The text was updated successfully, but these errors were encountered: