Accept data revision 1.4: real ages for all players (M5)
Revision 1.4 of the Modern data set brings birth dates for every player, the camp catalogue with its maps and 100 referees. The expansion now takes the age from a birth date for the original players as well (WorldPlayer::born); before, only the added players kept their data age. The yearly aging stops at 47, the most the age bits hold, so real ages (a goalkeeper of 40) cannot run into the bits above. The season sim counts second referee assignments per day. Two seasons and ten seasons run through; the save round trip is identical; second referee assignments drop to about 7 a season. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7de6f644f2
commit
44a7a77915
8 files changed
+35
-4
No files matched your search
@@ -66,7 +66,8 @@ void check_state(const modern::ModernState& g, const std::string& when, Checks&
|
||||
if (id == 0xfff) continue;
|
||||
if (!seen.insert(id).second) c.fail("player in two squad slots", when + " player " + std::to_string(id));
|
||||
const Player& p = g.players.at(size_t(id));
|
||||
if (p.age() < 16 || p.age() > 40) c.fail("age outside 16-40", when + " player " + std::to_string(id) + " age " + std::to_string(p.age()));
|
||||
// a Modern world brings real ages (a keeper of 40); the age field holds up to 47
|
||||
if (p.age() < 16 || p.age() > (modern::current_world() ? 47 : 40)) c.fail("age outside 16-40 (Modern: 47)", when + " player " + std::to_string(id) + " age " + std::to_string(p.age()));
|
||||
if (p.technique() > 99 || p.condition() > 99) c.fail("technique/condition above 99", when + " player " + std::to_string(id));
|
||||
}
|
||||
// the human managers: money within a sane range, a squad with at least 11 players
|
||||
@@ -145,6 +146,21 @@ void print_almanac(const modern::ModernState& g) {
|
||||
std::printf("almanac: %zu seasons, %zu matches, %zu events, %zu bytes uncompressed, %u new player identities\n",
|
||||
seasons.size(), matches, events, bytes, g.almanac.generated_players);
|
||||
std::printf("almanac: %zu matches whose goal events differ from the result, %zu without line-ups\n", mismatched, without_lineup);
|
||||
{
|
||||
// referees with a second match on one day (the fallback when the pool runs out, F9)
|
||||
size_t twice = 0, days = 0;
|
||||
for (const auto& s : seasons) {
|
||||
std::map<uint32_t, std::map<uint8_t, int>> by_day;
|
||||
for (const auto& m : s.matches)
|
||||
if (m.referee) ++by_day[m.date][m.referee];
|
||||
for (const auto& [day, refs] : by_day) {
|
||||
bool any = false;
|
||||
for (const auto& [ref, n] : refs) if (n > 1) twice += size_t(n - 1), any = true;
|
||||
days += any;
|
||||
}
|
||||
}
|
||||
std::printf("almanac: %zu second referee assignments on %zu days\n", twice, days);
|
||||
}
|
||||
{
|
||||
// goals per match by competition (league index, or cup id + 100), over all seasons
|
||||
std::map<int, std::pair<long, long>> by; // matches, goals
|
||||
|
||||
Reference in new issue
Block a user