iorch / amigo Goto Github PK
View Code? Open in Web Editor NEWA gobot inspired in AlphaGo
License: MIT License
A gobot inspired in AlphaGo
License: MIT License
@iorch
I believe that is the problem, in this match 2015-03-01-20.sgf: see the group of stones in P5 at move 82->83
+--+---------------------------------------+`
| move = 082 turn = B |
| A B C D E F G H J K L M N O P Q R S T |
+--+---------------------------------------+
|19| · · · · · · · · · · · · · · · · · · · |
|18| · · · · · · · · · · · · · · · · · · · |
|17| · · ● · · ● · · · · · · · ● · · · · · |
|16| · ⚆ · ● · · · · ● · · · · · · ● · · · |
|15| · · · · · · · · · · · · · · · · · · · |
|14| · · ⚆ · ⚆ · · · · · · · · · · · ⚆ · · |
|13| · · · · · · · · · · · · · · · · · · · |
|12| · · · · · · · · · · · · · · · · · · · |
|11| · · · · · · · · · · · · · ● · · ● · · |
|10| · · · · · · · · · · · · ⚆ ● · ⚆ ● · · |
|09| · · · · · · · ● · · · · ⚆ ● · · · · · |
|08| · · ⚆ ⚆ · · · · · · ⚆ ⚆ · ⚆ ⚆ · ● · · |
|07| · · ● ⚆ · ⚆ · ● · · · ● ● · · · ⚆ ● · |
|06| · · ● ⚆ · · · ● ⚆ · ⚆ ⚆ · ⚆ ⚆ ⚆ · · ● |
|05| · · · ● · ⚆ · ● · · · ● ⚆ ● ● ● ⚆ ● · |
|04| · · · ● · · · ● ⚆ · · ● · ● ⚆ ● ⚆ · · |
|03| · · ● · · ⚆ · ● · · ⚆ · ⚆ ⚆ ⚆ · ⚆ · · |
|02| · · ● ⚆ · · · · · · · · · · ● ⚆ ⚆ · · |
|01| · · · · · · · · · · · · · · · · · · · |
+--+---------------------------------------+
+--+---------------------------------------+
| move = 083 turn = B |
| A B C D E F G H J K L M N O P Q R S T |
+--+---------------------------------------+
|19| · · · · · · · · · · · · · · · · · · · |
|18| · · · · · · · · · · · · · · · · · · · |
|17| · · ● · · ● · · · · · · · ● · · · · · |
|16| · ⚆ · ● · · · · ● · · · · · · ● · · · |
|15| · · · · · · · · · · · · · · · · · · · |
|14| · · ⚆ · ⚆ · · · · · · · · · · · ⚆ · · |
|13| · · · · · · · · · · · · · · · · · · · |
|12| · · · · · · · · · · · · · · · · · · · |
|11| · · · · · · · · · · · · · ● · · ● · · |
|10| · · · · · · · · · · · · ⚆ ● · ⚆ ● · · |
|09| · · · · · · · ● · · · · ⚆ ● · · · · · |
|08| · · ⚆ ⚆ · · · · · · ⚆ ⚆ · ⚆ ⚆ · ● · · |
|07| · · ● ⚆ · ⚆ · ● · · · ● ● · · · ⚆ ● · |
|06| · · ● ⚆ · · · ● ⚆ · ⚆ ⚆ · ⚆ ⚆ ⚆ · · ● |
|05| · · · ● · ⚆ · ● · · · ● ⚆ · · · ⚆ ● · |
|04| · · · ● · · · ● ⚆ · · ● · ● ⚆ ● ⚆ · · |
|03| · · ● · · ⚆ · ● · · ⚆ ⚆ ⚆ ⚆ ⚆ · ⚆ · · |
|02| · · ● ⚆ · · · · · · · · · · ● ⚆ ⚆ · · |
|01| · · · · · · · · · · · · · · · · · · · |
+--+---------------------------------------+
Should gut know about komi and captured stones?
@magania: Quiero empezar a pasar las funcionalidades que están en sgf2board.py a c++. Voy a empezar creando la clase Group. Pero me surgió una duda con Kifu. ¿Tu idea es que Kifu sea una clase muy sencilla, que sólo guarde la información de la partida? ¿O que, además de guardar esa información, también sea capaz de darte el status del juego dado un número de jugada? La segunda opción es lo que hace mi clase Kifu en sgf2board.py. Si prefieres la primera opción, ¿significa que la clase board_layer tomará un objeto Kifu y regresará alguna característica del tablero en determiando moviemiento?
test.cc
#include "amigo.h"
#include "kifu.h"
#include "policy.h"
#include "value.h"
#include "engine.h"
int main(int argc, char** argv) {
std::string file_name("in.sgf");
if (argc == 2)
file_name = argv[1];
std::cout << file_name << '\n';
amigo::kifu k(file_name);
auto board = k.position_at(83);
board.draw();
// amigo::engine e;
// e.think();
// for (auto& g : board.get_groups("white")){
// board.draw_layer(g.first);
// board.draw_layer(g.second);
// }
return 0;
}
makefile
FLAGS=-std=c++11 -g -D__DOCHECK
INCLUDES=-I ./include
test_x: test.cc include/amigo.h include/kifu.h include/policy.h include/engine.h include/value.h
${CXX} ${FLAGS} ${INCLUDES} $< -o $@
test: test_x
echo "done."
errors:
c++ -std=c++11 -g -D__DOCHECK -I ./include test.cc -o test_x
In file included from test.cc:3:
./include/policy.h:27:39: error: implicit instantiation of undefined template 'std::__1::array<amigo::priority_, 362>'
std::array<priority_, NPOSITIONS> evaluate(const board& brd) {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:95:65: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
^
In file included from test.cc:3:
./include/policy.h:28:43: error: implicit instantiation of undefined template 'std::__1::array<amigo::priority_, 362>'
std::array<priority_, NPOSITIONS> result;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:95:65: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
^
In file included from test.cc:5:
./include/engine.h:22:49: error: implicit instantiation of undefined template 'std::__1::array<amigo::priority_, 362>'
const std::array<priority_, NPOSITIONS> priorities;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:95:65: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
^
In file included from test.cc:5:
./include/engine.h:23:46: error: implicit instantiation of undefined template 'std::__1::array<std::__1::shared_ptr<amigo::engine::node_>, 362>'
std::array<shared_node_, NPOSITIONS> children;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:95:65: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
^
In file included from test.cc:1:
In file included from ./include/amigo.h:4:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4311:18: error: assigning to 'std::__1::__shared_weak_count *' from
incompatible type 'pointer' (aka 'std::__1::__shared_ptr_emplace<amigo::engine::node_, std::__1::allocator<amigo::engine::node_> > *')
__r.__cntrl_ = __hold2.release();
^ ~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4672:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<amigo::engine::node_>::make_shared<const amigo::board &, amigo::gut &, amigo::policy &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
./include/engine.h:34:21: note: in instantiation of function template specialization 'std::__1::make_shared<amigo::engine::node_, const amigo::board &, amigo::gut &, amigo::policy
&>' requested here
return std::make_shared<node_>(b, value_, policy_);
^
5 errors generated.
make: *** [test_x] Error 1
Just the captured stones so far.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.