1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-26 00:47:00 +00:00

rogueviz::kohonen:: options now use - instead of _; added an option to draw random edges for testing

This commit is contained in:
Zeno Rogue 2018-07-05 09:56:09 +02:00
parent 34d7b1de96
commit a004afda21

View File

@ -1085,6 +1085,15 @@ void load_edges(const string& fname_edges, int pick = 0) {
addedge(p.first, p.second, 0, true); addedge(p.first, p.second, 0, true);
} }
void random_edges(int q) {
vector<int> ssamp;
for(auto p: sample_vdata_id) ssamp.push_back(p.second);
for(int i=0; i<q; i++) {
edgecolor = hrandpos();
addedge(ssamp[hrand(isize(ssamp))], ssamp[hrand(isize(ssamp))], 0, true);
}
}
void klistsamples(const string& fname_samples, bool best, bool colorformat) { void klistsamples(const string& fname_samples, bool best, bool colorformat) {
if(fname_samples != "") { if(fname_samples != "") {
printf("Listing samples...\n"); printf("Listing samples...\n");
@ -1316,19 +1325,23 @@ int readArgs() {
else if(argis("-somrestrict")) { else if(argis("-somrestrict")) {
shift(); kohrestrict = argi(); shift(); kohrestrict = argi();
} }
else if(argis("-som_maxgroup")) { else if(argis("-som-maxgroup")) {
shift(); max_group = argi(); shift(); max_group = argi();
} }
else if(argis("-som_mingroup")) { else if(argis("-som-mingroup")) {
shift(); min_group = argi(); shift(); min_group = argi();
} }
else if(argis("-som_fillgroups")) { else if(argis("-som-fillgroups")) {
fillgroups(); fillgroups();
} }
else if(argis("-som_load_edges")) { else if(argis("-som-load-edges")) {
shift(); kohonen::load_edges(args(), 0); shift(); kohonen::load_edges(args(), 0);
} }
else if(argis("-som_load_n_edges")) { else if(argis("-som-random-edges")) {
shift();
random_edges(argi());
}
else if(argis("-som-load-n-edges")) {
shift(); int n = argi(); shift(); int n = argi();
shift(); kohonen::load_edges(args(), n); shift(); kohonen::load_edges(args(), n);
} }