rogueviz::kohonen:: an option to restrict the number of cells used

This commit is contained in:
Zeno Rogue 2018-06-28 10:27:35 +02:00
parent 82cd394fb0
commit 9f5667adc5
1 changed files with 10 additions and 0 deletions

View File

@ -593,6 +593,8 @@ void showbestsamples() {
if(whowon[i])
whowon[i]->samples++;
}
int kohrestrict = 1000000;
void sominit(int initto) {
@ -614,6 +616,11 @@ void sominit(int initto) {
allcells = cl.lst;
}
else allcells = currentmap->allcells();
if(isize(allcells) > kohrestrict) {
sort(allcells.begin(), allcells.end(), [] (cell *c1, cell *c2) { return hdist0(tC0(shmup::ggmatrix(c1))) < hdist0(tC0(shmup::ggmatrix(c2))); });
allcells.resize(kohrestrict);
}
cells = isize(allcells);
net.resize(cells);
@ -1177,6 +1184,9 @@ int readArgs() {
start_game();
verify_crawlers();
}
else if(argis("-somrestrict")) {
shift(); kohrestrict = argi();
}
else return 1;
return 0;