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
@ -594,6 +594,8 @@ void showbestsamples() {
|
||||
whowon[i]->samples++;
|
||||
}
|
||||
|
||||
int kohrestrict = 1000000;
|
||||
|
||||
void sominit(int initto) {
|
||||
|
||||
if(inited < 1 && initto >= 1) {
|
||||
@ -615,6 +617,11 @@ void sominit(int initto) {
|
||||
}
|
||||
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);
|
||||
for(int i=0; i<cells; i++) net[i].where = allcells[i], allcells[i]->landparam = i;
|
||||
@ -1177,6 +1184,9 @@ int readArgs() {
|
||||
start_game();
|
||||
verify_crawlers();
|
||||
}
|
||||
else if(argis("-somrestrict")) {
|
||||
shift(); kohrestrict = argi();
|
||||
}
|
||||
|
||||
else return 1;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user