1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-02-21 08:09:43 +00:00

rogueviz::dhrg:: penalty

This commit is contained in:
Zeno Rogue
2026-01-27 11:26:32 +01:00
parent a4fff5080b
commit b798d2bfd0

View File

@@ -18,6 +18,9 @@ vector<char> tomove;
bool smartmove = false;
bool dorestart = false;
/* penalty, to improve control. 0 = no penalty */
ld penalty = 0;
int lastmoves;
int movearound() {
@@ -59,7 +62,10 @@ int movearound() {
llo2[d] = loglik_chosen();
if(lc_type == 'C')
add_to_set(mc2[d], -1, 0);
if(llo2[d] > bestllo) bestd = d, bestllo = llo2[d];
ld with_penalty = llo2[d];
if(penalty) with_penalty += cgi.expansion->get_descendants(mc->lev).log_approx() * penalty;
if(penalty) with_penalty -= cgi.expansion->get_descendants(mc2[d]->lev).log_approx() * penalty;
if(with_penalty > bestllo) bestd = d, bestllo = with_penalty;
add_to_tally(mc2[d], -1, 0);
tallyedgesof(i, -1, mc2[d]);
@@ -81,6 +87,7 @@ int movearound() {
}}
// dispnewmoves();
println(hlog, " moves = ", moves);
if(penalty) println(hlog, "penalty = ", penalty);
return lastmoves = moves;
}