|
Player12
An open source football management simulator
|
Pure training rules (no game state), unit tested in isolation. More...
Functions | |
| Microcycle | presetMicrocycle (TrainingPreset preset) |
| float | sessionLoad (TrainingSlot slot, TrainingIntensity squad_intensity) |
| float | balancedWeekLoad () |
| float | typicalDailyLoad () |
| float | sessionInjuryExposure (TrainingSlot slot, TrainingIntensity squad_intensity) |
| std::optional< MicrocycleDay > | dayFor (int days_since_last, int days_to_next, std::int32_t ordinal) |
| bool | isCongested (int days_since_last, int days_to_next) |
| TrainingDay | scheduleDay (const TeamTrainingPlan &plan, int days_since_last, int days_to_next, std::int32_t ordinal) |
| float | conditionDrain (float load, float stamina) |
| float | recoveryShare (SessionType session) |
| float | sharpnessGain (TrainingSlot slot) |
| float | workloadRatio (const PlayerTrainingState &state) |
| float | workloadRiskMultiplier (const PlayerTrainingState &state) |
| WorkloadRisk | workloadRisk (const PlayerTrainingState &state, float condition) |
| void | rollDay (PlayerTrainingState &state) |
| float | developmentMultiplier (const TeamTrainingPlan &plan, int age, float coaching_quality) |
| std::array< float, 9 > | scheduleAttributeMix (const TeamTrainingPlan &plan) |
| std::array< float, 9 > | focusAttributeMix (TrainingFocus focus, const StatsConfig &config) |
| const std::array< const char *, 9 > & | attributeNames () |
| float | applyDirectedGrowth (Player &player, float growth, const TeamTrainingPlan &plan, TrainingFocus focus, const StatsConfig &config) |
| TacticSnapshot | snapshotOf (const Team &team) |
| float | familiarityLoss (const TacticSnapshot &before, const TacticSnapshot &after) |
| float | familiarityGain (TrainingSlot slot) |
| std::vector< TrainingAdvice > | advise (const AdviceInputs &inputs) |
| const char * | sessionKey (SessionType session) |
| const char * | intensityKey (TrainingIntensity intensity) |
| const char * | presetKey (TrainingPreset preset) |
| const char * | focusKey (TrainingFocus focus) |
| const char * | dayKey (MicrocycleDay day) |
| const char * | riskKey (WorkloadRisk risk) |
Variables | |
| constexpr float | MATCH_LOAD = 1.8f |
Pure training rules (no game state), unit tested in isolation.
| std::vector< TrainingAdvice > TrainingModel::advise | ( | const AdviceInputs & | inputs | ) |
Assistant recommendations, most important first (never empty).
| float TrainingModel::applyDirectedGrowth | ( | Player & | player, |
| float | growth, | ||
| const TeamTrainingPlan & | plan, | ||
| TrainingFocus | focus, | ||
| const StatsConfig & | config | ||
| ) |
Applies the directed part of a week's growth: 30% follows the schedule mix over the role's attributes (overall-preserving), 35% follows the individual focus (any attribute, capped at potential + 5). Physical attributes only grow up to 25.
| const std::array< const char *, 9 > & TrainingModel::attributeNames | ( | ) |
Attribute names in the order used by the mixes.
| float TrainingModel::balancedWeekLoad | ( | ) |
Load of a Balanced week at normal intensity (six training days).
| float TrainingModel::conditionDrain | ( | float | load, |
| float | stamina | ||
| ) |
Condition lost in a session with load for a player with stamina.
| std::optional< MicrocycleDay > TrainingModel::dayFor | ( | int | days_since_last, |
| int | days_to_next, | ||
| std::int32_t | ordinal | ||
| ) |
Maps a calendar day onto the microcycle.
| days_since_last | Days since the previous match (<= 0: unknown). |
| days_to_next | Days to the next match (0: today, < 0: unknown). |
| ordinal | Day ordinal, used to cycle through the template when no fixture is near. |
| const char * TrainingModel::dayKey | ( | MicrocycleDay | day | ) |
| float TrainingModel::developmentMultiplier | ( | const TeamTrainingPlan & | plan, |
| int | age, | ||
| float | coaching_quality | ||
| ) |
Development-rate multiplier from the week's training volume, the preset and the coaching quality (0-1), before facilities.
| float TrainingModel::familiarityGain | ( | TrainingSlot | slot | ) |
Share of the familiarity gap closed by one session.
| float TrainingModel::familiarityLoss | ( | const TacticSnapshot & | before, |
| const TacticSnapshot & | after | ||
| ) |
Share of familiarity lost when the drilled tactic changes from before to after (0 for identical tactics, at most 0.6).
| std::array< float, 9 > TrainingModel::focusAttributeMix | ( | TrainingFocus | focus, |
| const StatsConfig & | config | ||
| ) |
Attributes trained by an individual focus (same order). Role retraining uses the target role category's weights from config.
| const char * TrainingModel::focusKey | ( | TrainingFocus | focus | ) |
| const char * TrainingModel::intensityKey | ( | TrainingIntensity | intensity | ) |
| bool TrainingModel::isCongested | ( | int | days_since_last, |
| int | days_to_next | ||
| ) |
True when the previous and next match are at most four days apart.
| const char * TrainingModel::presetKey | ( | TrainingPreset | preset | ) |
| Microcycle TrainingModel::presetMicrocycle | ( | TrainingPreset | preset | ) |
Template of a preset (Custom returns Balanced).
| float TrainingModel::recoveryShare | ( | SessionType | session | ) |
Extra share of the condition deficit recovered by a session type.
| const char * TrainingModel::riskKey | ( | WorkloadRisk | risk | ) |
| void TrainingModel::rollDay | ( | PlayerTrainingState & | state | ) |
Closes a day: folds the pending load into the acute and chronic loads.
| std::array< float, 9 > TrainingModel::scheduleAttributeMix | ( | const TeamTrainingPlan & | plan | ) |
Relative attention of the plan's template to each attribute (Pace, Shooting, Passing, Dribbling, Defending, Physicality, Stamina, Vision, Goalkeeping), used to steer development.
| TrainingDay TrainingModel::scheduleDay | ( | const TeamTrainingPlan & | plan, |
| int | days_since_last, | ||
| int | days_to_next, | ||
| std::int32_t | ordinal | ||
| ) |
The day's session after the congestion rule.
| float TrainingModel::sessionInjuryExposure | ( | TrainingSlot | slot, |
| TrainingIntensity | squad_intensity | ||
| ) |
Training-injury exposure of a session relative to an average training day (the Balanced template averages 1.0 over its six days, so its weekly exposure equals the calibrated 6 x 1.2 training hours).
| const char * TrainingModel::sessionKey | ( | SessionType | session | ) |
Language keys.
| float TrainingModel::sessionLoad | ( | TrainingSlot | slot, |
| TrainingIntensity | squad_intensity | ||
| ) |
Training load of a session at the squad-wide intensity.
| float TrainingModel::sharpnessGain | ( | TrainingSlot | slot | ) |
Match-sharpness gain of a session (sharpness decays 0.5 per day).
| TacticSnapshot TrainingModel::snapshotOf | ( | const Team & | team | ) |
Snapshot of a club's current strategy and outfield shape.
| float TrainingModel::typicalDailyLoad | ( | ) |
Typical average daily load (training plus one match a week).
| float TrainingModel::workloadRatio | ( | const PlayerTrainingState & | state | ) |
Acute:chronic workload ratio (1.0 with no history).
| WorkloadRisk TrainingModel::workloadRisk | ( | const PlayerTrainingState & | state, |
| float | condition | ||
| ) |
Risk band shown to the user.
| float TrainingModel::workloadRiskMultiplier | ( | const PlayerTrainingState & | state | ) |
Injury hazard multiplier from the workload history: 1 + 0.5 * (ACWR - 1.3) above 1.3 (capped at 1.5), 0.9 with a high, stable chronic load.
|
inlineconstexprprivate |
Load of a full match, in session units. [P: match ~1.8x MD-3]