Skip to content

Tweaks to improve breeder reactor generation #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions OptFission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ namespace Fission {
default: // GoalPower
return x.avgMult;
case GoalBreeder:
return x.avgBreed;
// reward excess heat because it makes it easier to add more cells
return x.avgBreed + (x.netHeat < 0 ? - x.netHeat / (settings.fuelBaseHeat - x.netHeat) : 0);
case GoalEfficiency:
return settings.ensureHeatNeutral ? (x.efficiency - 1) * x.dutyCycle : x.efficiency - 1;
}
Expand Down Expand Up @@ -118,8 +119,13 @@ namespace Fission {
allowedTiles.clear();
allowedTiles.emplace_back(Air);
for (int tile{}; tile < Air; ++tile)
if (sample.limit[tile] < 0 || sample.limit[tile] >= nSym)
if (sample.limit[tile] < 0 || sample.limit[tile] >= nSym) {
allowedTiles.emplace_back(tile);
// bias cells being added in order to prevent shear lines in cell patterns
if (tile == Cell && ((x + y + z) % 2 == 1)) {
allowedTiles.emplace_back(tile);
}
}
int newTile(allowedTiles[std::uniform_int_distribution<>(0, static_cast<int>(allowedTiles.size() - 1))(rng)]);
if (newTile != Air)
sample.limit[newTile] -= nSym;
Expand Down