mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-06 11:32:49 +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++;
|
whowon[i]->samples++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int kohrestrict = 1000000;
|
||||||
|
|
||||||
void sominit(int initto) {
|
void sominit(int initto) {
|
||||||
|
|
||||||
if(inited < 1 && initto >= 1) {
|
if(inited < 1 && initto >= 1) {
|
||||||
@ -615,6 +617,11 @@ void sominit(int initto) {
|
|||||||
}
|
}
|
||||||
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);
|
||||||
for(int i=0; i<cells; i++) net[i].where = allcells[i], allcells[i]->landparam = i;
|
for(int i=0; i<cells; i++) net[i].where = allcells[i], allcells[i]->landparam = i;
|
||||||
@ -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…
x
Reference in New Issue
Block a user