Files
Rail_Enterprise/data/schema/ai.schema.json
T
Alby96andClaude Opus 5.5 3d394c01d3 F6: bilanciamento con i bot su simulate
Banco di prova ripetibile per tarare l'economia (ADR 0025, obiettivi O1–O14
scritti prima della taratura):

- railenterprise-tools balance: semi × difficoltà × bot × anni in parallelo,
  rapporto deterministico (rapporto.txt con gli obiettivi, anni/mesi/prezzi/
  esecuzioni.csv, tempi.txt); simulate --bot <id>.
- Bot giocatore (PlayerBot): l'agente delle IA con le personalità di
  ai.json → bots guida la compagnia del giocatore; pianifica per primo; non
  è salvato né nell'hash, il formato dei salvataggi non cambia.
- Le IA usano la compravendita in proprio (supera ADR 0016 §9) con una regola
  mensile deterministica e parametri in ai.json → trading.
- Agente corretto: un trasformatore è fonte solo con gli input alimentati
  (prima i bot fallivano su linee rimaste senza merce finite le scorte
  iniziali); la linea dei ricambi di una rete nuova esce dal budget iniziale
  se l'utile la ripaga entro planning.partsDeferYears.
- Dati: market.world volumeShare 0,5 → 1,0 ed elasticity 1,0 → 2,5;
  townBonus 1,8 → 3,0, townRoiFactor 0,5 → 0,35.

Matrice predefinita (72 esecuzioni da 12 anni, 533 s): obiettivi da 5 a 9
su 14; livello 2 del bot competente in «Imprenditore» al 4° anno (prima 7°),
nessun fallimento dei bot in «Apprendista» e «Imprenditore», prezzi medi tra
0,77 e 1,42 volte il base (prima 0,38–2,78). Restano aperti O7–O11.

EconomyTests.PriceRisesWhenDemandExceedsSupply: la soglia passa da 1,5 a
1,25 volte in 120 giorni perché il mondo a volume pieno ed elasticità 2,5
assorbe parte dello squilibrio (aumento misurato ~1,36). Accettazioni F2, F4
e F5 invariate e verdi; 222 test verdi.

Refs #47.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:30:31 +01:00

248 lines
5.2 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Concorrenti IA (ai.json)",
"type": "object",
"properties": {
"$schema": {
"type": "string"
},
"version": {
"type": "integer",
"minimum": 1
},
"planning": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"personalities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$"
},
"name_it": {
"type": "string",
"minLength": 1
},
"roiThreshold": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"loanShareOfCredit": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"targetsPlayer": {
"type": "boolean"
},
"buysShares": {
"type": "boolean"
},
"maintenancePolicy": {
"type": "string",
"enum": [
"economy",
"standard",
"thorough"
]
}
},
"required": [
"id",
"name_it",
"roiThreshold",
"loanShareOfCredit",
"targetsPlayer",
"buysShares",
"maintenancePolicy"
],
"additionalProperties": false
},
"minItems": 3
},
"bots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$"
},
"name_it": {
"type": "string",
"minLength": 1
},
"roiThreshold": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"loanShareOfCredit": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"targetsPlayer": {
"type": "boolean"
},
"buysShares": {
"type": "boolean"
},
"maintenancePolicy": {
"type": "string",
"enum": [
"economy",
"standard",
"thorough"
]
}
},
"required": [
"id",
"name_it",
"roiThreshold",
"loanShareOfCredit",
"targetsPlayer",
"buysShares",
"maintenancePolicy"
],
"additionalProperties": false
},
"minItems": 1
},
"companyNames": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"minItems": 4,
"uniqueItems": true
},
"colors": {
"type": "array",
"items": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$"
},
"minItems": 1
},
"renewal": {
"type": "object",
"properties": {
"minSupersededYears": {
"type": "number",
"minimum": 0
},
"minAgeShareOfLife": {
"type": "number",
"minimum": 0
},
"cashReserveMultiple": {
"type": "number",
"minimum": 0
},
"maxTrainsPerMonth": {
"type": "integer",
"minimum": 0
}
},
"required": [
"minSupersededYears",
"minAgeShareOfLife",
"cashReserveMultiple",
"maxTrainsPerMonth"
],
"additionalProperties": false
},
"trading": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"minMargin": {
"type": "number",
"minimum": 0,
"maximum": 5
},
"priceSlack": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"minSellPriceShare": {
"type": "number",
"minimum": 0,
"maximum": 3
},
"maxUnits": {
"type": "integer",
"minimum": 1
},
"maxTradesPerMonth": {
"type": "integer",
"minimum": 0
},
"cashShare": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"cashReserveMultiple": {
"type": "number",
"minimum": 0
}
},
"required": [
"enabled",
"minMargin",
"priceSlack",
"minSellPriceShare",
"maxUnits",
"maxTradesPerMonth",
"cashShare",
"cashReserveMultiple"
],
"additionalProperties": false
},
"market": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean"
]
}
}
},
"required": [
"version",
"planning",
"personalities",
"companyNames",
"colors",
"market",
"renewal",
"trading",
"bots"
],
"additionalProperties": false
}