Files
Rail_Enterprise/data/schema/balance.schema.json
T
Alby96andClaude Opus 5.5 2992e7cc36 F6: mercato globale, storico prezzi a 24 mesi e previsione
Prima parte della F6: il pannello «Mercato globale» dell'immagine di
riferimento 06, con i dati calcolati dal server.

- Lo storico dei prezzi globali passa da 360 a 720 giorni. I salvataggi
  con lo storico di un anno si migrano al caricamento allungando la
  finestra (RollingWindow.Extended), senza cambiare formato.
- MarketOutlook (Core) è un'analisi in sola lettura del mondo: storico
  mensile, variazione a 30 giorni, offerta e domanda con la quota
  mondiale, scorte in mesi, indice materie prime, previsione a 4 mesi
  dalla componente mondiale con banda, destinazioni di vendita ordinate
  per prezzo con la linea che le collega, hub, evento in corso e
  avanzamento verso la compravendita in proprio. Parametri nuovi in
  balance.json (market.outlook); interpretazioni nell'ADR 0015.
- Protocollo: DetailKind.Market (7) e MarketReport (129); il server
  risponde su richiesta, il client lo mostra in un pannello a tutto
  schermo e il pilota automatico ne fa la schermata 16_mercato.
- Test: finestra allungata e migrazione, storico mensile, previsione
  deterministica ed entro i limiti, evento, analisi su Valdoria,
  round-trip del messaggio e quadro via WebSocket.

La simulazione non cambia: l'analisi non scrive nel mondo e
l'accettazione F4 dà gli stessi numeri di prima.

Closes #29.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 14:25:38 +01:00

506 lines
10 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Bilanciamento (balance.json)",
"type": "object",
"properties": {
"$schema": {
"type": "string"
},
"version": {
"type": "integer",
"minimum": 1
},
"time": {
"type": "object",
"properties": {
"tickMs": {
"type": "integer",
"minimum": 1
},
"ticksPerDay": {
"type": "integer",
"minimum": 1
},
"daysPerMonth": {
"type": "integer",
"minimum": 1
},
"monthsPerYear": {
"type": "integer",
"minimum": 1
},
"trainClockFactor": {
"type": "number",
"minimum": 1
},
"speeds": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 64
},
"minItems": 1
},
"defaultStartYear": {
"type": "integer",
"minimum": 1800,
"maximum": 2300
}
},
"required": [
"tickMs",
"ticksPerDay",
"daysPerMonth",
"monthsPerYear",
"trainClockFactor",
"speeds",
"defaultStartYear"
],
"additionalProperties": false
},
"map": {
"type": "object",
"properties": {
"cellSizeM": {
"type": "number",
"minimum": 1
},
"sizesKm": {
"type": "array",
"items": {
"type": "integer",
"minimum": 8,
"maximum": 1024
},
"minItems": 1
},
"chunkCells": {
"type": "integer",
"minimum": 8,
"maximum": 256
},
"maxElevationM": {
"type": "number",
"minimum": 100
},
"noise": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"relief": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"hydrology": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"cover": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"deposits": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"towns": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"industries": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"hubs": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
}
},
"required": [
"cellSizeM",
"sizesKm",
"chunkCells",
"maxElevationM",
"noise",
"relief",
"hydrology",
"cover",
"deposits",
"towns",
"industries",
"hubs"
],
"additionalProperties": false
},
"market": {
"type": "object",
"properties": {
"k": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"alpha": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"windowDays": {
"type": "integer",
"minimum": 1
},
"minPriceFactor": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"maxPriceFactor": {
"type": "number",
"minimum": 1
},
"ratioMin": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"ratioMax": {
"type": "number",
"minimum": 1
},
"world": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"historyDays": {
"type": "integer",
"minimum": 1
},
"outlook": {
"type": "object",
"properties": {
"historyMonths": {
"type": "integer",
"minimum": 1
},
"changeDays": {
"type": "integer",
"minimum": 1
},
"forecastMonths": {
"type": "integer",
"minimum": 0,
"maximum": 24
},
"forecastBandPerMonth": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"sellPlaces": {
"type": "integer",
"minimum": 1,
"maximum": 20
},
"eventThreshold": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"historyMonths",
"changeDays",
"forecastMonths",
"forecastBandPerMonth",
"sellPlaces",
"eventThreshold"
],
"additionalProperties": false
}
},
"required": [
"k",
"alpha",
"windowDays",
"minPriceFactor",
"maxPriceFactor",
"ratioMin",
"ratioMax",
"world",
"historyDays",
"outlook"
],
"additionalProperties": false
},
"localPrice": {
"type": "object",
"properties": {
"lambda": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"maxDeviation": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"epsilon": {
"type": "number",
"minimum": 0
}
},
"required": [
"lambda",
"maxDeviation",
"epsilon"
],
"additionalProperties": false
},
"industry": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"growth": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"town": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"migration": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"employment": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"localTransport": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"hubs": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"tariffs": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"finance": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"stockMarket": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
},
"industryMaintenance": {
"type": "object",
"additionalProperties": {
"type": [
"number",
"integer",
"boolean",
"array",
"object",
"string"
]
}
}
},
"required": [
"version",
"time",
"map",
"market",
"localPrice",
"industry",
"growth",
"town",
"migration",
"employment",
"localTransport",
"hubs",
"tariffs",
"finance",
"stockMarket",
"industryMaintenance"
],
"additionalProperties": false
}