|
Player12
An open source football management simulator
|
How an AI club negotiates to borrow one of the managed club's players. More...
Classes | |
| struct | BorrowerContext |
| struct | BorrowerReply |
Enumerations | |
| enum class | Why : std::uint8_t { WithinBudget , Improved , WageRoom , FeeInsteadOfWages , ObligationDropped , AppearancesCut , FinalOffer , Unrealistic , Insulted , OutOfPatience , NoWageRoom , DeadlineDay , COUNT } |
Functions | |
| const char * | whyKey (Why why) |
| bool | isValid (const LoanTerms &terms) |
| int | loanWeeks (const BorrowerContext &context, LoanDuration duration) |
| double | expectedAppearances (const BorrowerContext &context, LoanDuration duration) |
| double | unplayedOdds (double expected, std::uint8_t minimum) |
| std::uint8_t | maxWageShare (const BorrowerContext &context) |
| double | borrowerCost (const BorrowerContext &context, const LoanTerms &terms) |
| double | effectiveCeiling (const BorrowerContext &context) |
| bool | affordable (const BorrowerContext &context, const LoanTerms &terms) |
| BorrowerReply | respond (const BorrowerContext &context, const LoanTerms ¤t, const LoanTerms &asked, double roll) |
| LoanTerms | openingOffer (const BorrowerContext &context, LoanDuration duration, std::uint8_t share, int age, double option_roll) |
| std::uint32_t | ceilingFor (const BorrowerContext &context, const LoanTerms &opening, double roll) |
How an AI club negotiates to borrow one of the managed club's players.
The borrower has a hidden ceiling on what the loan may cost it, measured by borrowerCost(): the share of the wage it pays over the loan, the loan fee, a recall clause and the expected fee for appearances it fails to give him. Its wage room caps the share it can take on, its budget the fees, and a mandatory purchase must stay near the player's value. It answers the club's counters on later days with structures of its own (a fee instead of a bigger share, an option instead of an obligation, fewer guaranteed appearances), runs out of patience, walks away from demands far beyond its ceiling and concedes faster near the deadline, like the buyer (BuyerNegotiation, whose moves and decisions it shares). Pure rules: every draw is passed in.
|
strong |
Why the borrower answered the way it did.
| bool LoanNegotiation::affordable | ( | const BorrowerContext & | context, |
| const LoanTerms & | terms | ||
| ) |
The terms fit its wage room and budget (cost aside).
| double LoanNegotiation::borrowerCost | ( | const BorrowerContext & | context, |
| const LoanTerms & | terms | ||
| ) |
What terms cost the borrower over the loan.
| std::uint32_t LoanNegotiation::ceilingFor | ( | const BorrowerContext & | context, |
| const LoanTerms & | opening, | ||
| double | roll | ||
| ) |
Ceiling of a borrower opening with opening, drawn with roll.
| double LoanNegotiation::effectiveCeiling | ( | const BorrowerContext & | context | ) |
The ceiling lifted by deadline pressure.
| double LoanNegotiation::expectedAppearances | ( | const BorrowerContext & | context, |
| LoanDuration | duration | ||
| ) |
Appearances the borrower expects to give him over the loan.
| bool LoanNegotiation::isValid | ( | const LoanTerms & | terms | ) |
True when the loan terms are consistent (shares, clauses).
| int LoanNegotiation::loanWeeks | ( | const BorrowerContext & | context, |
| LoanDuration | duration | ||
| ) |
Weeks a loan of duration runs from now.
| std::uint8_t LoanNegotiation::maxWageShare | ( | const BorrowerContext & | context | ) |
Highest wage share (whole percent) its wage room allows.
| LoanTerms LoanNegotiation::openingOffer | ( | const BorrowerContext & | context, |
| LoanDuration | duration, | ||
| std::uint8_t | share, | ||
| int | age, | ||
| double | option_roll | ||
| ) |
Opening offer for a loan of duration: share of the wage (capped by the wage room) and, drawn with option_roll for a young player, an option to buy.
| BorrowerReply LoanNegotiation::respond | ( | const BorrowerContext & | context, |
| const LoanTerms & | current, | ||
| const LoanTerms & | asked, | ||
| double | roll | ||
| ) |
Answer to the club's asked terms while current is on the table. roll in [0, 1) picks how the borrower reshapes its proposal.
| double LoanNegotiation::unplayedOdds | ( | double | expected, |
| std::uint8_t | minimum | ||
| ) |
Odds he plays fewer than minimum games when expected are likely.
| const char * LoanNegotiation::whyKey | ( | Why | why | ) |
Language key describing why (e.g. "LOAN_WHY_WAGE_ROOM").