Player12
An open source football management simulator
Loading...
Searching...
No Matches
match_insights.h File Reference
#include <array>
#include <cstdint>
#include <functional>
#include <optional>
#include <span>
#include <string>
#include <vector>
#include "global/types.h"
#include "model/match_analysis.h"
#include "model/match_tracking.h"

Go to the source code of this file.

Classes

struct  DetailPlayer
 Tracked numbers of one player in a match (attacking frame). More...
 
struct  PassLink
 Completed passes from one player to a team-mate. More...
 
struct  DetailSubstitution
 A substitution of the match. More...
 
struct  MatchDetail
 Per-match aggregates behind the match report's analysis: touch maps, the pass network, progressive passes, pressures, expected assists, final-third pressure over time and the substitutions, for both sides. Stored as a compact binary blob next to the managed match's snapshot. More...
 
struct  KeyMoment
 One entry of the key-moments list. More...
 
struct  InsightInput
 What the summary and the key moments are built from. More...
 

Namespaces

namespace  MatchInsights
 

Functions

MatchDetail captureDetail (const MatchEngine &engine)
 
std::vector< KeyMoment > keyMoments (const InsightInput &input)
 
std::vector< AnalysisLine > summariseMatch (const InsightInput &input)
 
std::array< int, 3 > finalThirdByFlank (const MatchDetail &detail, bool home)
 Final-third touches of one side split by flank (attacking frame).
 

Variables

constexpr float MatchInsights::BIG_CHANCE_XG = 0.3f
 
constexpr float MatchInsights::CLEAR_XG_GAP = 0.6f
 
constexpr float MatchInsights::FINISHING_GAP = 1.0f
 
constexpr int MatchInsights::MIN_FLANK_TOUCHES = 24
 
constexpr float MatchInsights::FLANK_SHARE = 0.45f
 
constexpr int MatchInsights::MIN_SPELL_TOUCHES = 12
 
constexpr float MatchInsights::LOW_SHOT_QUALITY = 0.075f
 
constexpr int MatchInsights::MIN_SHOTS_FOR_QUALITY = 10
 
constexpr int MatchInsights::MAX_SUMMARY_LINES = 5
 

Function Documentation

◆ captureDetail()

MatchDetail captureDetail ( const MatchEngine &  engine)

Builds the detail of a finished (or running) match from its tracker.

◆ finalThirdByFlank()

std::array< int, 3 > finalThirdByFlank ( const MatchDetail &  detail,
bool  home 
)

Final-third touches of one side split by flank (attacking frame).

◆ keyMoments()

std::vector< KeyMoment > keyMoments ( const InsightInput &  input)

Goals, cards, big chances, woodwork and substitutions, by minute.

◆ summariseMatch()

std::vector< AnalysisLine > summariseMatch ( const InsightInput &  input)

A few lines explaining the result from the managed side's point of view: the xG balance, finishing at both ends, shot quality, the flanks where the attacks came from, the strongest spell, set pieces and the main passing connection. Pure and deterministic; sentences hedge on what a single match can show.