mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 20:29:17 +00:00
rogueviz::kohonen:: an option to restrict the number of cells used
This commit is contained in:
parent
82cd394fb0
commit
9f5667adc5
@ -593,6 +593,8 @@ void showbestsamples() {
|
|||||||
if(whowon[i])
|
if(whowon[i])
|
||||||
whowon[i]->samples++;
|
whowon[i]->samples++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int kohrestrict = 1000000;
|
||||||
|
|
||||||
void sominit(int initto) {
|
void sominit(int initto) {
|
||||||
|
|
||||||
@ -614,6 +616,11 @@ void sominit(int initto) {
|
|||||||
allcells = cl.lst;
|
allcells = cl.lst;
|
||||||
}
|
}
|
||||||
else allcells = currentmap->allcells();
|
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);
|
cells = isize(allcells);
|
||||||
net.resize(cells);
|
net.resize(cells);
|
||||||
@ -1177,6 +1184,9 @@ int readArgs() {
|
|||||||
start_game();
|
start_game();
|
||||||
verify_crawlers();
|
verify_crawlers();
|
||||||
}
|
}
|
||||||
|
else if(argis("-somrestrict")) {
|
||||||
|
shift(); kohrestrict = argi();
|
||||||
|
}
|
||||||
|
|
||||||
else return 1;
|
else return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user