u-ma / experimental Goto Github PK
View Code? Open in Web Editor NEW研究用のコード
研究用のコード
最初の顧客を選択するときのモンテカルロ木を出力するようにすると
root.count_の値がmcts_count+1になっている。
diff --git a/src/main.cpp b/src/main.cpp
index 4d25797..a325595 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -154,6 +154,7 @@ main(int argc, char **argv)
return 1;
}
transition(solution, host_vrp, next->customer_id());
+ VrpSolver::tools::node_dump(stderr, root, 1); exit(1);^M
}
clock_t stop = clock();
./a.out ../cvrp/experiment/Vrp-All/E/E-n51-k5.vrp 800 800 10 120
node_id:ROOT
count:801,num_childs: 50
child:
node_id:1
count: 16,num_childs: 49
node_id:2
count: 14,num_childs: 49
node_id:3
count: 16,num_childs: 49
...
node_dumpの出力先が現在stdoutなので、指定のファイルに出力することを可能にするように変更すべき。
node_dump(fp, root, 1);
Simulatorクラスは状態を持たないので、そのメンバ関数をstaticにしても問題は無いと思うし
いちいち、Simulatorクラスをコンストラクトしてから使う必要が無いので見た目にもよいと思う。
SolutionHelperは実質、車両の変更か顧客へ進むかの条件分岐を関数としてラップしたものである。
そして、SolutionHelperはmain関数でしか使用されないのでmain.cppに移動させてもよいのではないだろうか。
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.