Lambda Bazaar: a capacity market for your dark fiber
A new NOC tab sells spectrum, managed 100G, 400G, 800G and 1.6T waves, and dark pair IRUs on every route you hold fiber on. Demand per route moves every day (its own cycle, noise, and news: fiber cuts, hyperscalers, AI clusters, rivals lighting glass, mergers) and grows about 15% a year, with buyers moving to bigger waves over the years and carriers on your glass asking to move up a size. You choose what to keep back for your own traffic, from what demand the broker lists, and the price it never sells below. Managed waves come out of capacity you lit; prices follow the fiber's cost, how hot and how full the route is, and its latency (400G at 2.7x 100G on land, 3.8x subsea). A Cable broker pays 3% instead of 10% and sees each route's forecast and routes worth building. Rule F5 now bounds sales by the moving market; new rule F8 covers managed waves. The route fuzz skips dashboard tabs main does not have yet.
This commit is contained in:
parent
e6b5464352
commit
2f738dceda
34 changed files with 891 additions and 56 deletions
|
|
@ -68,9 +68,10 @@ These are what the game promises, held up by `tests/gameplay-rules.test.js` (one
|
|||
| F2 | On On-call, a simple build in a start city (broadband, the cheapest 100G transit, an exchange port with the route server) makes money within 3 months, in Frankfurt, New York, Singapore and Johannesburg. | Seeded today it turns a profit in month 1 or 2; a balance change that breaks this makes the start too hard. |
|
||||
| F3 | A specialist path (#187) only brings a customer type in below its level when the network can already serve it, or nearly: the spotted cities have POPs, the latency is met, the fiber carries at least three quarters of the smallest order. | Capability, not luck: an offer you cannot fulfil with a reasonable build is a trap. |
|
||||
| F4 | The chaos monkey visits only On-call and BGP at 3 a.m. (never Change Freeze, Sandbox, puzzles or scenarios), not before day 180, for 120 to 240 days; while it is here its snips replace the ordinary failures, each snip heals within a week, and it goes after tubes with no other way round first. | A test of resilience you can prepare for, not a pile-on: the reward goes to networks built with a second path. |
|
||||
| F5 | Capacity you rent to other carriers never outgrows the route's market: a broker listing sells over time as carriers between the two cities want it, and neither it nor a random offer sells past what both cities' eyeballs support (a landing town counts the big city it serves). | Rent that scales with your own glass and not with demand is a money machine (#203). |
|
||||
| F5 | Capacity you rent to other carriers never outgrows the route's market: the capacity market sells a listing over time as carriers between the two cities want it, never past what they want that day (both cities' eyeballs, a landing town counting the big city it serves, grown about 15% a year up to 8 times, and at most 2.5 times its usual size on its hottest day), and a random offer never past what the eyeballs alone support. | Rent that scales with your own glass and not with demand is a money machine (#203); a market that never moves or grows makes no decisions. |
|
||||
| F6 | An alien wave rents for at most 30% of what its fiber costs a month (lease plus amplifiers), each wave sold between two cities is never dearer than the one before, and a route sold out to its market earns less than eight times that cost. | A buyer would lease the fiber rather than pay many times its price; the old price made one wave worth the whole fiber and a full route 11 to 35 times its lease (#203). |
|
||||
| F7 | Extra crews cut a build on land to half its planned time at most. | Permits, rights of way and trenching set the pace; a 1,000-day build finishing tomorrow made lead times meaningless (#203). |
|
||||
| F8 | In the capacity market (Lambda Bazaar), a managed wave comes out of capacity you lit yourself (your own traffic gets that much less, and the customer suffers when your optics cannot carry it), rides one channel (an 800G or 1.6T wave needs an optic that big), and is priced against its fiber: a 400G wave 2.7 times a 100G one on land and 3.8 times on subsea, each bigger size cheaper per bit. Spectrum lists at 30% of the fiber's monthly cost, and heat moves any price by at most −30% to +35%. | Selling lit capacity must cost capacity, or every fiber sells twice; the ratios are 2025 market prices (TeleGeography), so bigger waves win on volume, not on price per bit. |
|
||||
|
||||
## DDoS
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ All notable changes to this project are documented here. The project follows
|
|||
## [Unreleased]
|
||||
|
||||
- New badges for traffic: serve 1 Tbps and 10 Tbps on the way to the 100 Tbps and petabit ones, and carry a petabyte, 100 petabytes, an exabyte and a zettabyte in one game. The dashboard shows how much traffic your network has carried so far, and only the top step of each ladder is legendary: Hundred Terabits is now epic.
|
||||
- Lambda Bazaar, a capacity market for your dark fiber, is a new tab in the NOC dashboard. Sell spectrum, managed 100G, 400G, 800G and 1.6T waves, and dark pair IRUs on every route you hold fiber on, and choose how much to keep back for your own traffic, from what demand the broker lists, and the price it never sells below. What each route wants moves all the time and grows every year: hot routes pay more, a fiber cut next door or a hyperscaler breaking ground sends demand up, buyers move from 100G to bigger waves over the years, and carriers already on your glass ask to move up a size. Short, straight routes earn more for fast waves. A Cable broker pays the broker 3% instead of 10%, and sees where each route is heading and which routes between its POPs are worth building.
|
||||
|
||||
## [3.1.0] — 2026-11-07
|
||||
|
||||
- Whoever runs sales can now answer renewal haggles for you, each in their own way: switch it on at the sales desk. The engineer keeps nerdy customers at the market price and gives everyone else their discount, the shark refuses discounts and some customers walk, and the CEO settles it on the golf course, for better or worse.
|
||||
|
|
|
|||
|
|
@ -111,12 +111,14 @@ function playGame(pages, seed, opts = {}) {
|
|||
|
||||
// A screen's buttons on both pages; the same list or a divergence.
|
||||
// Buttons for actions main's page does not have (a new feature's) are left out: the driver only presses what both have.
|
||||
// So are the switches and dials of a standing order this checkout retired (main's sheet still shows them).
|
||||
let baseActs = null, retired = null;
|
||||
// So are the switches and dials of a standing order this checkout retired (main's sheet still shows them), and a
|
||||
// dashboard tab main's page does not have yet.
|
||||
let baseActs = null, retired = null, baseTabs = null;
|
||||
const screen = (w) => { const [a0, b0] = both('screen', w); baseActs = baseActs || new Set(base.call('acts'));
|
||||
if (!retired) { const [o1, o2] = both('sKeys'); retired = new Set(o1.orders.filter((k) => !o2.orders.includes(k))); }
|
||||
const a = Array.isArray(a0) ? a0.filter((x) => !(/^ops/.test(x.act) && retired.has(x.args && x.args.k))) : a0;
|
||||
const b = Array.isArray(b0) ? b0.filter((x) => baseActs.has(x.act)) : b0; same('buttons of ' + JSON.stringify(w), a, b); return a || []; };
|
||||
if (!baseTabs) baseTabs = new Set(JSON.parse(base.ev('JSON.stringify(DTABS)')));
|
||||
const b = Array.isArray(b0) ? b0.filter((x) => baseActs.has(x.act) && !(x.act === 'dashTab' && x.args && !baseTabs.has(x.args.k))) : b0; same('buttons of ' + JSON.stringify(w), a, b); return a || []; };
|
||||
const press = (b, where) => { acts[b.act] = (acts[b.act] || 0) + 1; const [e1, e2] = both('press', b); same('press ' + where, e1, e2); note(where + ' ' + b.act + JSON.stringify(b.args) + (e1 ? ' !' + e1 : '')); };
|
||||
// Answer whatever window opened, a few levels deep, then close it.
|
||||
const modal = (bias) => {
|
||||
|
|
|
|||
|
|
@ -388,8 +388,6 @@
|
|||
"broker.goal_wave":"Verkaufe eine Wave auf deinem Glas",
|
||||
"broker.goal_wave_d":"Carrier mieten Alien Waves auf Fiber, die du beleuchtet hast. Nimm eine aus deinen Deals an.",
|
||||
"broker.goal_win_d":"Deine eigenen Kabel landen auf fünf Kontinenten, und Carrier zahlen dir 1 Mio. $ im Monat für Kapazität.",
|
||||
"broker.how":"verkauft, wie der Markt es will; der Broker behält 10 %",
|
||||
"broker.lead":"Der Broker behält dein Angebot und verkauft es nach und nach, wenn Carrier zwischen diesen beiden Städten Kapazität brauchen. Er behält 10 % jedes Verkaufs.",
|
||||
"broker.list_all":"Alle {n} anbieten",
|
||||
"broker.list_more":"{n} weitere anbieten",
|
||||
"broker.list_n":{"one":"{n} Welle anbieten","other":"{n} Wellen anbieten"},
|
||||
|
|
@ -3037,6 +3035,75 @@
|
|||
"loop.something_in_the_noc_glitched_the":"<b>Im NOC hat etwas gehakt.</b><br>Das Spiel lief weiter. Falls dir etwas komisch vorkommt, exportiere deinen Spielstand und mach ein Issue auf GitHub auf.",
|
||||
"loop.welcome_back_name_your_network_is":"<b>Willkommen zurück, {name}.</b><br>Dein Netz ist genau da, wo du es gelassen hast: {date}.",
|
||||
"loop.your_saved_game_could_not_be":"<b>Dein Spielstand konnte nicht geladen werden.</b><br>Er war beschädigt, also wurde ein Backup aufbewahrt, und du kannst neu anfangen.",
|
||||
"market.below_floor":"unter deiner Untergrenze",
|
||||
"market.cool":"❄️ Kühl ×{x}",
|
||||
"market.days_ago":{"one":"vor {n} Tag","other":"vor {n} Tagen"},
|
||||
"market.fee":"Der Broker behält",
|
||||
"market.fee_broker":"der Satz für Cable broker",
|
||||
"market.floor":"Nie verkaufen unter",
|
||||
"market.forecast":"In 30 Tagen {a} · in 90 Tagen {b}",
|
||||
"market.forecast_lock":"Ein Cable broker sieht auch, wohin sich jede Strecke entwickelt.",
|
||||
"market.forecast_now":"{n} jetzt · {a} in 30 Tagen · {b} in 90 Tagen",
|
||||
"market.g_sold_as_managed":"{g} als Managed Waves verkauft",
|
||||
"market.hold":"Für deinen eigenen Traffic zurückhalten",
|
||||
"market.hold_d":"Der Anteil an Spektrum und beleuchteter Kapazität jeder Glasfaser, den der Broker nie verkauft, damit dein Traffic Platz zum Wachsen hat.",
|
||||
"market.hot":"🔥 Heiß ×{x}",
|
||||
"market.how":"geht weg, wie der Markt will; der Broker behält {n}%",
|
||||
"market.lead":"Carrier kaufen Kapazität auf den Strecken, auf denen du Dark Fiber hast. Was jede Strecke will, ändert sich ständig: heiße Strecken zahlen mehr und füllen sich schneller, eine kurze, gerade Strecke verkauft Waves mit Aufschlag, und eine lange kostet mehr, weil ihre Glasfaser mehr kostet. Leg fest, was der Broker verkauft, ab welcher Nachfrage und zu welchem Preis.",
|
||||
"market.lead_fiber":"Der Broker behält dein Angebot und verkauft es nach und nach, wenn Carrier zwischen diesen beiden Städten Kapazität wollen. Er behält {n}% jedes Verkaufs.",
|
||||
"market.legend":"Jeder Balken: was verkauft ist (grün) von dem, was die Strecke will (der Strich); die rosa Markierung ist dein Minimum.",
|
||||
"market.managed_wave":"Managed Wave",
|
||||
"market.min":"Anbieten, solange die Strecke mindestens will",
|
||||
"market.n_g_left":{"one":"{n} Managed Wave mit {g} noch zu verkaufen","other":"{n} Managed Waves mit {g} noch zu verkaufen"},
|
||||
"market.n_g_wave_on":{"one":"{n}× Managed Wave mit {g} auf deiner Glasfaser {a}–{b}","other":"{n}× Managed Waves mit {g} auf deiner Glasfaser {a}–{b}"},
|
||||
"market.needs_optic":"braucht eine {g}-Optik auf dieser Glasfaser",
|
||||
"market.news":"Marktnachrichten",
|
||||
"market.news_ai_big":"Ein KI-Cluster will zwischen {a} und {b} reden: Waves ab 400G sind dort heiß begehrt.",
|
||||
"market.news_boom":"Ein Streaming-Hit flutet {a}: Carrier wollen von dort mehr Spektrum und 100G-Waves.",
|
||||
"market.news_cut":"Glasfaser zwischen {a} und {b} durchtrennt: Carrier wollen getrennte Wege drumherum.",
|
||||
"market.news_dc_big":"Ein Hyperscaler baut bei {a}: von dort sind große Waves und dunkle Faserpaare gefragt.",
|
||||
"market.news_exch":"Trader ziehen ihre Matching Engines nach {a}: schnelle Waves von dort bringen mehr.",
|
||||
"market.news_glut":"Ein Konkurrent beleuchtet neue Glasfaser zwischen {a} und {b}: die Käufer dort kühlen ab.",
|
||||
"market.news_merge":"Zwei Carrier fusionieren zwischen {a} und {b}: dort gibt es weniger Käufer.",
|
||||
"market.news_redsea":"Seekabel sind durchtrennt: jede Seekabelstrecke ist gefragt.",
|
||||
"market.no_news":"Bisher ruhig.",
|
||||
"market.no_room":"kein Platz mehr: beleuchte mehr Kapazität",
|
||||
"market.no_routes":"Du hast noch keine fertige Dark Fiber. Miete oder grab welche, dann taucht ihre Strecke hier auf.",
|
||||
"market.not_selling":"Nicht im Verkauf",
|
||||
"market.not_yet":"Hier will das noch niemand: {list}.",
|
||||
"market.open":"Lambda Bazaar",
|
||||
"market.p_iru":"IRUs für dunkle Faserpaare",
|
||||
"market.p_iru_d":"Ein freies Faserpaar in einem Graben, den du gegraben hast: zwei Jahre seiner Miete im Voraus, dann ein bisschen Wartung im Monat.",
|
||||
"market.p_spec":"Spektrum",
|
||||
"market.p_spec_d":"Eine Alien Wave: ein Kanal deines Line Systems, die Optik bringt der Käufer mit.",
|
||||
"market.p_w100":"Managed Waves mit 100G",
|
||||
"market.p_w100_d":"Aus der Kapazität geschnitten, die du beleuchtet hast: bringen mehr als Spektrum, und deinem Traffic bleibt entsprechend weniger.",
|
||||
"market.p_w1600":"Managed Waves mit 1,6T",
|
||||
"market.p_w1600_d":"Eine Wave auf einer 1,6T-Optik: das billigste Bit, das du verkaufen kannst, und was die größten Käufer mit den Jahren wollen.",
|
||||
"market.p_w400":"Managed Waves mit 400G",
|
||||
"market.p_w400_d":"2,7-mal der Preis einer 100G-Wave für viermal die Kapazität (3,8-mal auf Seekabeln). KI-Rechenzentren wollen sie.",
|
||||
"market.p_w800":"Managed Waves mit 800G",
|
||||
"market.p_w800_d":"Eine Wave auf einer 800G-Optik. Käufer steigen nach ein paar Jahren um, KI-Rechenzentren zuerst.",
|
||||
"market.price":"{price}/Monat · {pct}% vom Listenpreis",
|
||||
"market.price_pair":"{up} im Voraus + {price}/Monat · {pct}% vom Listenpreis",
|
||||
"market.route_meta":"{km} km · {ms} ms · schnelle Waves +{n}%",
|
||||
"market.route_off":"Broker lässt sie in Ruhe",
|
||||
"market.route_on":"Broker handelt hier",
|
||||
"market.routes":"Deine Strecken",
|
||||
"market.row":"{want} gefragt · {sold} verkauft · {listed} angeboten",
|
||||
"market.sales":"Kapazität, die du verkaufst",
|
||||
"market.scout":"Strecken, die du bauen könntest",
|
||||
"market.scout_d":"Zwischen deinen POPs, noch ohne deine Glasfaser: was jede Strecke will und wohin sie sich entwickelt, die wertvollsten zuerst.",
|
||||
"market.scout_none":"Bau POPs in mehr Städten, um Strecken zwischen ihnen zu sehen.",
|
||||
"market.scout_spend":"{km} km · Carrier geben dort zu heutigen Preisen etwa {v}/Monat aus",
|
||||
"market.selling":"Im Verkauf",
|
||||
"market.sold_pair":"<b>Dein Broker hat ein dunkles Faserpaar verkauft.</b><br>{name} zahlt {up} im Voraus für {what}, dann {price}/Monat.",
|
||||
"market.steady":"Stabil",
|
||||
"market.tab":"Kapazitätsmarkt",
|
||||
"market.title":"Lambda Bazaar",
|
||||
"market.today":"heute",
|
||||
"market.upgraded":"<b>{name} wächst.</b><br>Seine {n}× Waves mit {g0} auf {a}–{b} werden zu {g1}: {price}/Monat.",
|
||||
"market.wants_more":"<b>{name} will wachsen</b>, von Waves mit {g0} auf {g1} auf {a}–{b}, aber die Glasfaser hat keinen Platz. Beleuchte mehr Kapazität oder halte weniger zurück.",
|
||||
"meet_a_network.all_n_out_of_reach":{"one":"Alle {n} außer Reichweite","other":"Alle {n} außer Reichweite"},
|
||||
"meet_a_network.peer_with_the_tier_1_club":"Peere mit dem Tier-1-Club: Ihre Kunden kommen gratis mit. Nur Netze, die in niemandes Customer Cone sind, brauchen eigenes Peering.",
|
||||
"meet_a_network.peer_with_the_tier_1_club_n":{"one":"Peere mit dem Tier-1-Club: Ihre Kunden kommen gratis mit. {n} Netz kommt schon mit einem Peer mit.","other":"Peere mit dem Tier-1-Club: Ihre Kunden kommen gratis mit. {n} Netze kommen schon mit einem Peer mit."},
|
||||
|
|
|
|||
|
|
@ -386,8 +386,6 @@
|
|||
"broker.goal_wave":"Vende una onda en tu vidrio",
|
||||
"broker.goal_wave_d":"Los operadores alquilan alien waves en fibra que has iluminado. Acepta una de tus ofertas.",
|
||||
"broker.goal_win_d":"Tus propios cables llegan a cinco continentes y los operadores te pagan 1 M$ al mes por capacidad.",
|
||||
"broker.how":"vende según lo que pida el mercado; el bróker se queda el 10 %",
|
||||
"broker.lead":"El bróker mantiene tu oferta y la va vendiendo con el tiempo, cuando los operadores entre estas dos ciudades quieren capacidad. Se queda el 10 % de cada venta.",
|
||||
"broker.list_all":"Ofrecer las {n}",
|
||||
"broker.list_more":"Ofrecer {n} más",
|
||||
"broker.list_n":{"one":"Ofrecer {n} onda","other":"Ofrecer {n} ondas"},
|
||||
|
|
@ -3035,6 +3033,75 @@
|
|||
"loop.something_in_the_noc_glitched_the":"<b>Algo falló en el NOC.</b><br>El juego siguió. Si algo parece raro, exporta tu partida y abre una incidencia en GitHub.",
|
||||
"loop.welcome_back_name_your_network_is":"<b>Bienvenido de nuevo, {name}.</b><br>Tu red está justo donde la dejaste: {date}.",
|
||||
"loop.your_saved_game_could_not_be":"<b>No se pudo cargar tu partida guardada.</b><br>Estaba dañada, así que se guardó una copia y puedes empezar de cero.",
|
||||
"market.below_floor":"por debajo de tu mínimo",
|
||||
"market.cool":"❄️ Fría ×{x}",
|
||||
"market.days_ago":{"one":"hace {n} día","other":"hace {n} días"},
|
||||
"market.fee":"El broker se queda con",
|
||||
"market.fee_broker":"la tarifa de Cable broker",
|
||||
"market.floor":"Nunca vender por debajo de",
|
||||
"market.forecast":"En 30 días {a} · en 90 días {b}",
|
||||
"market.forecast_lock":"Un Cable broker también ve hacia dónde va cada ruta.",
|
||||
"market.forecast_now":"{n} ahora · {a} en 30 días · {b} en 90 días",
|
||||
"market.g_sold_as_managed":"{g} vendidos como waves gestionadas",
|
||||
"market.hold":"Reservar para tu propio tráfico",
|
||||
"market.hold_d":"La parte del espectro y de la capacidad encendida de cada fibra que el broker nunca vende, para que tu tráfico tenga sitio para crecer.",
|
||||
"market.hot":"🔥 Caliente ×{x}",
|
||||
"market.how":"se vende según quiere el mercado; el broker se queda con el {n}%",
|
||||
"market.lead":"Los operadores compran capacidad en las rutas donde tienes dark fiber. Lo que quiere cada ruta cambia todo el tiempo: las rutas calientes pagan más y se llenan antes, una ruta corta y recta vende waves con prima, y una larga cuesta más porque su fibra cuesta más. Elige qué vende el broker, a partir de qué demanda y a qué precio.",
|
||||
"market.lead_fiber":"El broker guarda tu anuncio y lo va vendiendo con el tiempo, cuando los operadores entre estas dos ciudades quieren capacidad. Se queda con el {n}% de cada venta.",
|
||||
"market.legend":"Cada barra: lo vendido (verde) de lo que quiere la ruta (la línea); la marca rosa es tu mínimo.",
|
||||
"market.managed_wave":"Wave gestionada",
|
||||
"market.min":"Anunciar mientras la ruta quiera al menos",
|
||||
"market.n_g_left":{"one":"{n} wave gestionada de {g} por vender","other":"{n} waves gestionadas de {g} por vender"},
|
||||
"market.n_g_wave_on":{"one":"{n}× wave gestionada de {g} en tu fibra {a}–{b}","other":"{n}× waves gestionadas de {g} en tu fibra {a}–{b}"},
|
||||
"market.needs_optic":"necesita una óptica de {g} en esta fibra",
|
||||
"market.news":"Noticias del mercado",
|
||||
"market.news_ai_big":"Un clúster de IA quiere hablar entre {a} y {b}: allí las waves de 400G para arriba están muy buscadas.",
|
||||
"market.news_boom":"Una serie de streaming inunda {a}: los operadores quieren más espectro y waves de 100G desde allí.",
|
||||
"market.news_cut":"Fibra cortada entre {a} y {b}: los operadores quieren caminos diversos alrededor.",
|
||||
"market.news_dc_big":"Un hyperscaler empieza a construir cerca de {a}: se buscan waves grandes y pares oscuros desde allí.",
|
||||
"market.news_exch":"Los traders mueven sus motores de matching a {a}: las waves rápidas desde allí pagan más.",
|
||||
"market.news_glut":"Un rival enciende fibra nueva entre {a} y {b}: allí los compradores se enfrían.",
|
||||
"market.news_merge":"Dos operadores se fusionan entre {a} y {b}: allí hay menos compradores.",
|
||||
"market.news_redsea":"Hay cables submarinos cortados: todas las rutas submarinas están en demanda.",
|
||||
"market.no_news":"Todo tranquilo por ahora.",
|
||||
"market.no_room":"sin sitio: enciende más capacidad",
|
||||
"market.no_routes":"Aún no tienes dark fiber lista. Alquila o cava alguna, y su ruta aparece aquí.",
|
||||
"market.not_selling":"No a la venta",
|
||||
"market.not_yet":"Aquí nadie quiere esto todavía: {list}.",
|
||||
"market.open":"Lambda Bazaar",
|
||||
"market.p_iru":"IRUs de pares oscuros",
|
||||
"market.p_iru_d":"Un par libre en una zanja que cavaste tú: dos años de su alquiler por adelantado, luego un poco de mantenimiento al mes.",
|
||||
"market.p_spec":"Espectro",
|
||||
"market.p_spec_d":"Una alien wave: un canal de tu line system, y el comprador pone la óptica.",
|
||||
"market.p_w100":"Waves gestionadas de 100G",
|
||||
"market.p_w100_d":"Sacadas de la capacidad que encendiste: pagan más que el espectro, y a tu tráfico le queda eso de menos.",
|
||||
"market.p_w1600":"Waves gestionadas de 1,6T",
|
||||
"market.p_w1600_d":"Una wave en una óptica de 1,6T: el bit más barato que puedes vender, y lo que quieren los mayores compradores con los años.",
|
||||
"market.p_w400":"Waves gestionadas de 400G",
|
||||
"market.p_w400_d":"2,7 veces el precio de una wave de 100G por cuatro veces la capacidad (3,8 veces en submarino). Los data centers de IA las quieren.",
|
||||
"market.p_w800":"Waves gestionadas de 800G",
|
||||
"market.p_w800_d":"Una wave en una óptica de 800G. Los compradores se pasan a ellas tras unos años, los data centers de IA primero.",
|
||||
"market.price":"{price}/mes · {pct}% de la tarifa",
|
||||
"market.price_pair":"{up} por adelantado + {price}/mes · {pct}% de la tarifa",
|
||||
"market.route_meta":"{km} km · {ms} ms · waves rápidas +{n}%",
|
||||
"market.route_off":"El broker la deja en paz",
|
||||
"market.route_on":"El broker vende aquí",
|
||||
"market.routes":"Tus rutas",
|
||||
"market.row":"{want} pedidas · {sold} vendidas · {listed} anunciadas",
|
||||
"market.sales":"Capacidad que vendes",
|
||||
"market.scout":"Rutas que podrías construir",
|
||||
"market.scout_d":"Entre tus POPs, todavía sin fibra tuya: qué quiere cada ruta y hacia dónde va, las más valiosas primero.",
|
||||
"market.scout_none":"Construye POPs en más ciudades para ver rutas entre ellas.",
|
||||
"market.scout_spend":"{km} km · los operadores allí gastan unos {v}/mes a precios de hoy",
|
||||
"market.selling":"A la venta",
|
||||
"market.sold_pair":"<b>Tu broker vendió un par oscuro.</b><br>{name} paga {up} por adelantado por {what}, luego {price}/mes.",
|
||||
"market.steady":"Estable",
|
||||
"market.tab":"Mercado de capacidad",
|
||||
"market.title":"Lambda Bazaar",
|
||||
"market.today":"hoy",
|
||||
"market.upgraded":"<b>{name} crece.</b><br>Sus {n}× waves de {g0} en {a}–{b} pasan a {g1}: {price}/mes.",
|
||||
"market.wants_more":"<b>{name} quiere crecer</b> de waves de {g0} a {g1} en {a}–{b}, pero esa fibra no tiene sitio. Enciende más capacidad, o reserva menos.",
|
||||
"meet_a_network.all_n_out_of_reach":{"one":"{n} fuera de alcance","other":"Las {n} fuera de alcance"},
|
||||
"meet_a_network.peer_with_the_tier_1_club":"Haz peering con el club de los Tier 1: sus clientes vienen gratis. Solo las redes que no están en el cono de nadie necesitan peering propio.",
|
||||
"meet_a_network.peer_with_the_tier_1_club_n":{"one":"Haz peering con el club de los Tier 1: sus clientes vienen gratis. {n} red ya viene con un peer.","other":"Haz peering con el club de los Tier 1: sus clientes vienen gratis. {n} redes ya vienen con un peer."},
|
||||
|
|
|
|||
|
|
@ -386,8 +386,6 @@
|
|||
"broker.goal_wave":"Vends une longueur d’onde sur ton verre",
|
||||
"broker.goal_wave_d":"Les opérateurs louent des alien waves sur la fibre que tu as allumée. Accepte-en une dans tes offres.",
|
||||
"broker.goal_win_d":"Tes propres câbles atterrissent sur cinq continents, et les opérateurs te paient 1 M$ par mois de capacité.",
|
||||
"broker.how":"il vend selon la demande ; le courtier garde 10 %",
|
||||
"broker.lead":"Le courtier garde ton annonce et la vend au fil du temps, quand les opérateurs entre ces deux villes veulent de la capacité. Il garde 10 % de chaque vente.",
|
||||
"broker.list_all":"Proposer les {n}",
|
||||
"broker.list_more":"En proposer {n} de plus",
|
||||
"broker.list_n":{"one":"Proposer {n} longueur d’onde","other":"Proposer {n} longueurs d’onde"},
|
||||
|
|
@ -3035,6 +3033,75 @@
|
|||
"loop.something_in_the_noc_glitched_the":"<b>Un truc a buggé dans le NOC.</b><br>Le jeu a continué. Si quelque chose semble bizarre, exporte ta sauvegarde et ouvre une issue sur GitHub.",
|
||||
"loop.welcome_back_name_your_network_is":"<b>Re-bonjour, {name}.</b><br>Ton réseau est exactement là où tu l’as laissé : {date}.",
|
||||
"loop.your_saved_game_could_not_be":"<b>Impossible de charger ta sauvegarde.</b><br>Elle était endommagée : une copie a été conservée et tu peux repartir de zéro.",
|
||||
"market.below_floor":"sous ton plancher",
|
||||
"market.cool":"❄️ Froide ×{x}",
|
||||
"market.days_ago":{"one":"il y a {n} jour","other":"il y a {n} jours"},
|
||||
"market.fee":"Le broker garde",
|
||||
"market.fee_broker":"le tarif d'un Cable broker",
|
||||
"market.floor":"Ne jamais vendre sous",
|
||||
"market.forecast":"Dans 30 jours {a} · dans 90 jours {b}",
|
||||
"market.forecast_lock":"Un Cable broker voit aussi où va chaque route.",
|
||||
"market.forecast_now":"{n} maintenant · {a} dans 30 jours · {b} dans 90 jours",
|
||||
"market.g_sold_as_managed":"{g} vendus en waves gérées",
|
||||
"market.hold":"Garder pour ton propre trafic",
|
||||
"market.hold_d":"La part du spectre et de la capacité allumée de chaque fibre que le broker ne vend jamais, pour que ton trafic ait de la place pour grandir.",
|
||||
"market.hot":"🔥 Chaude ×{x}",
|
||||
"market.how":"elle se vend au gré du marché ; le broker garde {n} %",
|
||||
"market.lead":"Les opérateurs achètent de la capacité sur les routes où tu as de la dark fiber. Ce que veut chaque route bouge tout le temps : les routes chaudes paient plus et se remplissent plus vite, une route courte et droite vend ses waves plus cher, et une longue coûte plus parce que sa fibre coûte plus. Choisis ce que vend le broker, à partir de quelle demande et à quel prix.",
|
||||
"market.lead_fiber":"Le broker garde ton annonce et la vend au fil du temps, quand les opérateurs entre ces deux villes veulent de la capacité. Il garde {n} % de chaque vente.",
|
||||
"market.legend":"Chaque barre : ce qui est vendu (vert) de ce que veut la route (le trait) ; la marque rose est ton minimum.",
|
||||
"market.managed_wave":"Wave gérée",
|
||||
"market.min":"En vente tant que la route veut au moins",
|
||||
"market.n_g_left":{"one":"{n} wave gérée {g} encore à vendre","other":"{n} waves gérées {g} encore à vendre"},
|
||||
"market.n_g_wave_on":{"one":"{n}× wave gérée {g} sur ta fibre {a}–{b}","other":"{n}× waves gérées {g} sur ta fibre {a}–{b}"},
|
||||
"market.needs_optic":"il faut une optique {g} sur cette fibre",
|
||||
"market.news":"Nouvelles du marché",
|
||||
"market.news_ai_big":"Un cluster d'IA veut causer entre {a} et {b} : les waves de 400G et plus y sont très demandées.",
|
||||
"market.news_boom":"Une série en streaming inonde {a} : les opérateurs veulent plus de spectre et de waves 100G depuis là-bas.",
|
||||
"market.news_cut":"Fibre coupée entre {a} et {b} : les opérateurs veulent des chemins de secours autour.",
|
||||
"market.news_dc_big":"Un hyperscaler lance un chantier près de {a} : on cherche de grosses waves et des paires noires depuis là-bas.",
|
||||
"market.news_exch":"Les traders déplacent leurs moteurs d'appariement à {a} : les waves rapides depuis là-bas paient plus.",
|
||||
"market.news_glut":"Un rival allume de la nouvelle fibre entre {a} et {b} : les acheteurs s'y refroidissent.",
|
||||
"market.news_merge":"Deux opérateurs fusionnent entre {a} et {b} : moins d'acheteurs là-bas.",
|
||||
"market.news_redsea":"Des câbles sous-marins sont coupés : toutes les routes sous-marines sont demandées.",
|
||||
"market.no_news":"Calme plat pour l'instant.",
|
||||
"market.no_room":"plus de place : allume plus de capacité",
|
||||
"market.no_routes":"Tu n'as pas encore de dark fiber prête. Loue-en ou creuse, et sa route apparaît ici.",
|
||||
"market.not_selling":"Pas en vente",
|
||||
"market.not_yet":"Personne n'en veut encore ici : {list}.",
|
||||
"market.open":"Lambda Bazaar",
|
||||
"market.p_iru":"IRU de paires noires",
|
||||
"market.p_iru_d":"Une paire libre dans une tranchée que tu as creusée : deux ans de sa location d'avance, puis un peu d'entretien chaque mois.",
|
||||
"market.p_spec":"Spectre",
|
||||
"market.p_spec_d":"Une alien wave : un canal de ton line system, et l'acheteur apporte l'optique.",
|
||||
"market.p_w100":"Waves gérées 100G",
|
||||
"market.p_w100_d":"Prises sur la capacité que tu as allumée : elles paient plus que le spectre, et ton trafic en a d'autant moins.",
|
||||
"market.p_w1600":"Waves gérées 1,6T",
|
||||
"market.p_w1600_d":"Une wave sur une optique 1,6T : le bit le moins cher que tu puisses vendre, et ce que veulent les plus gros acheteurs au fil des années.",
|
||||
"market.p_w400":"Waves gérées 400G",
|
||||
"market.p_w400_d":"2,7 fois le prix d'une wave 100G pour quatre fois la capacité (3,8 fois en sous-marin). Les data centers d'IA en raffolent.",
|
||||
"market.p_w800":"Waves gérées 800G",
|
||||
"market.p_w800_d":"Une wave sur une optique 800G. Les acheteurs y passent au bout de quelques années, les data centers d'IA d'abord.",
|
||||
"market.price":"{price}/mois · {pct} % du tarif",
|
||||
"market.price_pair":"{up} d'avance + {price}/mois · {pct} % du tarif",
|
||||
"market.route_meta":"{km} km · {ms} ms · waves rapides +{n} %",
|
||||
"market.route_off":"Le broker la laisse tranquille",
|
||||
"market.route_on":"Le broker vend ici",
|
||||
"market.routes":"Tes routes",
|
||||
"market.row":"{want} demandées · {sold} vendues · {listed} en vente",
|
||||
"market.sales":"Capacité que tu vends",
|
||||
"market.scout":"Routes que tu pourrais construire",
|
||||
"market.scout_d":"Entre tes POP, sans ta fibre pour l'instant : ce que veut chaque route et où elle va, les plus précieuses d'abord.",
|
||||
"market.scout_none":"Construis des POP dans plus de villes pour voir les routes entre elles.",
|
||||
"market.scout_spend":"{km} km · les opérateurs y dépensent environ {v}/mois aux prix d'aujourd'hui",
|
||||
"market.selling":"En vente",
|
||||
"market.sold_pair":"<b>Ton broker a vendu une paire noire.</b><br>{name} paie {up} d'avance pour {what}, puis {price}/mois.",
|
||||
"market.steady":"Stable",
|
||||
"market.tab":"Marché de la capacité",
|
||||
"market.title":"Lambda Bazaar",
|
||||
"market.today":"aujourd'hui",
|
||||
"market.upgraded":"<b>{name} grandit.</b><br>Ses {n}× waves {g0} sur {a}–{b} passent en {g1} : {price}/mois.",
|
||||
"market.wants_more":"<b>{name} veut grandir</b> de waves {g0} à {g1} sur {a}–{b}, mais cette fibre n'a plus de place. Allume plus de capacité, ou garde moins de côté.",
|
||||
"meet_a_network.all_n_out_of_reach":{"one":"Les {n} hors couverture","other":"Les {n} hors couverture"},
|
||||
"meet_a_network.peer_with_the_tier_1_club":"Peere avec le club des Tier 1 : leurs clients viennent gratuitement avec. Seuls les réseaux qui ne sont dans le cône de personne demandent leur propre peering.",
|
||||
"meet_a_network.peer_with_the_tier_1_club_n":{"one":"Peere avec le club des Tier 1 : leurs clients viennent gratuitement avec. {n} réseau vient déjà avec un peer.","other":"Peere avec le club des Tier 1 : leurs clients viennent gratuitement avec. {n} réseaux viennent déjà avec un peer."},
|
||||
|
|
|
|||
|
|
@ -386,8 +386,6 @@
|
|||
"broker.goal_wave":"Vendi una wave sul tuo vetro",
|
||||
"broker.goal_wave_d":"Gli operatori affittano alien wave sulla fibra che hai acceso. Accettane una dalle tue offerte.",
|
||||
"broker.goal_win_d":"I tuoi cavi approdano su cinque continenti e gli operatori ti pagano 1 M$ al mese di capacità.",
|
||||
"broker.how":"vende quando il mercato lo chiede; il broker tiene il 10%",
|
||||
"broker.lead":"Il broker tiene la tua offerta e la vende nel tempo, quando gli operatori tra queste due città vogliono capacità. Tiene il 10% di ogni vendita.",
|
||||
"broker.list_all":"Offri tutte le {n}",
|
||||
"broker.list_more":"Offrine altre {n}",
|
||||
"broker.list_n":{"one":"Offri {n} onda","other":"Offri {n} onde"},
|
||||
|
|
@ -3035,6 +3033,75 @@
|
|||
"loop.something_in_the_noc_glitched_the":"<b>Qualcosa nel NOC si è inceppato.</b><br>Il gioco è andato avanti. Se qualcosa sembra strano, esporta il salvataggio e apri una issue su GitHub.",
|
||||
"loop.welcome_back_name_your_network_is":"<b>Bentornato, {name}.</b><br>La tua rete è proprio dove l’avevi lasciata: {date}.",
|
||||
"loop.your_saved_game_could_not_be":"<b>Impossibile caricare la partita salvata.</b><br>Era danneggiata: ne abbiamo tenuto una copia di backup e puoi ricominciare da zero.",
|
||||
"market.below_floor":"sotto il tuo minimo",
|
||||
"market.cool":"❄️ Freddo ×{x}",
|
||||
"market.days_ago":{"one":"{n} giorno fa","other":"{n} giorni fa"},
|
||||
"market.fee":"Il broker trattiene",
|
||||
"market.fee_broker":"la tariffa da Cable broker",
|
||||
"market.floor":"Mai vendere sotto",
|
||||
"market.forecast":"Tra 30 giorni {a} · tra 90 giorni {b}",
|
||||
"market.forecast_lock":"Un Cable broker vede anche dove va ogni tratta.",
|
||||
"market.forecast_now":"{n} ora · {a} tra 30 giorni · {b} tra 90 giorni",
|
||||
"market.g_sold_as_managed":"{g} venduti come wave gestite",
|
||||
"market.hold":"Tieni da parte per il tuo traffico",
|
||||
"market.hold_d":"La quota di spettro e di capacità accesa di ogni fibra che il broker non vende mai, così il tuo traffico ha spazio per crescere.",
|
||||
"market.hot":"🔥 Caldo ×{x}",
|
||||
"market.how":"si vende come vuole il mercato; il broker trattiene il {n}%",
|
||||
"market.lead":"Gli operatori comprano capacità sulle tratte dove hai dark fiber. Quello che vuole ogni tratta cambia di continuo: le tratte calde pagano di più e si riempiono prima, una tratta corta e dritta vende wave a prezzo premium, e una lunga costa di più perché costa di più la sua fibra. Scegli cosa vende il broker, da quale domanda e a che prezzo.",
|
||||
"market.lead_fiber":"Il broker tiene il tuo annuncio e lo vende nel tempo, man mano che gli operatori tra queste due città vogliono capacità. Trattiene il {n}% di ogni vendita.",
|
||||
"market.legend":"Ogni barra: quanto è venduto (verde) di quanto vuole la tratta (la linea); la tacca rosa è il tuo minimo.",
|
||||
"market.managed_wave":"Wave gestita",
|
||||
"market.min":"In vendita finché la tratta vuole almeno",
|
||||
"market.n_g_left":{"one":"{n} wave gestita da {g} ancora da vendere","other":"{n} wave gestite da {g} ancora da vendere"},
|
||||
"market.n_g_wave_on":{"one":"{n}× wave gestita da {g} sulla tua fibra {a}–{b}","other":"{n}× wave gestite da {g} sulla tua fibra {a}–{b}"},
|
||||
"market.needs_optic":"serve un'ottica da {g} su questa fibra",
|
||||
"market.news":"Notizie dal mercato",
|
||||
"market.news_ai_big":"Un cluster di IA vuole parlare tra {a} e {b}: lì le wave da 400G in su vanno a ruba.",
|
||||
"market.news_boom":"Una serie in streaming invade {a}: gli operatori vogliono più spettro e wave da 100G da lì.",
|
||||
"market.news_cut":"Fibra tranciata tra {a} e {b}: gli operatori cercano percorsi alternativi.",
|
||||
"market.news_dc_big":"Un hyperscaler apre un cantiere vicino a {a}: da lì si cercano wave grandi e coppie di dark fiber.",
|
||||
"market.news_exch":"I trader spostano i loro motori di matching a {a}: le wave veloci da lì pagano di più.",
|
||||
"market.news_glut":"Un rivale accende nuova fibra tra {a} e {b}: lì i compratori si raffreddano.",
|
||||
"market.news_merge":"Due operatori si fondono tra {a} e {b}: lì ci sono meno compratori.",
|
||||
"market.news_redsea":"Cavi sottomarini tranciati: tutte le tratte sottomarine sono richieste.",
|
||||
"market.no_news":"Tutto tranquillo finora.",
|
||||
"market.no_room":"niente spazio: accendi più capacità",
|
||||
"market.no_routes":"Non hai ancora dark fiber pronta. Prendila in leasing o scavala, e la sua tratta compare qui.",
|
||||
"market.not_selling":"Non in vendita",
|
||||
"market.not_yet":"Qui nessuno le vuole ancora: {list}.",
|
||||
"market.open":"Lambda Bazaar",
|
||||
"market.p_iru":"IRU di coppie dark",
|
||||
"market.p_iru_d":"Una coppia libera in una trincea che hai scavato tu: due anni del suo leasing in anticipo, poi un po' di manutenzione al mese.",
|
||||
"market.p_spec":"Spettro",
|
||||
"market.p_spec_d":"Una alien wave: un canale del tuo line system, e l'ottica la porta il compratore.",
|
||||
"market.p_w100":"Wave gestite da 100G",
|
||||
"market.p_w100_d":"Ricavate dalla capacità che hai acceso: pagano più dello spettro, e al tuo traffico ne resta altrettanto di meno.",
|
||||
"market.p_w1600":"Wave gestite da 1,6T",
|
||||
"market.p_w1600_d":"Una wave su un'ottica da 1,6T: il bit più economico che puoi vendere, e quello che vogliono i compratori più grossi col passare degli anni.",
|
||||
"market.p_w400":"Wave gestite da 400G",
|
||||
"market.p_w400_d":"2,7 volte il prezzo di una wave da 100G per quattro volte la capacità (3,8 volte sui cavi sottomarini). I data center di IA le vogliono.",
|
||||
"market.p_w800":"Wave gestite da 800G",
|
||||
"market.p_w800_d":"Una wave su un'ottica da 800G. I compratori ci passano dopo qualche anno, prima i data center di IA.",
|
||||
"market.price":"{price}/mese · {pct}% del listino",
|
||||
"market.price_pair":"{up} in anticipo + {price}/mese · {pct}% del listino",
|
||||
"market.route_meta":"{km} km · {ms} ms · wave veloci +{n}%",
|
||||
"market.route_off":"Il broker la lascia stare",
|
||||
"market.route_on":"Il broker vende qui",
|
||||
"market.routes":"Le tue tratte",
|
||||
"market.row":"{want} richieste · {sold} vendute · {listed} in vendita",
|
||||
"market.sales":"Capacità che vendi",
|
||||
"market.scout":"Tratte che potresti costruire",
|
||||
"market.scout_d":"Tra i tuoi POP, senza ancora la tua fibra: cosa vuole ogni tratta e dove sta andando, le più preziose prima.",
|
||||
"market.scout_none":"Costruisci POP in più città per vedere le tratte tra di loro.",
|
||||
"market.scout_spend":"{km} km · lì gli operatori spendono circa {v}/mese ai prezzi di oggi",
|
||||
"market.selling":"In vendita",
|
||||
"market.sold_pair":"<b>Il tuo broker ha venduto una coppia dark.</b><br>{name} paga {up} in anticipo per {what}, poi {price}/mese.",
|
||||
"market.steady":"Stabile",
|
||||
"market.tab":"Mercato della capacità",
|
||||
"market.title":"Lambda Bazaar",
|
||||
"market.today":"oggi",
|
||||
"market.upgraded":"<b>{name} cresce.</b><br>Le sue {n}× wave da {g0} su {a}–{b} diventano da {g1}: {price}/mese.",
|
||||
"market.wants_more":"<b>{name} vuole crescere</b> da wave da {g0} a {g1} su {a}–{b}, ma quella fibra non ha spazio. Accendi più capacità, o tieni da parte di meno.",
|
||||
"meet_a_network.all_n_out_of_reach":{"one":"Tutte le {n} fuori copertura","other":"Tutte le {n} fuori copertura"},
|
||||
"meet_a_network.peer_with_the_tier_1_club":"Fai peering con il club dei Tier 1: i loro clienti arrivano gratis. Solo le reti che non stanno nel cono di nessuno vogliono un peering tutto loro.",
|
||||
"meet_a_network.peer_with_the_tier_1_club_n":{"one":"Fai peering con il club dei Tier 1: i loro clienti arrivano gratis. {n} rete arriva già con un peer.","other":"Fai peering con il club dei Tier 1: i loro clienti arrivano gratis. {n} reti arrivano già con un peer."},
|
||||
|
|
|
|||
|
|
@ -386,8 +386,6 @@
|
|||
"broker.goal_wave":"Venda uma wave no seu vidro",
|
||||
"broker.goal_wave_d":"Operadoras alugam alien waves na fibra que você acendeu. Aceite uma das suas ofertas.",
|
||||
"broker.goal_win_d":"Seus próprios cabos chegam a cinco continentes e as operadoras pagam US$ 1 mi por mês de capacidade.",
|
||||
"broker.how":"vende conforme a demanda; o corretor fica com 10%",
|
||||
"broker.lead":"O corretor mantém seu anúncio e vende aos poucos, quando operadoras entre estas duas cidades querem capacidade. Ele fica com 10% de cada venda.",
|
||||
"broker.list_all":"Anunciar todas as {n}",
|
||||
"broker.list_more":"Anunciar mais {n}",
|
||||
"broker.list_n":{"one":"Anunciar {n} onda","other":"Anunciar {n} ondas"},
|
||||
|
|
@ -3035,6 +3033,75 @@
|
|||
"loop.something_in_the_noc_glitched_the":"<b>Algo no NOC deu pau.</b><br>O jogo continuou. Se algo parecer estranho, exporte seu save e abra uma issue no GitHub.",
|
||||
"loop.welcome_back_name_your_network_is":"<b>Bem-vindo de volta, {name}.</b><br>Sua rede está do jeitinho que você deixou: {date}.",
|
||||
"loop.your_saved_game_could_not_be":"<b>Não deu para carregar seu jogo salvo.</b><br>Ele estava corrompido, então guardamos um backup e você pode começar do zero.",
|
||||
"market.below_floor":"abaixo do seu mínimo",
|
||||
"market.cool":"❄️ Fria ×{x}",
|
||||
"market.days_ago":{"one":"há {n} dia","other":"há {n} dias"},
|
||||
"market.fee":"O broker fica com",
|
||||
"market.fee_broker":"a taxa de Cable broker",
|
||||
"market.floor":"Nunca vender abaixo de",
|
||||
"market.forecast":"Em 30 dias {a} · em 90 dias {b}",
|
||||
"market.forecast_lock":"Um Cable broker também vê para onde cada rota está indo.",
|
||||
"market.forecast_now":"{n} agora · {a} em 30 dias · {b} em 90 dias",
|
||||
"market.g_sold_as_managed":"{g} vendidos como waves gerenciadas",
|
||||
"market.hold":"Reservar para o seu próprio tráfego",
|
||||
"market.hold_d":"A parte do espectro e da capacidade acesa de cada fibra que o broker nunca vende, para o seu tráfego ter espaço para crescer.",
|
||||
"market.hot":"🔥 Quente ×{x}",
|
||||
"market.how":"vende conforme o mercado quer; o broker fica com {n}%",
|
||||
"market.lead":"As operadoras compram capacidade nas rotas onde você tem dark fiber. O que cada rota quer muda o tempo todo: rotas quentes pagam mais e enchem mais rápido, uma rota curta e reta vende waves com prêmio, e uma longa custa mais porque a fibra dela custa mais. Escolha o que o broker vende, a partir de qual demanda e a que preço.",
|
||||
"market.lead_fiber":"O broker guarda o seu anúncio e vende aos poucos, conforme as operadoras entre essas duas cidades querem capacidade. Ele fica com {n}% de cada venda.",
|
||||
"market.legend":"Cada barra: o que está vendido (verde) do que a rota quer (a linha); o traço rosa é o seu mínimo.",
|
||||
"market.managed_wave":"Wave gerenciada",
|
||||
"market.min":"Anunciar enquanto a rota quiser pelo menos",
|
||||
"market.n_g_left":{"one":"{n} wave gerenciada de {g} ainda à venda","other":"{n} waves gerenciadas de {g} ainda à venda"},
|
||||
"market.n_g_wave_on":{"one":"{n}× wave gerenciada de {g} na sua fibra {a}–{b}","other":"{n}× waves gerenciadas de {g} na sua fibra {a}–{b}"},
|
||||
"market.needs_optic":"precisa de uma óptica de {g} nesta fibra",
|
||||
"market.news":"Notícias do mercado",
|
||||
"market.news_ai_big":"Um cluster de IA quer conversar entre {a} e {b}: as waves de 400G para cima lá estão disputadas.",
|
||||
"market.news_boom":"Uma série de streaming inunda {a}: as operadoras querem mais espectro e waves de 100G de lá.",
|
||||
"market.news_cut":"Fibra cortada entre {a} e {b}: as operadoras querem caminhos diversos em volta.",
|
||||
"market.news_dc_big":"Um hyperscaler começa a construir perto de {a}: procuram-se waves grandes e pares escuros de lá.",
|
||||
"market.news_exch":"Traders levam seus motores de matching para {a}: waves rápidas de lá pagam mais.",
|
||||
"market.news_glut":"Um rival acende fibra nova entre {a} e {b}: os compradores lá esfriam.",
|
||||
"market.news_merge":"Duas operadoras se fundem entre {a} e {b}: menos compradores lá.",
|
||||
"market.news_redsea":"Cabos submarinos cortados: todas as rotas submarinas estão em alta.",
|
||||
"market.no_news":"Tudo calmo por enquanto.",
|
||||
"market.no_room":"sem espaço: acenda mais capacidade",
|
||||
"market.no_routes":"Você ainda não tem dark fiber pronta. Alugue ou cave alguma, e a rota dela aparece aqui.",
|
||||
"market.not_selling":"Fora de venda",
|
||||
"market.not_yet":"Ninguém quer isto aqui ainda: {list}.",
|
||||
"market.open":"Lambda Bazaar",
|
||||
"market.p_iru":"IRUs de pares escuros",
|
||||
"market.p_iru_d":"Um par livre numa vala que você cavou: dois anos do aluguel dele adiantados, depois uma pequena manutenção por mês.",
|
||||
"market.p_spec":"Espectro",
|
||||
"market.p_spec_d":"Uma alien wave: um canal do seu line system, e o comprador traz a óptica.",
|
||||
"market.p_w100":"Waves gerenciadas de 100G",
|
||||
"market.p_w100_d":"Tiradas da capacidade que você acendeu: pagam mais que o espectro, e o seu tráfego fica com isso a menos.",
|
||||
"market.p_w1600":"Waves gerenciadas de 1,6T",
|
||||
"market.p_w1600_d":"Uma wave numa óptica de 1,6T: o bit mais barato que você pode vender, e o que os maiores compradores querem com o passar dos anos.",
|
||||
"market.p_w400":"Waves gerenciadas de 400G",
|
||||
"market.p_w400_d":"2,7 vezes o preço de uma wave de 100G por quatro vezes a capacidade (3,8 vezes no submarino). Data centers de IA querem.",
|
||||
"market.p_w800":"Waves gerenciadas de 800G",
|
||||
"market.p_w800_d":"Uma wave numa óptica de 800G. Os compradores passam para elas depois de alguns anos, data centers de IA primeiro.",
|
||||
"market.price":"{price}/mês · {pct}% da tabela",
|
||||
"market.price_pair":"{up} adiantado + {price}/mês · {pct}% da tabela",
|
||||
"market.route_meta":"{km} km · {ms} ms · waves rápidas +{n}%",
|
||||
"market.route_off":"O broker deixa quieta",
|
||||
"market.route_on":"O broker negocia aqui",
|
||||
"market.routes":"Suas rotas",
|
||||
"market.row":"{want} pedidas · {sold} vendidas · {listed} anunciadas",
|
||||
"market.sales":"Capacidade que você vende",
|
||||
"market.scout":"Rotas que você poderia construir",
|
||||
"market.scout_d":"Entre os seus POPs, ainda sem fibra sua: o que cada rota quer e para onde vai, as mais valiosas primeiro.",
|
||||
"market.scout_none":"Construa POPs em mais cidades para ver rotas entre elas.",
|
||||
"market.scout_spend":"{km} km · as operadoras lá gastam cerca de {v}/mês aos preços de hoje",
|
||||
"market.selling":"À venda",
|
||||
"market.sold_pair":"<b>O seu broker vendeu um par escuro.</b><br>{name} paga {up} adiantado por {what}, depois {price}/mês.",
|
||||
"market.steady":"Estável",
|
||||
"market.tab":"Mercado de capacidade",
|
||||
"market.title":"Lambda Bazaar",
|
||||
"market.today":"hoje",
|
||||
"market.upgraded":"<b>{name} cresce.</b><br>As suas {n}× waves de {g0} em {a}–{b} viram {g1}: {price}/mês.",
|
||||
"market.wants_more":"<b>{name} quer crescer</b> de waves de {g0} para {g1} em {a}–{b}, mas essa fibra não tem espaço. Acenda mais capacidade, ou reserve menos.",
|
||||
"meet_a_network.all_n_out_of_reach":{"one":"Todas as {n} fora de alcance","other":"Todas as {n} fora de alcance"},
|
||||
"meet_a_network.peer_with_the_tier_1_club":"Faça peering com o clube dos Tier 1: os clientes deles vêm de graça. Só as redes que não estão no cone de ninguém precisam de peering próprio.",
|
||||
"meet_a_network.peer_with_the_tier_1_club_n":{"one":"Faça peering com o clube dos Tier 1: os clientes deles vêm de graça. {n} rede já vem junto com um peer.","other":"Faça peering com o clube dos Tier 1: os clientes deles vêm de graça. {n} redes já vêm junto com um peer."},
|
||||
|
|
|
|||
|
|
@ -225,6 +225,12 @@ const API_CMD={
|
|||
/* ---------- capacity broker ---------- */
|
||||
listFiber:{args:[['id','entityId'],['w','integer'],['p','integer',false]],watch:['links.#id'],
|
||||
doc:'List spare capacity on a dark-fiber span with a capacity broker as a standing listing: w alien waves, and p (own cables only) your spare fiber pair. The broker sells them off over time as carriers on that route want capacity; a busy route sells in days, a road to nowhere maybe once.'},
|
||||
mktHold:{args:[['v','integer']],watch:['cm'],
|
||||
doc:'Capacity market (Lambda Bazaar): the share of every fiber (0, 10, 25 or 50%) the broker never sells, kept for your own traffic.'},
|
||||
mktCfg:{args:[['p','string'],['k','string'],['v','integer']],watch:['cm'],
|
||||
doc:'Capacity market: for product p (spec = alien-wave spectrum, w100/w400 = managed 100G/400G waves carved from your lit capacity, iru = dark pairs on fiber you dug), set k: on (v 1 or 0: the broker lists it on every route by your thresholds), min (list only while the route wants at least v units; spec/w400 1,2,4,8, w100 1,4,8,16, iru 1,2) or floor (never sell below v% of list: 60, 80, 100, 120). Demand and prices move every day.'},
|
||||
mktRoute:{args:[['k','string']],watch:['cm'],
|
||||
doc:'Capacity market: toggle whether the broker trades on a route (k = the two city ids sorted and joined by |, e.g. ams|fra).'},
|
||||
unlistFiber:{args:[['id','entityId']],watch:['links.#id'],
|
||||
doc:'Take the listing down. What the broker already sold stays sold.'},
|
||||
setChCount:{args:[['id','entityId'],['o','opticId'],['n','integer']],watch:['links.#id'],
|
||||
|
|
@ -465,6 +471,7 @@ const API_VIEW={
|
|||
dashClose:{args:[],doc:'Close the NOC dashboard.'},
|
||||
nocWindow:{args:[],doc:'Open the NOC dashboard in a window of its own, for a second display.'},
|
||||
dashTab:{args:[['k','dashTab']],doc:'Switch the NOC dashboard tab.'},
|
||||
marketOpen:{args:[],doc:'Open the NOC dashboard at the capacity market (Lambda Bazaar).'},
|
||||
dashSort:{args:[['k','dashSortKey']],doc:'Flip a dashboard column\'s sort.'},
|
||||
dashLink:{args:[['id','entityId']],doc:'Jump from the dashboard to a link\'s panel.'},
|
||||
bank:{args:[],doc:'Open the bank.'},
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ const API_STATE_DOC={
|
|||
confReg:{type:'map',doc:'Conferences registered for, by key; "sp" when sponsoring.'},
|
||||
hw:{type:'map',doc:'Hardware market: price shocks and any price lock.'},
|
||||
capDeal:{type:'map',doc:'The pending capacity deal from a capacity conference.'},
|
||||
cm:{type:'map',doc:'The capacity market (Lambda Bazaar): hold (% of every fiber never sold, kept for your own traffic), p (per product spec/w100/w400/w800/w1600/iru: on, min demand, floor % of list), off (routes the broker leaves alone, by "a|b"), sh (market shocks: why, from, until, m multiplier, on a route k, a city c or every subsea route), news (the latest market news), seen (incident ids already turned into news).'},
|
||||
cam:{type:'map',doc:'Map camera position. View state that save() happens to store inside S.'},
|
||||
uiSpeed:{type:'number',doc:'The speed you left the game at. View state that save() stores inside S.'},
|
||||
won:{type:'boolean',doc:'You reached Tier 1.'},
|
||||
|
|
|
|||
|
|
@ -68,7 +68,10 @@ const regenNeed=(o,l)=>Math.max(0,Math.ceil(l.km/reachOn(OPT[o].reach,l.sub))-1)
|
|||
// all its channels. Nothing changes while a frame is drawn, so draw() keeps the answers in DFC for that frame.
|
||||
let DFC=null;
|
||||
const dfCap=l=>{if(!DFC)return dfCap0(l);let g=DFC.get(l);if(g===undefined)DFC.set(l,g=dfCap0(l));return g;};
|
||||
const dfCap0=l=>{if(l.ready>S.day||l.eqDown>S.day)return 0;const ch=l.ch||[];let g=0;for(const c of ch)g+=optG(c,l);const f=l.chFail&&l.chFail.until>S.day?l.chFail:null;if(f){const fo=f.o&&ch.includes(f.o)?f.o:ch.slice().sort((a,b)=>optG(a,l)-optG(b,l))[0];if(fo)g-=optG(fo,l);}return Math.max(0,g);};
|
||||
// dfLit: everything the optics carry; dfCap0: what is left for your own traffic once managed waves sold on it (mwG(),
|
||||
// the capacity market) are carved out.
|
||||
const dfLit=l=>{if(l.ready>S.day||l.eqDown>S.day)return 0;const ch=l.ch||[];let g=0;for(const c of ch)g+=optG(c,l);const f=l.chFail&&l.chFail.until>S.day?l.chFail:null;if(f){const fo=f.o&&ch.includes(f.o)?f.o:ch.slice().sort((a,b)=>optG(a,l)-optG(b,l))[0];if(fo)g-=optG(fo,l);}return Math.max(0,g);};
|
||||
const dfCap0=l=>Math.max(0,dfLit(l)-mwG(l));
|
||||
const capOf=l=>(l.kind==='vxc'?VXC[l.vt].g:l.kind==='df'?dfCap(l):LT[l.tier].g)*(l.deg>S.day?0.5:1)*(l.loss&&l.loss.until>S.day?l.loss.f:1);
|
||||
// A sick LAG (LACP trouble) keeps only part of its capacity until the incident clears.
|
||||
const lagF=o=>o&&o.lacp&&o.lacp.until>S.day?o.lacp.f:1,ixLagF=x=>lagF(S.ev&&S.ev.ixlacp&&{lacp:S.ev.ixlacp[x]});
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ const BIZ_T={
|
|||
event:{l:tr('common.event_network'),opts:[100,200,400,800,1600,3200],rate:0,event:true,lv:2,names:['Carnaval Parade','Diwali Streaming Night','The Big Football Final','NANOG 99','APRICOT 2027','DENOG 18','UKNOF 56','RIPE 94','DKNOG 16','Burning Router Festival','Euro-Pop Song Contest','Formula Ping Grand Prix','The Big Game','Olympic Pings','A Pop Megastar Stadium Tour','LAN Party of the Century','The Keynote (One More Thing)','Gamer-Con Expo','Oktoberfest Livestream']},
|
||||
sdwan:{l:tr('businesses.sd_wan_for_a_chain'),opts:[1,2,5,10],rate:0,l2:true,sdwan:true,km:0,lv:2,names:['Kebab Kingdom','Pretzel Palace','Burger Router Inc.','Café Latte-ncy','Hardware Hut Stores','Pharma-See Pharmacies','Bank of Tiny Branches','Supermarket Superhighway','Fitness Pings Gyms','Hotel Hops Group','Doughnut Data Diners']},
|
||||
wwave:{l:tr('common.wholesale_wave'),opts:[1],rate:0,fiber:true,lv:2,names:['Zay-No Fiber','Loomin’ Technologies','Clown Castle Fiber','G&T (Gin and Transit)','A Hyperscaler Who Shall Not Be Named','Megapork','youNetworks']},
|
||||
// A managed wave (the capacity market): carved out of capacity you lit; b.g is its size (100 or 400G), b.slots how many.
|
||||
mwave:{l:tr('market.managed_wave'),opts:[1],rate:0,fiber:true,lv:2,names:['Lambda Lambda Lambda','Coherent Thoughts Inc.','Photon Express','Transponder Tribe','Sea Change Networks','Spectrum Spectacle','Wavelength Wanderers','Muxed Signals Ltd.']},
|
||||
dfpair:{l:tr('businesses.dark_fiber_pair_lease'),opts:[1],rate:0,fiber:true,lv:3,names:['A Hyperscaler Who Shall Not Be Named','Goggle Fiber Division','Faceplant Infra','Amazin’ Backbone Team','A Very Secretive Trading Firm']},
|
||||
scrub:{l:tr('businesses.ddos_protection_dia'),opts:[1,5,10,20],rate:900},
|
||||
aiwan:{l:tr('businesses.ai_wan_between_two_ai_factories'),opts:[3200,6400,12800],rate:0,l2:true,div:true,mega:true,km:0.45,lv:4,names:['Fairweather AI WAN','Planet-Scale Superfactory Link','Two Brains One Model Inc.','Distributed Godlike Compute','The Gigawatt Handshake']},
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const GOALS=[
|
|||
// (37-cable-broker.js). Ids of their own, so a save keeps the ladder it ran. Rewards are larger: glass costs more.
|
||||
const BROKER_GOALS=[
|
||||
{id:'bk_df',t:tr('goals.light_your_own_dark_fiber'),d:tr('broker.goal_df_d'),r:25000,ok:()=>S.links.some(l=>l.kind==='df'&&dfCap(l)>0)},
|
||||
{id:'bk_wave',t:tr('broker.goal_wave'),d:tr('broker.goal_wave_d'),r:40000,ok:()=>S.biz.some(b=>b.type==='wwave'||b.type==='capw'&&!capPend(b))},
|
||||
{id:'bk_wave',t:tr('broker.goal_wave'),d:tr('broker.goal_wave_d'),r:40000,ok:()=>S.biz.some(b=>b.type==='wwave'||b.type==='mwave'||b.type==='capw'&&!capPend(b))},
|
||||
{id:'bk_pair',t:tr('broker.goal_pair'),d:tr('broker.goal_pair_d'),r:50000,ok:()=>S.biz.some(b=>(b.type==='dfpair'||b.type==='pairs'||b.type==='capfib')&&!capPend(b))},
|
||||
{id:'bk_sea',t:tr('broker.goal_sea'),d:tr('broker.goal_sea_d'),r:150000,ok:()=>S.links.some(l=>ownGlassL(l)&&l.sub)},
|
||||
{id:'bk_deal',t:tr('broker.goal_deal'),d:tr('broker.goal_deal_d'),r:100000,ok:()=>(S.stats.capDone||0)>0},
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ const glassKm=()=>S.links.reduce((a,l)=>a+(ownGlassL(l)?l.km:0),0);
|
|||
// The continents your own subsea cables land on.
|
||||
function cableConts(){const r=new Set();for(const l of S.links)if(ownGlassL(l)&&l.sub)for(const c of [l.a,l.b])r.add(CITY[c].reg);return r.size;}
|
||||
// Capacity other carriers buy from you: alien waves, fiber pairs and capacity deals (once delivered).
|
||||
const CAP_TYPES=['wwave','dfpair','pairs','capw','capsub','capfib'];
|
||||
const CAP_TYPES=['wwave','mwave','dfpair','pairs','capw','capsub','capfib'];
|
||||
const capSold=b=>CAP_TYPES.includes(b.type)&&!capPend(b);
|
||||
const capSalesMo=()=>S.biz.reduce((a,b)=>a+(capSold(b)?bizMo(b):0),0);
|
||||
// Lit capacity sold, in Gbps: waves (400G each) and subsea capacity. A dark pair is the buyer's to light.
|
||||
const capSoldG=()=>S.biz.reduce((a,b)=>a+(!capSold(b)?0:b.type==='wwave'?(b.slots||1)*400:b.type==='capw'||b.type==='capsub'?b.bw:0),0);
|
||||
const capSoldG=()=>S.biz.reduce((a,b)=>a+(!capSold(b)?0:b.type==='wwave'?(b.slots||1)*400:b.type==='mwave'?(b.slots||1)*(b.g||100):b.type==='capw'||b.type==='capsub'?b.bw:0),0);
|
||||
// Two hops of your own glass through one city, each lit to at least g.
|
||||
function glassChain(g){const by={};for(const l of S.links)if(ownGlassL(l)&&dfCap(l)>=g)for(const [c,o] of [[l.a,l.b],[l.b,l.a]])(by[c]=by[c]||new Set()).add(o);
|
||||
return Object.values(by).some(s=>s.size>=2);}
|
||||
|
|
|
|||
|
|
@ -21,16 +21,5 @@ const brFree=l=>Math.max(0,brMarket(l.a,l.b)-brSold(l.a,l.b));
|
|||
const WW_SHARE=0.3,WW_FALL=0.6;
|
||||
function wwRate(l,n,cut=1){const F=dfLeaseMo(l.km)+ampCount(l.km)*AMP_MO,M=brMarket(l.a,l.b),s=brSold(l.a,l.b);let r=0;
|
||||
for(let i=0;i<n;i++)r+=F*WW_SHARE*(1-WW_FALL*Math.min(1,(s+i)/M));return Math.round(r*cut);}
|
||||
// Once a day, each listing may find a buyer: the more room the route has left, the sooner.
|
||||
function brTick(){for(const l of S.links){const L=l.list;if(!L||l.kind!=='df'||!fiberOk({link:l.id,type:'wwave'}))continue;
|
||||
const free=brFree(l);if(!free)continue;
|
||||
if(L.w>0&&freeCh(l)>=1&&Math.random()<Math.min(0.3,free/45)){const n=Math.max(1,Math.min(L.w,freeCh(l),free,1+Math.floor(Math.random()*4)));brSell(l,'wwave',n);L.w-=n;}
|
||||
else if(L.p>0&&pairFree(l)&&free>=BR_PAIR&&Math.random()<1/90){brSell(l,'dfpair',1);L.p--;}
|
||||
if(!(L.w>0)&&!(L.p>0))delete l.list;}}
|
||||
// A sale: a new carrier on this fiber, or more waves for one that already rents here.
|
||||
function brSell(l,t,n){const T=BIZ_T[t],nm=()=>{const list=T.names.filter(x=>!S.usedNames.includes(x)),x=list.length?pick(list):pick(T.names);useName(x);return x;};
|
||||
const o=fiberOffer(t,l,nm,0.9);if(t==='wwave'){o.slots=n;o.rate=wwRate(l,n,0.9);o.what=wwWhat(l,n);}
|
||||
const more=t==='wwave'&&S.biz.find(b=>b.type==='wwave'&&b.link===l.id&&b.name===o.name);
|
||||
if(more){more.slots=(more.slots||0)+n;more.rate+=o.rate;more.what=wwWhat(l,more.slots);}else S.biz.push(clSign(offerCustomer(o)));
|
||||
toast(tr('broker.sold',{name:esc(o.name),what:esc(t==='wwave'?wwWhat(l,n):o.what),price:fmt$(o.rate)}),'good');
|
||||
floater((CITY[l.a].x+CITY[l.b].x)/2,(CITY[l.a].y+CITY[l.b].y)/2-20,tr('common.signed'),'#16A866');}
|
||||
// The listings sell in the capacity market now (cmDay(), 37-fiber-market.js), with prices and demand that move.
|
||||
const brTick=()=>cmDay(S.day);
|
||||
|
|
|
|||
182
src/game/60-features/37-fiber-market.js
Normal file
182
src/game/60-features/37-fiber-market.js
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
/* ---------- the capacity market: what carriers want on each route, today and tomorrow ----------
|
||||
Every route you hold dark fiber on has buyers for spectrum (an alien wave, the buyer brings the optics), managed
|
||||
100G, 400G, 800G and 1.6T waves (carved out of capacity you lit yourself), and dark pairs on fiber you dug (an IRU: a
|
||||
big sum up front, then a little upkeep a month). How much each route wants moves all the time, as it does in real
|
||||
life: a slow cycle of its own, weeks of noise, and news (a cable cut next door, a hyperscaler breaking ground, a rival
|
||||
lighting new glass). Underneath, it grows: carriers want more every year, and bigger waves as the years go by (100G
|
||||
gives way to 400G, then 800G and 1.6T), and carriers already on your glass ask to move up a size. Hot routes pay more
|
||||
and fill faster; a short, straight route sells waves at a premium, and a long one costs more because its fiber does. The broker keeps 10% (3% for a Cable broker, who also sees where
|
||||
each route is heading). S.cm: hold (share kept for your own traffic), p (per product: auto on, min demand, price
|
||||
floor), off (routes left alone), sh (shocks), news, seen (incidents already turned into news). */
|
||||
const CM_P=['spec','w100','w400','w800','w1600','iru'],CM_W=['w100','w400','w800','w1600'];
|
||||
const CM_L={spec:'w',w100:'m1',w400:'m4',w800:'m8',w1600:'m16',iru:'p'},CM_G={w100:100,w400:400,w800:800,w1600:1600};
|
||||
const CM_HOLD=[0,10,25,50],CM_FLOOR=[60,80,100,120],CM_MIN={spec:[1,2,4,8],w100:[1,4,8,16],w400:[1,2,4,8],w800:[1,2,4,8],w1600:[1,2,4],iru:[1,2]};
|
||||
const CM_DEF={spec:{on:false,min:2,floor:80},w100:{on:false,min:4,floor:80},w400:{on:false,min:2,floor:80},w800:{on:false,min:1,floor:80},w1600:{on:false,min:1,floor:80},iru:{on:false,min:1,floor:100}};
|
||||
// A wave's price against a 100G one, on land and on subsea: 2.7x and 3.8x for 400G (real markets in 2025), and the
|
||||
// price of a bit keeps falling as waves grow.
|
||||
const CM_X={w100:[1,1],w400:[2.7,3.8],w800:[4.6,6.6],w1600:[7.8,11]};
|
||||
// Cities where trading firms sit: a short route between two of them pays the most for a fast wave.
|
||||
const CM_FIN=['nyc','chi','lon','fra','tok','sin','hkg','ams','ash'];
|
||||
const CM_HMAX=2.5;
|
||||
const cmNew=()=>({hold:25,p:JSON.parse(JSON.stringify(CM_DEF)),off:{},sh:[],news:[],seen:[]});
|
||||
const cmCut=()=>broker()?0.97:0.9;
|
||||
/* A fiber's listing, l.list: {w: spectrum slots, p: pairs} as it always was, plus m1/m4/m8/m16 (managed 100G to 1.6T
|
||||
waves) when any are listed. cmClean() checks one (a save, or after a day of sales) and returns null when nothing is left. */
|
||||
const cmLs=l=>l.list||(l.list={w:0,p:0});
|
||||
function cmClean(L){if(!L||typeof L!=='object'||Array.isArray(L))return null;const x={w:int(L.w,0,256,0),p:int(L.p,0,2,0)};let any=x.w||x.p;
|
||||
for(const p of CM_W){const v=int(L[CM_L[p]],0,256,0);if(v){x[CM_L[p]]=v;any=1;}}return any?x:null;}
|
||||
// A stable number in [0,1) for a route and a question, different in every game.
|
||||
const cmU=(k,q)=>hstr(k+'|'+q+'|'+((S&&S.asn)||0))%100000/100000;
|
||||
/* How hot a route is (1 = its usual self). Its own slow cycle (two waves of 4 to 10 and 1.5 to 3 months) is what a
|
||||
forecast can see; the weeks of noise on top and news nobody has heard yet are not. */
|
||||
function cmCycle(k,d){const p1=120+180*cmU(k,'p1'),p2=40+50*cmU(k,'p2');return 1+0.25*Math.sin(2*Math.PI*(d/p1+cmU(k,'f1')))+0.15*Math.sin(2*Math.PI*(d/p2+cmU(k,'f2')));}
|
||||
function cmNoise(k,d){const i=Math.floor(d/15),t=(d-i*15)/15,u=t*t*(3-2*t),v=j=>0.85+0.3*cmU(k,'n'+j);return v(i)*(1-u)+v(i+1)*u;}
|
||||
// News: a shock ramps up over a week, holds, and fades over the last 40% of its time.
|
||||
const cmShockF=(x,d)=>d<x.from||d>=x.until?0:Math.max(0,Math.min(1,(d-x.from+1)/7,(x.until-d)/Math.max(1,(x.until-x.from)*0.4)));
|
||||
const cmHits=(x,r)=>x.k?x.k===r.k:x.c?x.c===r.a||x.c===r.b:!!x.sub&&r.sub;
|
||||
function cmShock(r,p,d){let m=1;for(const x of S.cm.sh)if(cmHits(x,r)&&(!x.p||x.p.includes(p))){const f=cmShockF(x,d);if(f)m*=1+(x.m-1)*f;}return m;}
|
||||
function cmHeat(r,p,d,fc){return clamp(cmCycle(r.k,d)*(fc?1:cmNoise(r.k,d))*cmShock(r,p,d),0.3,CM_HMAX);}
|
||||
// What a route is: its cities, its fiber (yours, if any), how far and how fast. Without fiber, as you could dig it
|
||||
// (straight, at your own fiber's 1.1 path factor).
|
||||
function cmRoute(a,b,ls=[]){const k=a<b?a+'|'+b:b+'|'+a,km=ls.length?Math.min(...ls.map(l=>l.km)):kmBetween(a,b),sub=ls.length?ls.some(l=>l.sub):isSub(a,b);
|
||||
const lat=ls.length?Math.min(...ls.map(linkLat)):kmBetween(a,b)*1.1/200,gc=kmBetween(a,b)/200,st=gc>0?lat/gc:2,fin=CM_FIN.includes(a)&&CM_FIN.includes(b);
|
||||
// Latency is dominated by the length of the route: a short, straight one sells fast waves at a premium (up to +50%,
|
||||
// +80% between two trading cities).
|
||||
const lp=1+0.5*clamp((1.5-st)/0.4,0,1)*(fin?1.6:1);
|
||||
return {k,a,b,ls,km,sub,lat,st,lp,fin,dc:MEGA.some(m=>m.c===a||m.c===b)};}
|
||||
// The routes you hold ready dark fiber on.
|
||||
function cmRoutes(){const by=new Map();for(const l of S.links)if(l.kind==='df'&&l.ready<=S.day){const k=edgeKey(l);(by.get(k)||by.set(k,[]).get(k)).push(l);}
|
||||
const rs=new Map();for(const [k,ls] of by){const [a,b]=k.split('|');rs.set(k,cmRoute(a,b,ls));}return rs;}
|
||||
/* Growth: carriers want about 15% more every year (non-AI traffic grows about that fast, AI traffic faster), up to 8
|
||||
times what they wanted at the start. */
|
||||
const cmGrowth=d=>Math.min(8,Math.pow(1.15,Math.max(0,d)/365));
|
||||
/* Which wave sizes buyers want: each size catches on along an S-curve over game years plus the network era, and takes
|
||||
over from the one before (100G, then 400G, 800G from about year 5, 1.6T from about year 9; a later network era
|
||||
brings each a little sooner). */
|
||||
const CM_ADOPT={w400:1.5,w800:5,w1600:9};
|
||||
const cmA=(p,d)=>1/(1+Math.exp(-(Math.max(0,d)/365+0.15*lvl()-CM_ADOPT[p])/1.3));
|
||||
function cmShare(p,d){const a4=cmA('w400',d),a8=cmA('w800',d),a16=cmA('w1600',d);return p==='w100'?1-a4:p==='w400'?a4-a8:p==='w800'?a8-a16:a16;}
|
||||
/* What a route wants of a product, in units: spectrum slots, waves of that size, dark pairs. The size comes from the
|
||||
eyeballs at both ends (brMarket(), as before) and growth; managed waves split by the sizes buyers want now, fast
|
||||
waves from latency, the big ones and dark pairs from data centers at either end; dark pairs are mostly bought for
|
||||
shorter hauls. */
|
||||
function cmDem(r,p,d,fc){const M=brMarket(r.a,r.b),H=cmHeat(r,p,d,fc),g=cmGrowth(d);
|
||||
if(p==='spec')return M*0.5*Math.pow(g,0.7)*H;
|
||||
if(p==='iru')return Math.min(2,M/12*(r.dc?2:1)*clamp(900/r.km,0.35,1.5))*Math.sqrt(g)*H;
|
||||
const dc=r.dc&&p!=='w100'?(p==='w400'?1.3:1.6):1;return M*160*Math.sqrt(r.lp)*g*cmShare(p,d)*dc*H/CM_G[p];}
|
||||
// What carriers already rent on a route, by product, in the same units.
|
||||
const cmWP=g=>CM_W.find(p=>CM_G[p]===g)||'w100';
|
||||
function cmSold(rs){const m=new Map(),ids=new Map();for(const r of rs.values()){m.set(r.k,Object.fromEntries(CM_P.map(p=>[p,0])));for(const l of r.ls)ids.set(l.id,r.k);}
|
||||
for(const b of S.biz){const k=b.link&&ids.get(b.link);if(!k)continue;const s=m.get(k);
|
||||
if(b.type==='wwave')s.spec+=b.slots||0;else if(b.type==='mwave')s[cmWP(b.g)]+=b.slots||0;else if(b.type==='dfpair')s.iru++;}
|
||||
return m;}
|
||||
/* List prices, before the market index (mkt()) and the broker's cut: spectrum is 30% of what the fiber costs a month
|
||||
(as before, #203); a managed 100G wave 30% of that times the latency premium, bigger ones by CM_X; a dark pair two
|
||||
years of its lease up front, then 15% of it a month. */
|
||||
const cmF=r=>dfLeaseMo(r.km)+ampCount(r.km)*AMP_MO;
|
||||
function cmList(r,p){return p==='spec'?cmF(r)*WW_SHARE:p==='iru'?dfLeaseMo(r.km)*0.15:cmF(r)*WW_SHARE*0.3*r.lp*CM_X[p][r.sub?1:0];}
|
||||
const cmUpList=r=>dfLeaseMo(r.km)*0.9*24;
|
||||
/* The price of the i-th unit from now, as a share of list: heat pushes it up or down (hot routes pay off), and each
|
||||
unit sold on the route makes the next one cheaper, down to 40% once its market is full. */
|
||||
function cmIdx(r,p,s,i,d,fc){const D=cmDem(r,p,d,fc),H=cmHeat(r,p,d,fc);return clamp(Math.pow(H,0.6),0.7,1.35)*(1-WW_FALL*Math.min(1,D>0?(s+i)/D:1));}
|
||||
// Managed waves sold on a fiber, in Gbps: they come off what your own traffic gets (dfCap0()).
|
||||
let CM_MW=null,CM_V=0;
|
||||
function mwG(l){if(!S||!S.biz)return 0;if(!CM_MW||CM_MW.b!==S.biz||CM_MW.n!==S.biz.length||CM_MW.v!==CM_V){const m=new Map();
|
||||
for(const b of S.biz)if(b.type==='mwave'&&b.link)m.set(b.link,(m.get(b.link)||0)+(b.slots||0)*(b.g||100));CM_MW={b:S.biz,n:S.biz.length,v:CM_V,m};}
|
||||
return CM_MW.m.get(l.id)||0;}
|
||||
// How much of a product a fiber has spare, after the share kept back for your own traffic (spectrum slots, or lit
|
||||
// capacity your traffic is not using). A wave rides one channel, so an 800G or 1.6T one needs an optic that big. A pair
|
||||
// is never kept back: it is glass you are not lighting.
|
||||
const cmFreeG=(l,hold=S.cm.hold)=>dfCap0(l)-(R.load[l.id]||0)*1.05-hold/100*dfLit(l);
|
||||
const cmOptG=l=>Math.max(0,...(l.ch||[]).map(c=>optG(c,l)));
|
||||
function cmSpare(l,p,hold=S.cm.hold){
|
||||
if(p==='spec')return Math.max(0,freeCh(l)-Math.ceil(hold/100*chMax(l)));
|
||||
if(p==='iru')return l.own&&pairFree(l)&&!(l.cut>S.day)?1:0;
|
||||
return cmOptG(l)<CM_G[p]?0:Math.max(0,Math.floor(cmFreeG(l,hold)/CM_G[p]));}
|
||||
const cmWhat=(l,p,n)=>p==='spec'?wwWhat(l,n):p==='iru'?tr('requirements.a_spare_fiber_pair_in_your',{a:CITY[l.a].name,b:CITY[l.b].name}):trn('market.n_g_wave_on',n,{g:fmtCap(CM_G[p]),a:CITY[l.a].name,b:CITY[l.b].name});
|
||||
// A sale: a new carrier on this fiber, or more of the same product for one that already rents here.
|
||||
function cmSell(l,p,n,rate,up){const t=p==='spec'?'wwave':p==='iru'?'dfpair':'mwave',T=BIZ_T[t],nm=()=>{const list=T.names.filter(x=>!S.usedNames.includes(x)),x=list.length?pick(list):pick(T.names);useName(x);return x;};
|
||||
const g=CM_G[p],name=nm(),more=t!=='dfpair'&&S.biz.find(b=>b.type===t&&b.link===l.id&&b.name===name&&(t!=='mwave'||b.g===g));
|
||||
if(more){more.slots=(more.slots||0)+n;more.rate+=rate;more.what=cmWhat(l,p,more.slots);}
|
||||
else{const o={id:uid(),city:l.a,city2:l.b,link:l.id,slots:t==='dfpair'?0:n,what:cmWhat(l,p,n),name,type:t,bw:1,rate,reqs:[],exp:S.day+30};const b=clSign(offerCustomer(o));if(g)b.g=g;S.biz.push(b);}
|
||||
CM_V++;if(up)S.cash+=up;S.stats.cmSold=(S.stats.cmSold||0)+1;
|
||||
toast(up?tr('market.sold_pair',{name:esc(name),what:esc(cmWhat(l,p,n)),up:fmt$(up),price:fmt$(rate)}):tr('broker.sold',{name:esc(name),what:esc(cmWhat(l,p,n)),price:fmt$(rate)}),'good');
|
||||
floater((CITY[l.a].x+CITY[l.b].x)/2,(CITY[l.a].y+CITY[l.b].y)/2-20,tr('common.signed'),'#16A866');}
|
||||
// What one fiber can still sell of a product right now, whatever is listed: free spectrum, lit capacity your traffic
|
||||
// is not using, a free pair.
|
||||
function cmCan(l,p){if(!fiberOk({link:l.id,type:p==='iru'?'dfpair':'wwave'}))return 0;return p==='spec'?Math.max(0,freeCh(l)):p==='iru'?cmSpare(l,'iru'):cmSpare(l,p,0);}
|
||||
/* News: incidents that cut glass become news the next morning, and every so often something happens on its own.
|
||||
Each one is a shock on a route, around a city, or on every subsea route, for some products, for a while. */
|
||||
const CM_NEWS={
|
||||
cut:{m:1.6,days:45,p:null,t:N_('market.news_cut')},redsea:{m:1.8,days:90,p:null,t:N_('market.news_redsea')},
|
||||
dc:{m:2,days:150,p:['w400','w800','w1600','iru'],t:N_('market.news_dc_big')},ai:{m:2.5,days:70,p:['w400','w800','w1600'],t:N_('market.news_ai_big')},
|
||||
glut:{m:0.6,days:120,p:null,t:N_('market.news_glut')},exch:{m:1.7,days:60,p:CM_W,t:N_('market.news_exch')},
|
||||
merge:{m:0.75,days:90,p:null,t:N_('market.news_merge')},boom:{m:1.4,days:60,p:['spec','w100'],t:N_('market.news_boom')}};
|
||||
function cmNews(why,x,d){const N=CM_NEWS[why],s={why,from:d,until:d+N.days,m:N.m,...x};if(N.p)s.p=N.p.slice();S.cm.sh.push(s);
|
||||
S.cm.news.unshift({d,why,a:x.a||x.c||null,b:x.b||null});S.cm.news.length=Math.min(S.cm.news.length,8);
|
||||
const rs=cmRoutes();if([...rs.values()].some(r=>cmHits(s,r)))toast(cmNewsText(S.cm.news[0]),N.m>1?'info':'warn',[{l:tr('market.open'),act:'marketOpen',args:{}}]);}
|
||||
const cmNewsText=n=>tr(CM_NEWS[n.why].t,{a:n.a?CITY[n.a].name:'',b:n.b?CITY[n.b].name:''});
|
||||
function cmShocks(d){const C=S.cm;C.sh=C.sh.filter(x=>x.until>d);
|
||||
for(const i of S.inc)if(LINKCUT_TR.includes(i.type)&&!C.seen.includes(i.id)){C.seen.push(i.id);if(C.seen.length>40)C.seen.shift();
|
||||
if(i.type==='redsea'){cmNews('redsea',{sub:1},d);continue;}
|
||||
const l=S.links.find(x=>x.id===i.ref||x.trench===i.ref);if(l)cmNews('cut',{c:hstr(String(i.id))%2?l.a:l.b,a:l.a,b:l.b},d);}
|
||||
// Without dark fiber there is no market to move, and no random number is drawn (the rest of the day stays as it was).
|
||||
const rs=[...cmRoutes().values()],cs=[...new Set(rs.flatMap(r=>[r.a,r.b]))];if(!rs.length||Math.random()>=1/10)return;
|
||||
const why=pick(['dc','ai','glut','exch','merge','boom','boom','dc']),r=pick(rs),c=pick(cs);
|
||||
if(why==='dc'||why==='boom')cmNews(why,{c},d);
|
||||
else if(why==='exch'){const f=cs.filter(x=>CM_FIN.includes(x));if(f.length){const x=pick(f);cmNews(why,{c:x},d);}}
|
||||
else cmNews(why,{k:r.k,a:r.a,b:r.b},d);}
|
||||
/* Once a day: news, then on every route the broker lists what your thresholds allow (spare after the share kept back,
|
||||
while demand is at least your minimum and the price at least your floor) or takes it off, then each listing may
|
||||
find a buyer: the more room the route has left and the hotter it is, the sooner; the fastest fiber sells first. */
|
||||
function cmList1(r,p,s,d){const c=S.cm.p[p],lk=CM_L[p];if(!c.on||S.cm.off[r.k])return;const ok=cmDem(r,p,d)>=c.min&&cmIdx(r,p,s,0,d)*100>=c.floor;
|
||||
for(const l of r.ls){const n=ok?cmSpare(l,p):0;if(n>0)cmLs(l)[lk]=n;else if(l.list)l.list[lk]=0;}}
|
||||
// The listings as the thresholds want them right now (after you change a setting), without selling anything.
|
||||
function cmRelist(){const rs=cmRoutes(),sold=cmSold(rs);for(const r of rs.values())for(const p of CM_P)cmList1(r,p,sold.get(r.k)[p],S.day);cmTidy();}
|
||||
const cmTidy=()=>{for(const l of S.links)if(l.list){const L=cmClean(l.list);if(L)l.list=L;else delete l.list;}};
|
||||
function cmDay(d=S.day){const C=S.cm;cmShocks(d);const rs=cmRoutes(),sold=cmSold(rs);
|
||||
for(const r of rs.values()){const s=sold.get(r.k);
|
||||
for(const p of CM_P){const lk=CM_L[p];cmList1(r,p,s[p],d);
|
||||
// Room rounds to the nearest unit: a road to nowhere that wants about one wave sells one.
|
||||
const D=cmDem(r,p,d),room=Math.round(D-s[p]);if(room<1)continue;
|
||||
const ls=r.ls.filter(l=>l.list&&l.list[lk]>0&&cmCan(l,p)>0).sort((x,y)=>linkLat(x)-linkLat(y));if(!ls.length)continue;
|
||||
if(Math.random()>=Math.min(0.35,0.06+0.25*room/Math.max(1,D))*(p==='iru'?0.08:1)*(p==='spec'?1:Math.sqrt(r.lp)))continue;
|
||||
const l=ls[0];let n=p==='iru'?1:Math.max(1,Math.min(l.list[lk],cmCan(l,p),room,1+Math.floor(Math.random()*(p==='spec'||p==='w100'?4:2))));
|
||||
// Never below your floor: fewer units, or none.
|
||||
while(n>0&&cmIdx(r,p,s[p],n-1,d)*100<C.p[p].floor)n--;if(!n)continue;
|
||||
const cut=cmCut()*mkt(),L=cmList(r,p);let rate=0;for(let i=0;i<n;i++)rate+=L*cmIdx(r,p,s[p],i,d);
|
||||
const up=p==='iru'?Math.round(cmUpList(r)*cmIdx(r,p,s[p],0,d)*cut):0;
|
||||
cmSell(l,p,n,Math.round(rate*cut),up);s[p]+=n;l.list[lk]-=n;}}
|
||||
cmGrow(d);cmTidy();}
|
||||
/* What the next 30 and 90 days look like on a route, for a Cable broker: the route's own cycle and the news already
|
||||
out, but not the noise or news still to come. */
|
||||
const cmFc=(r,p,t)=>cmDem(r,p,S.day+t,true);
|
||||
/* Growth inside contracts: once the next size is common (15% of what buyers want), a carrier on a managed wave asks
|
||||
now and then to move all its waves up one size. With room on the fiber (after what you keep back) it moves at once
|
||||
and pays more (a bigger wave, at a lower price per bit); without, it tells you, at most twice a year. */
|
||||
function cmGrow(d){for(const b of S.biz){if(b.type!=='mwave')continue;const i=CM_W.indexOf(cmWP(b.g)),q=CM_W[i+1];if(!q||cmShare(q,d)<0.15||Math.random()>=1/300)continue;
|
||||
const l=S.links.find(x=>x.id===b.link);if(!l||!fiberOk(b))continue;const g1=CM_G[q],extra=(g1-b.g)*(b.slots||1),sub=l.sub?1:0,arg={name:esc(b.name),n:b.slots||1,g0:fmtCap(b.g),g1:fmtCap(g1),a:CITY[l.a].name,b:CITY[l.b].name};
|
||||
if(cmOptG(l)>=g1&&cmFreeG(l)>=extra){const p0=cmWP(b.g);b.rate=Math.round(b.rate*CM_X[q][sub]/CM_X[p0][sub]*0.85);b.g=g1;b.what=cmWhat(l,q,b.slots||1);CM_V++;
|
||||
toast(tr('market.upgraded',{...arg,price:fmt$(b.rate)}),'good');}
|
||||
else if(!(b.gw>d-180)){b.gw=d;toast(tr('market.wants_more',arg),'warn',[{l:tr('lease_swaps.open_your_fiber'),act:'dashLink',args:{id:l.id}}]);}}}
|
||||
// How many more spectrum slots a fiber's route wants today (the fiber panel's market line).
|
||||
function cmRoomSpec(l){const rs=cmRoutes(),r=rs.get(edgeKey(l));if(!r)return 0;return Math.max(0,Math.round(cmDem(r,'spec',S.day)-cmSold(rs).get(r.k).spec));}
|
||||
// Routes a Cable broker could build between two of its POPs, the most wanted first.
|
||||
function cmScout(n=6){const ps=Object.keys(S.pops),have=new Set(S.links.filter(l=>l.kind==='df').map(edgeKey)),out=[];
|
||||
for(let i=0;i<ps.length;i++)for(let j=i+1;j<ps.length;j++){const a=ps[i],b=ps[j],k=a<b?a+'|'+b:b+'|'+a;if(have.has(k))continue;
|
||||
const sub=isSub(a,b);if(sub?!seaCab(a,b):kmBetween(a,b)>1500||!dfAllowed(a,b))continue;const r=cmRoute(a,b);
|
||||
out.push({r,v:CM_P.reduce((s,p)=>s+cmDem(r,p,S.day)*cmList(r,p),0)});}
|
||||
return out.sort((x,y)=>y.v-x.v).slice(0,n).map(x=>x.r);}
|
||||
// Saves: everything checked, old saves get the defaults.
|
||||
function cmFix(s){const c=s.cm&&typeof s.cm==='object'&&!Array.isArray(s.cm)?s.cm:{},n=cmNew();
|
||||
n.hold=CM_HOLD.includes(+c.hold)?+c.hold:25;
|
||||
for(const p of CM_P){const x=c.p&&c.p[p]||{};n.p[p]={on:!!x.on,min:CM_MIN[p].includes(+x.min)?+x.min:CM_DEF[p].min,floor:CM_FLOOR.includes(+x.floor)?+x.floor:CM_DEF[p].floor};}
|
||||
if(c.off&&typeof c.off==='object')for(const k in c.off){const [a,b]=k.split('|');if(c.off[k]&&isCity(a)&&isCity(b)&&a<b)n.off[k]=1;}
|
||||
if(Array.isArray(c.sh))n.sh=c.sh.filter(x=>x&&own(CM_NEWS,x.why)&&(x.k?typeof x.k==='string'&&x.k.split('|').every(isCity):x.c?isCity(x.c):!!x.sub)).slice(-24).map(x=>{
|
||||
const y={why:x.why,from:int(x.from,-1e6,1e7,0),until:int(x.until,-1e6,1e7,0),m:clamp(num(x.m,1),0.3,3)};if(x.k)y.k=x.k;else if(x.c)y.c=x.c;else y.sub=1;
|
||||
if(isCity(x.a))y.a=x.a;if(isCity(x.b))y.b=x.b;if(Array.isArray(x.p)){const p=x.p.filter(q=>CM_P.includes(q));if(p.length)y.p=p;}return y;});
|
||||
if(Array.isArray(c.news))n.news=c.news.filter(x=>x&&own(CM_NEWS,x.why)).slice(0,8).map(x=>({d:int(x.d,-1e6,1e7,0),why:x.why,a:isCity(x.a)?x.a:null,b:isCity(x.b)?x.b:null}));
|
||||
if(Array.isArray(c.seen))n.seen=c.seen.filter(x=>typeof x==='string').slice(-40);
|
||||
s.cm=n;
|
||||
for(const l of s.links){if(l.kind!=='df'||!l.list)continue;const L=cmClean(l.list);if(L)l.list=L;else delete l.list;}
|
||||
for(const b of s.biz)if(b.type==='mwave'){b.g=CM_W.some(p=>CM_G[p]===b.g)?b.g:100;b.slots=Math.max(1,Math.round(b.slots||1));if(b.gw!==undefined)b.gw=int(b.gw,-1e6,1e7,0);}}
|
||||
|
|
@ -19,7 +19,7 @@ const SALES={
|
|||
const SALES_LV=2,SALES_VP=50000,SALES_VP_DAYS=30;
|
||||
// The ones the engineer never lands, and the nerds the shark never calls back.
|
||||
const salesBig=t=>{const T=BIZ_T[t];return !!T&&(!!T.mega||(T.lv||1)>=4);};
|
||||
const SALES_NERDS=['hft','edu','isp','l2vpn','bulk','provedor','fabl2','wwave','dfpair'];
|
||||
const SALES_NERDS=['hft','edu','isp','l2vpn','bulk','provedor','fabl2','wwave','mwave','dfpair'];
|
||||
const SALES_SAY=[N_('sales.ceo_say_synergy'),N_('sales.ceo_say_golf'),N_('sales.ceo_say_blockchain'),N_('sales.ceo_say_napkin'),N_('sales.ceo_say_mbps'),N_('sales.ceo_say_airport')];
|
||||
const slP=()=>S&&S.sales&&own(SALES,S.sales.p)?S.sales.p:null;
|
||||
const slName=(long)=>{const p=slP();return p?tr(long?SALES[p].n:SALES[p].s):'';};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
function newGame(name,home){
|
||||
S={v:1,name,asn:200000+Math.floor(_rand()*15000),home,day:0,cash:START_CASH,
|
||||
ltv:2,t1v:4,auV:1,calV:1,pieV:1,pie:null,ops:opsNew(),slAuto:slAutoNew(),achP:{},seen:NETS.map(n=>n.id),spares:{},pops:{[home]:{day:0,bb:null,boost:0,down:0,routers:1,gen:false}},links:[],nni:[],transit:[],ixp:{},rs:{},peers:{},pni:[],caches:[],biz:[],offers:[],myIx:{},pairMet:{},
|
||||
done:{},inc:[],fleet:{},ev:{ddosMore:[]},ddosStarts:[],priceMul:1,nextFail:45,nextEvent:40,usedNames:[],stats:{survived:0,incidents:0,peak:0},vol:0,cnLic:{state:'none'},scrubs:[],scrubMode:'always',ddosAuto:{rtbh:false,scrub:true},capDeal:null,core:{lv:0,run:0},popStd:null,won:false,lost:false,neg:0,loans:[],loanOffers:[],loanStrikes:0,ppol:'open',pdesk:null,pdeskRep:null,hw:{},rules:makeRules('oncall'),charter:'global',chartSet:false,demo:{},seatOff:null,solWon:0,monkey:{next:null,on:0}};
|
||||
done:{},inc:[],fleet:{},ev:{ddosMore:[]},ddosStarts:[],priceMul:1,nextFail:45,nextEvent:40,usedNames:[],stats:{survived:0,incidents:0,peak:0},vol:0,cnLic:{state:'none'},scrubs:[],scrubMode:'always',ddosAuto:{rtbh:false,scrub:true},capDeal:null,core:{lv:0,run:0},popStd:null,won:false,lost:false,neg:0,loans:[],loanOffers:[],loanStrikes:0,ppol:'open',pdesk:null,pdeskRep:null,hw:{},rules:makeRules('oncall'),charter:'global',cm:cmNew(),chartSet:false,demo:{},seatOff:null,solWon:0,monkey:{next:null,on:0}};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ function sanitize(s){
|
|||
if(!isCity(s.home))s.home=Object.keys(s.pops)[0]||'fra';
|
||||
opsSanitize(s);
|
||||
const tier=v=>int(v,0,PORT.length-1,0),lag=v=>int(v,1,LAG_MAX,1),sid=v=>String(v==null?uid():v).slice(0,40);
|
||||
s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);if(l.list!==undefined){const L=l.list;if(l.kind==='df'&&L&&typeof L==='object'&&!Array.isArray(L)){const w=int(L.w,0,256,0),p=int(L.p,0,2,0);if(w||p)l.list={w,p};else delete l.list;}else delete l.list;}l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.cname!=null)l.cname=String(l.cname).slice(0,60);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:s.lvl>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&(!own(CAB,l.cable)||!cablePair(l.cable,l.a,l.b)))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);if(l.day!==undefined)l.day=Math.min(s.day,Math.max(0,num(l.day,s.day)));for(const k of Object.keys(SUB_UPGRADES)){const f='sub'+k;if(l[f]!==undefined){if(l.own&&l.sub&&Number.isFinite(l[f])&&l[f]>=0)l[f]=Math.round(l[f]);else delete l[f];}}if(l.seaPath!==undefined){if(l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.length>=2&&l.seaPath.length<=2048&&l.seaPath.every(p=>Array.isArray(p)&&p.length===2&&p.every(Number.isFinite)&&Math.abs(p[0])<=180&&Math.abs(p[1])<=90))l.seaPath=l.seaPath.map(p=>p.slice());else delete l.seaPath;}if(l.paid!==undefined){if(l.own&&l.sub&&Number.isFinite(l.paid)&&l.paid>=0)l.paid=Math.round(l.paid);else delete l.paid;}if(l.own&&l.sub&&!own(SEA_DESIGNS,l.seaDesign))l.seaDesign='standard';l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss)l.loss=deg(l.loss);return l;});
|
||||
s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);if(l.list!==undefined){const L=l.kind==='df'?cmClean(l.list):null;if(L)l.list=L;else delete l.list;}l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.cname!=null)l.cname=String(l.cname).slice(0,60);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:s.lvl>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&(!own(CAB,l.cable)||!cablePair(l.cable,l.a,l.b)))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);if(l.day!==undefined)l.day=Math.min(s.day,Math.max(0,num(l.day,s.day)));for(const k of Object.keys(SUB_UPGRADES)){const f='sub'+k;if(l[f]!==undefined){if(l.own&&l.sub&&Number.isFinite(l[f])&&l[f]>=0)l[f]=Math.round(l[f]);else delete l[f];}}if(l.seaPath!==undefined){if(l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.length>=2&&l.seaPath.length<=2048&&l.seaPath.every(p=>Array.isArray(p)&&p.length===2&&p.every(Number.isFinite)&&Math.abs(p[0])<=180&&Math.abs(p[1])<=90))l.seaPath=l.seaPath.map(p=>p.slice());else delete l.seaPath;}if(l.paid!==undefined){if(l.own&&l.sub&&Number.isFinite(l.paid)&&l.paid>=0)l.paid=Math.round(l.paid);else delete l.paid;}if(l.own&&l.sub&&!own(SEA_DESIGNS,l.seaDesign))l.seaDesign='standard';l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss)l.loss=deg(l.loss);return l;});
|
||||
for(const l of s.links)repairSubUpgradeDates(l,s.day);
|
||||
/* Metrics moved from each link to its city pair (#122). Older saves routed a pair at the lowest metric of its
|
||||
links, with all of them carrying traffic, so the pair keeps that metric and nothing goes on standby. */
|
||||
|
|
@ -111,6 +111,7 @@ function sanitize(s){
|
|||
{const r=s.rules&&typeof s.rules==='object'&&!Array.isArray(s.rules)?s.rules:{};
|
||||
const m={mods:r.mods};s.rules=s.scn&&typeof s.scn==='object'?makeRules('oncall',m):s.mode==='sandbox'?makeRules('sandbox',{...m,chaos:r.chaos}):makeRules(NORMAL_PRESETS.includes(r.preset)?r.preset:'oncall',m);}
|
||||
specSanitize(s);
|
||||
cmFix(s);
|
||||
pieSanitize(s);pieIncFix(s);volFix(s);
|
||||
if(s.te){if(typeof s.te!=='object')s.te=null;else{s.te.on=!!s.te.on;s.te.script=typeof s.te.script==='string'?s.te.script.slice(0,4000):'';}}
|
||||
return s;}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ const linkIds=()=>{const m=new Map();for(const l of S.links)if(!m.has(l.id))m.se
|
|||
function fiberUse(){const sold=new Map(),dfp=new Map(),pairs=new Set();
|
||||
for(const b of S.biz){if(b.type==='wwave')sold.set(b.link,(sold.get(b.link)||0)+(b.slots||0));else if(b.type==='dfpair')dfp.set(b.link,(dfp.get(b.link)||0)+1);else if(b.type==='pairs'||b.type==='capfib')pairs.add(b.link);}
|
||||
return {sold,dfp,pairs};}
|
||||
function fiberOk(b,ids){const l=ids?ids.get(b.link):S.links.find(x=>x.id===b.link);if(!l)return false;if(b.type==='dfpair'||b.type==='pairs'||b.type==='capfib')return l.ready<=S.day&&!(l.cut>S.day);return l.ready<=S.day&&!(l.cut>S.day)&&!(l.eqDown>S.day);}
|
||||
function fiberOk(b,ids){const l=ids?ids.get(b.link):S.links.find(x=>x.id===b.link);if(!l)return false;if(b.type==='dfpair'||b.type==='pairs'||b.type==='capfib')return l.ready<=S.day&&!(l.cut>S.day);return l.ready<=S.day&&!(l.cut>S.day)&&!(l.eqDown>S.day)&&(b.type!=='mwave'||dfLit(l)>=mwG(l));}
|
||||
function soldSlots(l,u){return u?u.sold.get(l.id)||0:S.biz.filter(b=>b.type==='wwave'&&b.link===l.id).reduce((a,b)=>a+(b.slots||0),0);}
|
||||
// Spare capacity other carriers can rent on a dark fiber (#51): free channels for alien waves, and on your own build
|
||||
// a spare pair in the trench. Random offers and broker listings follow the same rules and the same prices.
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ function* dayPost(d){
|
|||
if(rule('money')==='infinite'&&S.cash<1e8)S.cash=1e9;
|
||||
// offers
|
||||
S.offers=S.offers.filter(o=>o.exp>d);
|
||||
brTick();
|
||||
cmDay(d);
|
||||
if(S.offers.length<5&&Math.random()<(0.05+0.01*(S.lvl||1))*(ppol()==='closed'?0.6:1)*(confSpOn()?SP_OFFERS:1)*salesSpawn()){const n0=S.offers.length;spawnOffer();mktPrice(n0);salesShape(n0);}
|
||||
yield DAY_REST;
|
||||
// failures & events
|
||||
|
|
|
|||
14
src/game/90-actions/53-market.js
Normal file
14
src/game/90-actions/53-market.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// The capacity market (37-fiber-market.js): its tab, and the settings the broker sells by.
|
||||
Object.assign(ACT,{
|
||||
marketOpen:()=>{if(!S||pzOn())return;UI.dtab='market';$('dash').hidden=false;renderDash();},
|
||||
mktHold:({v})=>{if(!CM_HOLD.includes(v))return;S.cm.hold=v;cmRelist();sfx('click');after();},
|
||||
// Switching a product off takes what the broker listed of it off the market; what it already sold stays sold.
|
||||
mktCfg:({p,k,v})=>{const c=CM_P.includes(p)&&S.cm.p[p];if(!c)return;
|
||||
if(k==='on'){c.on=!!v;if(!c.on)for(const l of S.links)if(l.list&&l.list[CM_L[p]])l.list[CM_L[p]]=0;}
|
||||
else if(k==='min'&&CM_MIN[p].includes(v))c.min=v;else if(k==='floor'&&CM_FLOOR.includes(v))c.floor=v;else return;
|
||||
cmRelist();sfx('click');after();},
|
||||
// A route the broker leaves alone keeps nothing listed by the thresholds.
|
||||
mktRoute:({k})=>{const r=typeof k==='string'&&cmRoutes().get(k);if(!r)return;if(S.cm.off[k]){delete S.cm.off[k];}else{S.cm.off[k]=1;
|
||||
for(const l of r.ls)if(l.list)for(const p of CM_P)if(S.cm.p[p].on)l.list[CM_L[p]]=0;}
|
||||
cmRelist();sfx('click');after();},
|
||||
});
|
||||
|
|
@ -117,10 +117,10 @@ function dfPanel(l){
|
|||
if(bld){const tot=Math.max(1,l.ready-l.day),done=clamp((S.day-l.day)/tot,0,1);
|
||||
h+=`<section><h3>${l.own?tr('common.under_construction'):tr('common.being_spliced')}</h3><div class="kv"><span>${l.own?tr('link_panels.permits_trenching_splicing'):tr('common.iru_handover')}</span><b>${tr('common.n_days_left',{n:l.ready-S.day})}</b></div><div class="bar me"><i style="width:${done*100}%"></i></div>${l.own&&l.sub?layPanel(l):l.own?`<div class="btns">${btn(tr('link_panels.hire_extra_crews_price_30_days',{price:fmt$(crewCost(l))}),'crews',{id:l.id},'sm',!crewSteps(l)||S.cash<crewCost(l))}${btn(trn('link_panels.all_crews_done_in_n_days_price',Math.max(1,crewFloor(l)-S.day),{price:fmt$(crewSteps(l)*crewCost(l))}),'crews',{id:l.id,all:1},'sm',!crewSteps(l)||S.cash<crewSteps(l)*crewCost(l))}</div>${!crewSteps(l)&&l.ready>S.day+1?`<p class="note">${tr('link_panels.crews_can_halve_a_build_at_most')}</p>`:''}`:''}<p class="note">${tr('link_panels.you_can_pre_install_optics_now')}</p></section>`;}
|
||||
else if(inc&&linkDown(l))h+=`<section><h3 style="color:var(--bad)">${tr('common.dark_6bf5')}</h3><p class="lead">${esc(inc.msg)}</p>${shipNote(inc)}${inc.cost?btn(`${esc(inc.fix||tr('common.rush_repair'))} ${fmt$(inc.cost)}`,'fixInc',{id:inc.id},'red',S.cash<inc.cost):''}</section>`;
|
||||
h+=`<section><h3>${tr('common.capacity')}</h3><div class="kv"><span>${tr('link_panels.n_of_max_channels_lit',{n:(l.ch||[]).length,max:chMax(l)})}${soldSlots(l)?` · ${tr('link_panels.n_sold_as_alien_waves',{n:soldSlots(l)})}`:''}</span><b>${fmtG(load)} / ${fmtG(cap)}</b></div><div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div>
|
||||
h+=`<section><h3>${tr('common.capacity')}</h3><div class="kv"><span>${tr('link_panels.n_of_max_channels_lit',{n:(l.ch||[]).length,max:chMax(l)})}${soldSlots(l)?` · ${tr('link_panels.n_sold_as_alien_waves',{n:soldSlots(l)})}`:''}${mwG(l)?` · ${tr('market.g_sold_as_managed',{g:fmtCap(mwG(l))})}`:''}</span><b>${fmtG(load)} / ${fmtG(cap)}</b></div><div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div>
|
||||
${seatPanel(l)}${l.own&&l.sub?`<div class="kv"><span>${tr('common.cable_design')}</span><b>${tr((SEA_DESIGNS[l.seaDesign]||SEA_DESIGNS.standard).n)}</b></div>`:''}
|
||||
<div class="kv"><span>${tr('common.latency')}</span><b>${tr('common.ms_ms_one_way',{ms:linkLat(l).toFixed(1)})}</b></div><div class="kv"><span>${l.own?tr('link_panels.right_of_way_upkeep'):tr('common.iru_lease')}</span><b>${tr('common.price_mo',{price:fmt$(l.mo)})}</b></div><div class="kv"><span>${tr('link_panels.n_amp_huts',{n:amps})}</span><b>${tr('common.price_mo',{price:fmt$(amps*AMP_MO)})}</b></div>${!bld&&!(l.ch||[]).length?`<p class="why">${tr('link_panels.this_fiber_is_dark_add_optics')}</p>`:''}</section>`;
|
||||
if(!bld){const sold=S.biz.filter(b=>b.link===l.id&&(b.type==='wwave'||b.type==='dfpair'||b.type==='pairs')),off=S.offers.find(o=>o.link===l.id),fc=freeCh(l);
|
||||
if(!bld){const sold=S.biz.filter(b=>b.link===l.id&&(b.type==='wwave'||b.type==='mwave'||b.type==='dfpair'||b.type==='pairs')),off=S.offers.find(o=>o.link===l.id),fc=freeCh(l);
|
||||
h+=`<section><h3>${tr('link_panels.selling_spare_capacity')}</h3><p class="lead">${tr('link_panels.other_carriers_rent_what_you_do')}</p>
|
||||
<div class="kv"><span>${tr('common.free_channels')}</span><b>${fc} / ${chMax(l)}</b></div>${sold.map(b=>`<div class="row"><div class="grow"><div class="nm">${esc(b.name)}</div><div class="meta">${esc(b.what||BIZ_T[b.type].l)} · ${tr('common.price_mo',{price:fmt$(b.rate)})}</div></div></div>`).join('')}
|
||||
${off?`<div class="row"><div class="grow"><div class="nm">${esc(off.name)}</div><div class="meta">${esc(off.what)} · ${tr('common.price_mo',{price:fmt$(off.rate)})} · ${tr('ui.n_d_left',{n:off.exp-S.day})}${off.broker?' · '+tr('link_panels.via_a_capacity_broker'):''}</div></div>${btn(tr('common.accept'),'accept',{id:off.id},'pink sm')}</div>`:brListHtml(l,fc)}</section>`;}
|
||||
|
|
@ -188,10 +188,10 @@ function offTransitHint(id,city){const n=NET[id];if(n.type==='t1'&&n.pol==='rest
|
|||
if(pniC.length)return tr('link_panels.pni_in_city_why',{city:CITY[pniC[0]].name,why:pOk.why});{const x=nearestSpot(id);return x?tr('link_panels.not_in_your_cities_yet_nearest',{city:CITY[x.c].name}):tr('link_panels.not_present_in_any_of_your');}}
|
||||
function transitTop(ids,k=5){const m={};for(const id of ids)for(const [n,v] of Object.entries(R.tNet[id]||{}))m[n]=(m[n]||0)+v;return Object.entries(m).filter(([,v])=>v>0.01).sort((a,b)=>b[1]-a[1]).slice(0,k);}
|
||||
// The broker: what is listed and how the route's market looks, or the buttons to list some (#203).
|
||||
function brListHtml(l,fc){const L=l.list,free=brFree(l),pf=l.own&&pairFree(l)&&!(L&&L.p);
|
||||
function brListHtml(l,fc){const L=l.list,free=cmRoomSpec(l),pf=l.own&&pairFree(l)&&!(L&&L.p),cut=Math.round((1-cmCut())*100),go=`<div class="btns">${btn(tr('market.open'),'marketOpen',{},'ghost sm')}</div>`;
|
||||
const mk=`<div class="kv"><span>${tr('broker.market',{a:CITY[l.a].name,b:CITY[l.b].name})}</span><b>${trn('broker.n_waves',free)}</b></div>`;
|
||||
if(L)return mk+`<div class="row"><div class="grow"><div class="nm">${tr('broker.listed_title')}</div><div class="meta">${[L.w?trn('broker.n_waves_left',L.w):'',L.p?trn('broker.n_pairs_left',L.p):''].filter(Boolean).join(' · ')} · ${tr('broker.how')}</div></div>${btn(tr('broker.unlist'),'unlistFiber',{id:l.id},'ghost sm')}</div>`+
|
||||
(fc-L.w>=1?`<div class="btns">${btn(tr('broker.list_more',{n:Math.min(4,fc-L.w)}),'listFiber',{id:l.id,w:Math.min(4,fc-L.w)},'ghost sm')}</div>`:'');
|
||||
if(fc<1&&!pf)return mk+`<p class="note">${tr('link_panels.nothing_spare_to_sell_on_this')}</p>`;
|
||||
if(L)return mk+`<div class="row"><div class="grow"><div class="nm">${tr('broker.listed_title')}</div><div class="meta">${[L.w?trn('broker.n_waves_left',L.w):'',...CM_W.map(p=>L[CM_L[p]]?trn('market.n_g_left',L[CM_L[p]],{g:fmtCap(CM_G[p])}):''),L.p?trn('broker.n_pairs_left',L.p):''].filter(Boolean).join(' · ')} · ${tr('market.how',{n:cut})}</div></div>${btn(tr('broker.unlist'),'unlistFiber',{id:l.id},'ghost sm')}</div>`+
|
||||
(fc-L.w>=1?`<div class="btns">${btn(tr('broker.list_more',{n:Math.min(4,fc-L.w)}),'listFiber',{id:l.id,w:Math.min(4,fc-L.w)},'ghost sm')}${btn(tr('market.open'),'marketOpen',{},'ghost sm')}</div>`:go);
|
||||
if(fc<1&&!pf)return mk+`<p class="note">${tr('link_panels.nothing_spare_to_sell_on_this')}</p>`+go;
|
||||
const ns=[...new Set([1,4,Math.min(16,fc),fc])].filter(n=>n>=1&&n<=fc);
|
||||
return mk+`<p class="meta">${tr('broker.lead')}</p><div class="btns">${ns.map(n=>btn(n===fc&&n>1?tr('broker.list_all',{n}):trn('broker.list_n',n),'listFiber',{id:l.id,w:n},'sm')).join('')}${pf?btn(tr('broker.list_pair'),'listFiber',{id:l.id,p:1},'sm'):''}</div>`+(free<1?`<p class="why">${tr('broker.no_market')}</p>`:'');}
|
||||
return mk+`<p class="meta">${tr('market.lead_fiber',{n:cut})}</p><div class="btns">${ns.map(n=>btn(n===fc&&n>1?tr('broker.list_all',{n}):trn('broker.list_n',n),'listFiber',{id:l.id,w:n},'sm')).join('')}${pf?btn(tr('broker.list_pair'),'listFiber',{id:l.id,p:1},'sm'):''}</div>`+(free<1?`<p class="why">${tr('broker.no_market')}</p>`:'')+go;}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const popOrder=()=>S&&S.pops?Object.keys(S.pops).filter(isCity).sort((a,b)=>CITY
|
|||
const offerOrder=()=>S&&S.offers?S.offers.filter(o=>isCity(o.city)).sort((a,b)=>a.exp-b.exp):[];
|
||||
// n opens the NOC dashboard, and a letter within KEY_LEAD ms of it picks a tab (n c: Connections). n never closes the
|
||||
// dashboard, so n c switches tabs without it flashing shut; Escape closes it.
|
||||
const DASH_KEYS={o:'overview',u:'cust',c:'conn',t:'traffic',r:'infra',l:'lease'},KEY_LEAD=1000;let keyLead=0;
|
||||
const DASH_KEYS={o:'overview',u:'cust',c:'conn',t:'traffic',r:'infra',l:'lease',m:'market'},KEY_LEAD=1000;let keyLead=0;
|
||||
// Arrow keys and WASD move the map while held, at a steady speed on screen. Their own frame loop runs only while one is
|
||||
// down, so the game loop does no extra work; letting go, a window opening or leaving the browser window stops it.
|
||||
const PAN_KEYS={ArrowUp:[0,-1],w:[0,-1],ArrowDown:[0,1],s:[0,1],ArrowLeft:[-1,0],a:[-1,0],ArrowRight:[1,0],d:[1,0]},PAN_SPEED=700;
|
||||
|
|
@ -15,7 +15,7 @@ function panFrame(t){if(!panHeld.size||!$('modal').hidden||!$('dash').hidden){pa
|
|||
// A slow frame (a busy day, a background tab) moves at most 50 ms worth, not a jump across the map.
|
||||
const dt=panAt==null?0:Math.min(0.05,(t-panAt)/1000);panAt=t;let dx=0,dy=0;for(const k of panHeld){dx+=PAN_KEYS[k][0];dy+=PAN_KEYS[k][1];}
|
||||
cam.x+=dx*PAN_SPEED*dt/cam.z;cam.y+=dy*PAN_SPEED*dt/cam.z;wrapCam();requestAnimationFrame(panFrame);}
|
||||
function showKeys(){const k=s=>`<span class="kbd">${s}</span>`,TN={overview:tr('common.overview'),cust:tr('common.customers'),conn:tr('common.connections'),traffic:tr('common.traffic'),infra:tr('common.links_routers'),lease:tr('common.leased_lines')};
|
||||
function showKeys(){const k=s=>`<span class="kbd">${s}</span>`,TN={overview:tr('common.overview'),cust:tr('common.customers'),conn:tr('common.connections'),traffic:tr('common.traffic'),infra:tr('common.links_routers'),lease:tr('common.leased_lines'),market:tr('market.tab')};
|
||||
const tabs=Object.entries(DASH_KEYS).map(([l,t])=>`<span class="keytab">${k(l)} ${TN[t]}</span>`).join(' ');
|
||||
const rows=[[[...'←↑↓→'].map(k).join(' ')+'<br>'+[...'wasd'].map(k).join(' '),tr('keys.move_around_the_map')],[k(tr('keys.space')),tr('keys.pause_or_play')],[k('0')+' – '+k('4'),tr('keys.game_speed')],[k('/'),tr('find.find_a_city')],[k('[')+' '+k(']'),tr('keys.previous_or_next_of_your')],[k('$'),tr('keys.next_open_offer_soonest_to')],[k('-')+' '+k('='),tr('keys.zoom_the_map_out_or')],[k('n'),`${tr('keys.noc_dashboard_a_letter_right')}<br>${tabs}`],[k(tr('keys.esc')),tr('keys.close_a_window_or_deselect')],[k('?'),tr('keys.show_this_list')]];
|
||||
openModal(`<div style="display:flex;align-items:center"><h2 style="font-size:28px">⌨️ ${tr('keys.keyboard_shortcuts')}</h2><button class="x" data-act="helpClose" aria-label="${tr('common.close')}">×</button></div>
|
||||
|
|
|
|||
|
|
@ -66,4 +66,4 @@ function netWhereIdx(){const B={t:{},p:{},ix:{},c:{}},add=(k,id,x)=>(B[k][id]||(
|
|||
function netWhere(n,where){const ch=(where||netWhereIdx())(n.id);
|
||||
if(!ch.length)return '';const MAX=6;
|
||||
return `<div class="btns">${ch.slice(0,MAX).map(([l,c,k])=>btn(`${esc(l)} <small>${esc(CITY[c].name)}</small>`,'goConn',{city:c,k},'ghost sm')).join('')}${ch.length>MAX?btn(tr('dashboard.n_more',{n:ch.length-MAX}),'connFor',{net:n.id},'ghost sm'):''}</div>`;}
|
||||
const DTABS=['overview','cust','conn','traffic','infra','pops','lease'];
|
||||
const DTABS=['overview','cust','conn','traffic','infra','pops','lease','market'];
|
||||
|
|
|
|||
38
src/game/94-dashboard/55-market.js
Normal file
38
src/game/94-dashboard/55-market.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* ---------- the capacity market tab (37-fiber-market.js) ----------
|
||||
Your settings (what the broker may sell, from what demand and price, and how much it keeps back), the news, and
|
||||
every route you hold dark fiber on: per product what is wanted, sold and listed, as a bar with your threshold on
|
||||
it, and today's price against your floor. A Cable broker also sees where each route is heading, and routes it could
|
||||
build. Markup is deterministic (the NOC window copies it). */
|
||||
const CM_NAME={spec:N_('market.p_spec'),w100:N_('market.p_w100'),w400:N_('market.p_w400'),w800:N_('market.p_w800'),w1600:N_('market.p_w1600'),iru:N_('market.p_iru')};
|
||||
const CM_DESC={spec:N_('market.p_spec_d'),w100:N_('market.p_w100_d'),w400:N_('market.p_w400_d'),w800:N_('market.p_w800_d'),w1600:N_('market.p_w1600_d'),iru:N_('market.p_iru_d')};
|
||||
const cmN=v=>v>=10?String(Math.round(v)):v.toFixed(1).replace(/\.0$/,'');
|
||||
// Why nothing is listed although the route wants it and the price is right: no optic that big, or no room left on
|
||||
// the fiber after what you keep back. Growing means lighting more.
|
||||
// A bar: sold (green) of what the route wants (the dark line), and your minimum (the pink tick) when the broker lists.
|
||||
function cmBar(D,sold,min){const top=Math.max(D,sold,min||0,1)*1.15,w=v=>(100*Math.min(1,v/top)).toFixed(1)+'%';
|
||||
return `<div class="cmbar"><i style="width:${w(sold)}"></i><b style="left:${w(D)}"></b>${min?`<u style="left:${w(min)}"></u>`:''}</div>`;}
|
||||
const cmSeg=(vals,cur,act,args,f)=>`<div class="seg">${vals.map(v=>btn(f(v),act,{...args,v},v===cur?'pink sm':'ghost sm')).join('')}</div>`;
|
||||
function cmHeatTag(r){const H=cmHeat(r,'spec',S.day);return H>=1.15?`<span class="tag cmhot">${tr('market.hot',{x:H.toFixed(1)})}</span>`:H<=0.85?`<span class="tag cmcool">${tr('market.cool',{x:H.toFixed(1)})}</span>`:`<span class="tag st">${tr('market.steady')}</span>`;}
|
||||
function cmProdLine(r,p,s,L,fc){const C=S.cm.p[p],D=cmDem(r,p,S.day),i=cmIdx(r,p,s,0,S.day),pc=Math.round(i*100),m=mkt()*cmCut();
|
||||
const price=p==='iru'?tr('market.price_pair',{up:fmt$(Math.round(cmUpList(r)*i*m)),price:fmt$(Math.round(cmList(r,p)*m)),pct:pc}):tr('market.price',{price:fmt$(Math.round(cmList(r,p)*i*m)),pct:pc});
|
||||
return `<div class="cmp"><div class="meta"><b>${tr(CM_NAME[p])}</b> · ${tr('market.row',{want:cmN(D),sold:s,listed:L})} · ${price}${C.on&&pc<C.floor?` <b style="color:var(--bad)">${tr('market.below_floor')}</b>`:C.on&&!L&&D>=C.min&&p!=='iru'&&!S.cm.off[r.k]?` <b style="color:var(--warn)">${CM_G[p]&&!r.ls.some(l=>cmOptG(l)>=CM_G[p])?tr('market.needs_optic',{g:fmtCap(CM_G[p])}):tr('market.no_room')}</b>`:''}</div>
|
||||
${cmBar(D,s,C.on?C.min:0)}${fc?`<div class="meta">${tr('market.forecast',{a:cmN(cmFc(r,p,30)),b:cmN(cmFc(r,p,90))})}</div>`:''}</div>`;}
|
||||
function marketTab(){const C=S.cm,rs=[...cmRoutes().values()].sort((x,y)=>brMarket(y.a,y.b)-brMarket(x.a,x.b)),sold=cmSold(new Map(rs.map(r=>[r.k,r]))),bk=broker();
|
||||
const mo=S.biz.reduce((a,b)=>a+(['wwave','mwave','dfpair'].includes(b.type)?bizMo(b):0),0),ago=n=>S.day-n.d<1?tr('market.today'):trn('market.days_ago',S.day-n.d);
|
||||
let h=`<div class="panel2" style="margin-top:12px"><h3>${tr('market.title')}</h3><p class="note" style="margin-top:0">${tr('market.lead')}</p>
|
||||
<div class="kv"><span>${tr('market.sales')}</span><b>${tr('common.price_mo',{price:fmt$(mo)})}</b></div>
|
||||
<div class="kv"><span>${tr('market.fee')}</span><b>${Math.round((1-cmCut())*100)}%${bk?` · ${tr('market.fee_broker')}`:''}</b></div>
|
||||
<div class="cmset"><div class="nm">${tr('market.hold')}</div><div class="meta">${tr('market.hold_d')}</div>${cmSeg(CM_HOLD,C.hold,'mktHold',{},v=>v+'%')}</div>
|
||||
${CM_P.map(p=>{const c=C.p[p];return `<div class="cmset"><div class="nm">${tr(CM_NAME[p])} ${btn(c.on?tr('market.selling'):tr('market.not_selling'),'mktCfg',{p,k:'on',v:c.on?0:1},c.on?'pink sm':'ghost sm')}</div><div class="meta">${tr(CM_DESC[p])}</div>
|
||||
${c.on?`<div class="meta">${tr('market.min')}</div>${cmSeg(CM_MIN[p],c.min,'mktCfg',{p,k:'min'},v=>'≥ '+v)}<div class="meta">${tr('market.floor')}</div>${cmSeg(CM_FLOOR,c.floor,'mktCfg',{p,k:'floor'},v=>v+'%')}`:''}</div>`;}).join('')}
|
||||
<h3 style="margin-top:10px">${tr('market.news')}</h3>${C.news.length?C.news.slice(0,5).map(n=>`<div class="meta">${ago(n)} · ${cmNewsText(n)}</div>`).join(''):`<p class="empty">${tr('market.no_news')}</p>`}</div>`;
|
||||
h+=`<div class="panel2" style="margin-top:12px"><h3>${tr('market.routes')}</h3>${rs.length?`<p class="meta" style="margin-top:0">${tr('market.legend')}${bk?'':' '+tr('market.forecast_lock')}</p>`+rs.map(r=>{const s=sold.get(r.k),off=!!C.off[r.k],L=p=>r.ls.reduce((a,l)=>a+((l.list&&l.list[CM_L[p]])||0),0);
|
||||
return `<div class="row cmroute"><div class="grow"><div class="nm">${CITY[r.a].name} ⇄ ${CITY[r.b].name} <span class="tag st">${r.sub?tr('common.subsea'):tr('common.land')}</span> ${cmHeatTag(r)}</div>
|
||||
<div class="meta">${tr('market.route_meta',{km:Math.round(r.km).toLocaleString(),ms:r.lat.toFixed(1),n:Math.round((r.lp-1)*100)})}</div>
|
||||
${(()=>{const shown=CM_P.filter(p=>s[p]>0||L(p)>0||cmDem(r,p,S.day)>=0.3||bk&&cmFc(r,p,90)>=0.3),rest=CM_P.filter(p=>!shown.includes(p));
|
||||
return shown.map(p=>cmProdLine(r,p,s[p],L(p),bk)).join('')+(rest.length?`<div class="meta">${tr('market.not_yet',{list:rest.map(p=>tr(CM_NAME[p])).join(', ')})}</div>`:'');})()}
|
||||
<div class="btns">${btn(off?tr('market.route_off'):tr('market.route_on'),'mktRoute',{k:r.k},off?'ghost sm':'pink sm')}${btn(tr('lease_swaps.open_your_fiber'),'dashLink',{id:r.ls[0].id},'ghost sm')}</div></div></div>`;}).join(''):`<p class="empty">${tr('market.no_routes')}</p>`}</div>`;
|
||||
if(bk){const sc=cmScout();h+=`<div class="panel2" style="margin-top:12px"><h3>${tr('market.scout')}</h3><p class="meta" style="margin-top:0">${tr('market.scout_d')}</p>${sc.length?sc.map(r=>{const v=CM_P.reduce((a,p)=>a+cmDem(r,p,S.day)*cmList(r,p),0)*mkt()*cmCut();
|
||||
return `<div class="row"><div class="grow"><div class="nm">${CITY[r.a].name} ⇄ ${CITY[r.b].name} <span class="tag st">${r.sub?tr('common.subsea'):tr('common.land')}</span> ${cmHeatTag(r)}</div>
|
||||
<div class="meta">${tr('market.scout_spend',{km:Math.round(r.km).toLocaleString(),v:fmt$(Math.round(v))})}</div>${CM_P.filter(p=>cmDem(r,p,S.day)>=0.3||cmFc(r,p,90)>=0.3).map(p=>`<div class="meta"><b>${tr(CM_NAME[p])}</b> · ${tr('market.forecast_now',{n:cmN(cmDem(r,p,S.day)),a:cmN(cmFc(r,p,30)),b:cmN(cmFc(r,p,90))})}</div>`).join('')}</div></div>`;}).join(''):`<p class="empty">${tr('market.scout_none')}</p>`}</div>`;}
|
||||
return h;}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
function dashTabs(){const u=custStats().unhappy,cur=UI.dtab||'overview',L={overview:tr('common.overview'),cust:tr('common.customers'),conn:tr('common.connections'),traffic:tr('common.traffic'),infra:tr('common.links_routers'),pops:tr('unbuilt_pops.no_pop_yet'),lease:tr('common.leased_lines')};
|
||||
function dashTabs(){const u=custStats().unhappy,cur=UI.dtab||'overview',L={overview:tr('common.overview'),cust:tr('common.customers'),conn:tr('common.connections'),traffic:tr('common.traffic'),infra:tr('common.links_routers'),pops:tr('unbuilt_pops.no_pop_yet'),lease:tr('common.leased_lines'),market:tr('market.tab')};
|
||||
return `<nav class="dtabs">${DTABS.map(k=>`<button class="${cur===k?'on':''}" data-act="dashTab" data-args='{"k":"${k}"}'>${L[k]}${k==='cust'&&u?`<span class="cnt red">${u}</span>`:''}</button>`).join('')}</nav>`;}
|
||||
function renderDash(){checkLayer();
|
||||
const H=S.hist||[],rows=H.slice(-90),last30=H.slice(-30);
|
||||
|
|
@ -31,5 +31,6 @@ function renderDash(){checkLayer();
|
|||
<h3 style="margin-top:10px">${tr('common.your_as')}</h3><div class="kv"><span>${tr('common.as_number')}</span><b>AS${S.asn}</b></div><div class="kv"><span>${tr('common.prefixes')}</span><b>${Math.max(1,Math.ceil(Object.keys(S.pops).length/3))} × /22 IPv4, 1 × /32 IPv6</b></div><div class="kv"><span>${tr('common.bgp_sessions')}</span><b>${R.sessions}</b></div><div class="kv"><span>${tr('common.upstreams')}</span><b>${new Set(S.transit.map(t=>t.net)).size}</b></div><div class="kv"><span>${tr('common.reach')}</span><b>${pct(R.reach)}</b></div><div class="kv"><span>${tr('common.customers')}</span><b>${tr('dashboard.n_businesses',{n:S.biz.length})}</b></div></div></div>`;
|
||||
if(DT==='pops')h+=popsSection();
|
||||
if(DT==='lease')h+=leaseTab();
|
||||
if(DT==='market')h+=marketTab();
|
||||
if(h!==UI._dh){UI._dh=h;morph($('dashCard'),h);}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
const NOC_HB=3000,NOC_LOST=10000,NOC_GAP=1000;
|
||||
// What a click in the window does: changes only its own view, or runs in the game. Every button the dashboard draws is in one list.
|
||||
const NOC_LOCAL=['chartToggle','connCity','connF','connNet','connSort','custCity','custF','custSort','dashClose','dashSort','dashTab','listMore','popsReg','popsSort'];
|
||||
const NOC_GO=['buyIx','buyNni','buyTransit','cache','connCancel','custGo','dashLink','goConn','lagIx','lagNni','lagP','lagT','leaseSwap','netFocus','opsOpen','pni','pniAllOpen','popGo'];
|
||||
const NOC_GO=['buyIx','buyNni','buyTransit','cache','connCancel','custGo','dashLink','goConn','lagIx','lagNni','lagP','lagT','leaseSwap','mktCfg','mktHold','mktRoute','netFocus','opsOpen','pni','pniAllOpen','popGo'];
|
||||
const NOC={win:false,id:null,ctl:null,st:null,stId:null,peer:false,until:0,dirty:false,sent:0,speed:1,hid:false,yoAt:0,gone:false};
|
||||
{const id=RW_IN?null:new URLSearchParams(location.search).get('noc');if(slotOkId(id)){NOC.win=true;NOC.id=id;}}
|
||||
if(!RW_IN)try{if(typeof BroadcastChannel==='function'){NOC.ctl=new BroadcastChannel('sot-noc');NOC.ctl.onmessage=e=>{const m=e.data;if(!m||typeof m!=='object'||!slotOkId(m.id))return;if(NOC.win)nocWinMsg(m);else nocGameMsg(m);};}}catch(e){}
|
||||
|
|
|
|||
|
|
@ -387,8 +387,6 @@
|
|||
"broker.goal_wave":"Sell a wave on your glass",
|
||||
"broker.goal_wave_d":"Carriers rent alien waves on fiber you have lit. Accept one from your deals.",
|
||||
"broker.goal_win_d":"Your own cables land on five continents, and carriers pay you $1M a month for capacity.",
|
||||
"broker.how":"it sells as the market wants; the broker keeps 10%",
|
||||
"broker.lead":"The broker keeps your listing and sells it off over time, as carriers between these two cities want capacity. It keeps 10% of each sale.",
|
||||
"broker.list_all":"List all {n}",
|
||||
"broker.list_more":"List {n} more",
|
||||
"broker.list_n":{"one":"List {n} wave","other":"List {n} waves"},
|
||||
|
|
@ -3036,6 +3034,75 @@
|
|||
"loop.something_in_the_noc_glitched_the":"<b>Something in the NOC glitched.</b><br>The game kept going. If things look odd, export your save and open an issue on GitHub.",
|
||||
"loop.welcome_back_name_your_network_is":"<b>Welcome back, {name}.</b><br>Your network is right where you left it: {date}.",
|
||||
"loop.your_saved_game_could_not_be":"<b>Your saved game could not be loaded.</b><br>It was damaged, so a backup was kept and you can start fresh.",
|
||||
"market.below_floor":"below your floor",
|
||||
"market.cool":"❄️ Cool ×{x}",
|
||||
"market.days_ago":{"one":"{n} day ago","other":"{n} days ago"},
|
||||
"market.fee":"The broker keeps",
|
||||
"market.fee_broker":"a Cable broker's rate",
|
||||
"market.floor":"Never sell below",
|
||||
"market.forecast":"In 30 days {a} · in 90 days {b}",
|
||||
"market.forecast_lock":"A Cable broker also sees where each route is heading.",
|
||||
"market.forecast_now":"{n} now · {a} in 30 days · {b} in 90 days",
|
||||
"market.g_sold_as_managed":"{g} sold as managed waves",
|
||||
"market.hold":"Keep back for your own traffic",
|
||||
"market.hold_d":"The share of every fiber's spectrum and lit capacity the broker never sells, so your own traffic has room to grow.",
|
||||
"market.hot":"🔥 Hot ×{x}",
|
||||
"market.how":"it sells as the market wants; the broker keeps {n}%",
|
||||
"market.lead":"Carriers buy capacity on the routes you hold dark fiber on. What each route wants moves all the time: hot routes pay more and fill faster, a short, straight route sells waves at a premium, and a long one costs more because its fiber does. Choose what the broker sells, from what demand and at what price.",
|
||||
"market.lead_fiber":"The broker keeps your listing and sells it off over time, as carriers between these two cities want capacity. It keeps {n}% of each sale.",
|
||||
"market.legend":"Each bar: what is sold (green) of what the route wants (the line); the pink tick is your minimum.",
|
||||
"market.managed_wave":"Managed wave",
|
||||
"market.min":"List while the route wants at least",
|
||||
"market.n_g_left":{"one":"{n} managed {g} wave left to sell","other":"{n} managed {g} waves left to sell"},
|
||||
"market.n_g_wave_on":{"one":"{n}× {g} managed wave on your {a}–{b} fiber","other":"{n}× {g} managed waves on your {a}–{b} fiber"},
|
||||
"market.needs_optic":"needs a {g} optic on this fiber",
|
||||
"market.news":"Market news",
|
||||
"market.news_ai_big":"An AI cluster wants to talk between {a} and {b}: 400G and bigger waves there are hot.",
|
||||
"market.news_boom":"A streaming hit floods {a}: carriers want more spectrum and 100G waves from there.",
|
||||
"market.news_cut":"Fiber cut between {a} and {b}: carriers want diverse paths around it.",
|
||||
"market.news_dc_big":"A hyperscaler breaks ground near {a}: big waves and dark pairs from there are wanted.",
|
||||
"market.news_exch":"Trading firms move their matching engines to {a}: fast waves from there pay more.",
|
||||
"market.news_glut":"A rival lights new fiber between {a} and {b}: buyers there cool off.",
|
||||
"market.news_merge":"Two carriers merge between {a} and {b}: fewer buyers there.",
|
||||
"market.news_redsea":"Subsea cables are cut: every subsea route is in demand.",
|
||||
"market.no_news":"Quiet so far.",
|
||||
"market.no_room":"no room left: light more capacity",
|
||||
"market.no_routes":"You hold no ready dark fiber yet. Lease or dig some, and its route shows up here.",
|
||||
"market.not_selling":"Not selling",
|
||||
"market.not_yet":"Nobody wants these here yet: {list}.",
|
||||
"market.open":"Lambda Bazaar",
|
||||
"market.p_iru":"Dark pair IRUs",
|
||||
"market.p_iru_d":"A spare pair in a trench you dug: two years of its lease up front, then a little upkeep every month.",
|
||||
"market.p_spec":"Spectrum",
|
||||
"market.p_spec_d":"An alien wave: a channel of your line system, and the buyer brings the optics.",
|
||||
"market.p_w100":"Managed 100G waves",
|
||||
"market.p_w100_d":"Carved out of capacity you lit: they pay more than spectrum, and your own traffic gets that much less.",
|
||||
"market.p_w1600":"Managed 1.6T waves",
|
||||
"market.p_w1600_d":"One wave on a 1.6T optic: the cheapest bit you can sell, and what the biggest buyers want once the years go by.",
|
||||
"market.p_w400":"Managed 400G waves",
|
||||
"market.p_w400_d":"2.7 times the price of a 100G wave for four times the capacity (3.8 times on subsea). AI data centers want them.",
|
||||
"market.p_w800":"Managed 800G waves",
|
||||
"market.p_w800_d":"One wave on an 800G-capable optic. Buyers move to them a few years in, AI data centers first.",
|
||||
"market.price":"{price}/mo · {pct}% of list",
|
||||
"market.price_pair":"{up} up front + {price}/mo · {pct}% of list",
|
||||
"market.route_meta":"{km} km · {ms} ms · fast waves +{n}%",
|
||||
"market.route_off":"Broker leaves it alone",
|
||||
"market.route_on":"Broker trades here",
|
||||
"market.routes":"Your routes",
|
||||
"market.row":"{want} wanted · {sold} sold · {listed} listed",
|
||||
"market.sales":"Capacity you sell",
|
||||
"market.scout":"Routes you could build",
|
||||
"market.scout_d":"Between your POPs, without your fiber yet: what each route wants and where it is heading, the most valuable first.",
|
||||
"market.scout_none":"Build POPs in more cities to see routes between them.",
|
||||
"market.scout_spend":"{km} km · carriers there spend about {v}/mo at today's prices",
|
||||
"market.selling":"Selling",
|
||||
"market.sold_pair":"<b>Your broker sold a dark pair.</b><br>{name} pays {up} up front for {what}, then {price}/mo.",
|
||||
"market.steady":"Steady",
|
||||
"market.tab":"Capacity market",
|
||||
"market.title":"Lambda Bazaar",
|
||||
"market.today":"today",
|
||||
"market.upgraded":"<b>{name} grows.</b><br>Its {n}× {g0} waves on {a}–{b} become {g1}: {price}/mo.",
|
||||
"market.wants_more":"<b>{name} wants to grow</b> from {g0} to {g1} waves on {a}–{b}, but that fiber has no room. Light more capacity, or keep back less.",
|
||||
"meet_a_network.all_n_out_of_reach":{"one":"All {n} out of reach","other":"All {n} out of reach"},
|
||||
"meet_a_network.peer_with_the_tier_1_club":"Peer with the Tier 1 club: their customers come along for free. Only networks in nobody’s customer cone need peering of their own.",
|
||||
"meet_a_network.peer_with_the_tier_1_club_n":{"one":"Peer with the Tier 1 club: their customers come along for free. {n} network already comes along with a peer.","other":"Peer with the Tier 1 club: their customers come along for free. {n} networks already come along with a peer."},
|
||||
|
|
|
|||
|
|
@ -216,3 +216,16 @@ h2 .rn{font-size:18px;vertical-align:middle;padding:2px 4px}
|
|||
/* A phone on its side: the three side by side, so nothing scrolls. */
|
||||
@media (orientation:landscape) and (max-height:500px){.chpick h2{font-size:21px !important}.chpick .tagline{display:none}
|
||||
.chopts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.chopt{flex-direction:column;gap:2px;margin-top:6px;padding:8px 10px}.chi{font-size:22px}.cht span{font-size:12px;line-height:1.3}}
|
||||
/* The capacity market (Lambda Bazaar): a product's bar is what is sold (green) of what the route wants (the line), with
|
||||
your minimum as a pink tick. */
|
||||
.cmset{border-top:1.5px dashed var(--line);padding:8px 0 4px}
|
||||
.cmset .nm{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
||||
.cmset .seg{margin:4px 0 6px}
|
||||
.cmp{margin:6px 0 4px}
|
||||
.cmbar{position:relative;height:9px;border-radius:5px;background:var(--soft);border:1.5px solid var(--line);margin-top:3px;overflow:visible}
|
||||
.cmbar i{position:absolute;left:0;top:0;bottom:0;background:var(--eye);border-radius:4px}
|
||||
.cmbar b{position:absolute;top:-4px;bottom:-4px;width:3px;margin-left:-1.5px;background:var(--ink);border-radius:2px}
|
||||
.cmbar u{position:absolute;top:-5px;bottom:-5px;width:0;margin-left:-1px;border-left:3px dotted var(--me)}
|
||||
.cmroute{align-items:flex-start}
|
||||
.tag.cmhot{background:#FFE1D6;color:#B43A12}
|
||||
.tag.cmcool{background:#DDF1FB;color:#1E6A8C}
|
||||
|
|
|
|||
149
tests/capacity-market.test.js
Normal file
149
tests/capacity-market.test.js
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
// The capacity market, Lambda Bazaar (37-fiber-market.js): products from spectrum to 1.6T waves and dark pairs, demand
|
||||
// that moves and grows, thresholds, managed waves carved out of your own capacity, customers moving up a size, the
|
||||
// Cable broker's fee and forecast, and saves.
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
const start = (ev) => ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip();closeModal();S.cash=1e9;S.lvl=6;S.offers=[];S.biz=[];S.inc=[]");
|
||||
const fiber = (ev, id, a, b, ch = 'tp16', n = 8) => ev(`for(const c of ['${a}','${b}'])if(!S.pops[c])ACT.buildPop({city:c});closeModal();
|
||||
S.links.push({id:'${id}',a:'${a}',b:'${b}',kind:'df',own:true,sys:'cl',ch:Array(${n}).fill('${ch}'),km:Math.round(kmBetween('${a}','${b}')*1.05),ready:0,day:0,cut:0,mo:100,trench:'own:${id}',pairs:1});compute();`);
|
||||
const route = (k) => `cmRoutes().get('${k}')`;
|
||||
|
||||
test('demand moves all the time: its own cycle, noise, and news; a forecast sees the cycle and the news already out', () => {
|
||||
const { ev, errors } = load();
|
||||
start(ev);
|
||||
fiber(ev, 'f', 'fra', 'ams');
|
||||
const hs = JSON.parse(ev(`JSON.stringify(Array.from({length:24},(_, i)=>cmHeat(${route('ams|fra')},'w400',i*15)))`));
|
||||
assert.ok(Math.max(...hs) - Math.min(...hs) > 0.3, `heat over a year: ${Math.min(...hs).toFixed(2)} to ${Math.max(...hs).toFixed(2)}`);
|
||||
assert.ok(hs.every((h) => h >= 0.3 && h <= 2.5));
|
||||
assert.equal(ev(`cmFc(${route('ams|fra')},'w400',30)`), ev(`cmDem(${route('ams|fra')},'w400',S.day+30,true)`));
|
||||
// A cut on a fiber next door is news the next morning, and carriers want routes around it.
|
||||
const before = ev(`cmDem(${route('ams|fra')},'spec',S.day+10)`);
|
||||
// (No other news today: the daily roll for news of its own comes out high.)
|
||||
ev("S.inc.push({id:'cut1',type:'cut',ref:'own:f',until:S.day+5,msg:''});const r0=Math.random;Math.random=()=>0.99;cmShocks(S.day);Math.random=r0");
|
||||
assert.equal(ev('S.cm.news[0].why'), 'cut');
|
||||
assert.ok(ev(`cmDem(${route('ams|fra')},'spec',S.day+10)`) > before * 1.4, 'a cut makes the route around it hot');
|
||||
ev('const r0=Math.random;Math.random=()=>0.99;cmShocks(S.day);Math.random=r0');
|
||||
assert.equal(ev("S.cm.news.filter(n=>n.why==='cut').length"), 1, 'one incident is news once');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('demand grows every year, and buyers move from 100G to 400G, 800G and 1.6T', () => {
|
||||
const { ev, errors } = load();
|
||||
start(ev);
|
||||
fiber(ev, 'f', 'fra', 'ams');
|
||||
ev('S.cm.sh=[]');
|
||||
const gbps = (d) => ev(`CM_W.reduce((a,p)=>a+cmDem(${route('ams|fra')},p,${d},true)*CM_G[p],0)`);
|
||||
assert.ok(Math.abs(ev('cmGrowth(365*5)') - Math.pow(1.15, 5)) < 1e-9, 'about 15% more every year');
|
||||
assert.ok(gbps(365 * 5) > gbps(0) * 1.3, `five years on, carriers want ${Math.round(gbps(365 * 5))} G against ${Math.round(gbps(0))} G`);
|
||||
const sh = (p, d) => ev(`cmShare('${p}',${d})`);
|
||||
assert.ok(sh('w100', 0) > sh('w100', 365 * 4), '100G fades');
|
||||
assert.ok(sh('w1600', 0) < 0.05 && sh('w1600', 365 * 10) > 0.5, '1.6T is rare at first and common ten years on');
|
||||
assert.ok(Math.abs(['w100', 'w400', 'w800', 'w1600'].reduce((a, p) => a + sh(p, 900), 0) - 1) < 1e-9, 'the shares add up');
|
||||
assert.ok(ev('cmGrowth(365*40)') <= 8, 'growth has a ceiling');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('prices: a 400G wave is 2.7 times a 100G one on land and 3.8 on subsea, short straight routes earn more, and floors hold', () => {
|
||||
const { ev, errors } = load();
|
||||
start(ev);
|
||||
fiber(ev, 'f', 'fra', 'ams');
|
||||
const r = route('ams|fra');
|
||||
assert.ok(Math.abs(ev(`cmList(${r},'w400')/cmList(${r},'w100')`) - 2.7) < 1e-9);
|
||||
assert.ok(Math.abs(ev(`(()=>{const x={...${r},sub:true};return cmList(x,'w400')/cmList(x,'w100')})()`) - 3.8) < 1e-9);
|
||||
assert.ok(ev(`cmList(${r},'w1600')/16 < cmList(${r},'w100')`), 'a bit on a 1.6T wave is cheaper than on a 100G one');
|
||||
assert.ok(ev(`${r}.lp`) > ev(`({...${r},lp:0}, cmRoute('ams','fra',[{...S.links.find(l=>l.id==='f'),km:2000}]).lp)`), 'a long detour loses the latency premium');
|
||||
// Each unit sold makes the next cheaper, and the broker never sells below the floor.
|
||||
ev("for(const p of CM_P){S.cm.p[p].on=true;S.cm.p[p].floor=100;S.cm.p[p].min=1;}__reseed(5)");
|
||||
ev('for(let d=0;d<400;d++){S.day++;cmDay(S.day);}');
|
||||
const sales = JSON.parse(ev("JSON.stringify(S.biz.map(b=>({t:b.type,g:b.g||0})))"));
|
||||
assert.ok(sales.length > 0, 'something sold');
|
||||
assert.ok(ev(`(()=>{const rs=cmRoutes(),s=cmSold(rs).get('ams|fra');return CM_P.every(p=>!s[p]||cmIdx(rs.get('ams|fra'),p,s[p]-1,0,S.day)*100>=0)})()`));
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('auto-listing follows the thresholds and the share kept back; managed waves come out of your own capacity', () => {
|
||||
const { ev, errors } = load();
|
||||
start(ev);
|
||||
fiber(ev, 'f', 'fra', 'ams', 'zr4', 8);
|
||||
ev("S.cm.hold=50;S.cm.p.w400.on=true;S.cm.p.w400.min=1;S.cm.p.w400.floor=60;S.cm.p.w800.on=true;S.cm.p.w800.min=1;S.cm.p.w800.floor=60;cmRelist()");
|
||||
const L = () => JSON.parse(ev("JSON.stringify(S.links.find(l=>l.id==='f').list||{})"));
|
||||
assert.ok(L().m4 > 0 && L().m4 <= 4, `half of 3.2T kept back leaves at most four 400G waves (${L().m4})`);
|
||||
assert.equal(L().m8, undefined, 'no 800G wave on 400G optics');
|
||||
ev("S.cm.p.w400.min=16;cmRelist()");
|
||||
assert.equal(L().m4, undefined, 'below the minimum demand the broker takes it off');
|
||||
// A sold managed wave carves its capacity out of your own; when your optics cannot carry it, its customer suffers.
|
||||
ev("const l=S.links.find(x=>x.id==='f');cmSell(l,'w400',2,1000,0);compute()");
|
||||
assert.equal(ev("dfLit(S.links.find(l=>l.id==='f'))-dfCap(S.links.find(l=>l.id==='f'))"), 800);
|
||||
assert.equal(ev("fiberOk(S.biz.find(b=>b.type==='mwave'))"), true);
|
||||
ev("S.links.find(l=>l.id==='f').ch=['zr4']");
|
||||
assert.equal(ev("fiberOk(S.biz.find(b=>b.type==='mwave'))"), false, '400G lit cannot carry 800G sold');
|
||||
ev("ACT.mktCfg({p:'w400',k:'on',v:0})");
|
||||
assert.equal(ev("S.cm.p.w400.on"), false);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a carrier on your glass moves up a size once the next one is common, if there is room', () => {
|
||||
const { ev, errors } = load();
|
||||
start(ev);
|
||||
fiber(ev, 'f', 'fra', 'ams', 'tp16', 8);
|
||||
ev("S.day=365*4;S.cm.hold=0;const l=S.links.find(x=>x.id==='f');cmSell(l,'w400',2,2000,0);compute()");
|
||||
const b0 = JSON.parse(ev("JSON.stringify(S.biz.find(b=>b.type==='mwave'))"));
|
||||
ev("Math.random=()=>0;cmGrow(S.day)");
|
||||
const b1 = JSON.parse(ev("JSON.stringify(S.biz.find(b=>b.type==='mwave'))"));
|
||||
assert.equal(b1.g, 800);
|
||||
assert.ok(b1.rate > b0.rate, `pays more: ${b0.rate} to ${b1.rate}`);
|
||||
assert.equal(ev("dfLit(S.links.find(l=>l.id==='f'))-dfCap(S.links.find(l=>l.id==='f'))"), 1600);
|
||||
// No room: it asks, and does not ask again for half a year (1.6T is common by year 9).
|
||||
ev("S.links.find(l=>l.id==='f').ch=['tp16'];S.cm.hold=50;S.day=365*9;cmGrow(S.day)");
|
||||
const gw = ev('S.biz.find(b=>b.type===\'mwave\').gw');
|
||||
ev('S.day+=30;cmGrow(S.day)');
|
||||
const b2 = JSON.parse(ev("JSON.stringify(S.biz.find(b=>b.type==='mwave'))"));
|
||||
assert.equal(b2.g, 800);
|
||||
assert.equal(gw, 365 * 9);
|
||||
assert.equal(b2.gw, 365 * 9, 'not again a month later');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a Cable broker pays 3% instead of 10% and sees routes it could build with their forecast', () => {
|
||||
const { ev, errors } = load();
|
||||
start(ev);
|
||||
assert.equal(ev('cmCut()'), 0.9);
|
||||
ev("ACT.charter({k:'broker'});closeModal();S.cash=1e9");
|
||||
assert.equal(ev('cmCut()'), 0.97);
|
||||
for (const c of ['fra', 'ams', 'par', 'bru']) ev(`if(!S.pops['${c}'])ACT.buildPop({city:'${c}'});closeModal()`);
|
||||
const sc = JSON.parse(ev('JSON.stringify(cmScout().map(r=>r.k))'));
|
||||
assert.ok(sc.length > 0 && sc.every((k) => k.includes('|')));
|
||||
ev("UI.dtab='market';$('dash').hidden=false;renderDash()");
|
||||
const html = ev("$('dashCard').textContent");
|
||||
assert.match(html, /Lambda Bazaar/);
|
||||
assert.match(html, /Routes you could build/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the market is kept in the save, checked, and old saves get the defaults', () => {
|
||||
const { ev, errors } = load();
|
||||
start(ev);
|
||||
fiber(ev, 'f', 'fra', 'ams');
|
||||
ev("S.cm.hold=10;S.cm.p.w1600.on=true;S.cm.p.w1600.min=2;S.cm.off['ams|fra']=1;cmNews('glut',{k:'ams|fra',a:'ams',b:'fra'},S.day);cmSell(S.links[S.links.length-1],'w800',1,500,0)");
|
||||
ev('const t=JSON.stringify(packSave(S));S=migrate(JSON.parse(t))');
|
||||
const cm = JSON.parse(ev('JSON.stringify(S.cm)'));
|
||||
assert.equal(cm.hold, 10);
|
||||
assert.deepEqual(cm.p.w1600, { on: true, min: 2, floor: 80 });
|
||||
assert.equal(cm.off['ams|fra'], 1);
|
||||
assert.equal(cm.sh[0].why, 'glut');
|
||||
assert.equal(ev("S.biz.find(b=>b.type==='mwave').g"), 800);
|
||||
ev("const o=JSON.parse(JSON.stringify(packSave(S)));o.cm={hold:33,p:{w100:{on:'yes',min:999,floor:-1}},off:{'zzz|ams':1},sh:[{why:'nope'},{why:'dc',c:'atlantis'}],news:'x'};o.biz.find(b=>b.type==='mwave').g=999;o.links.find(l=>l.id==='f').list={m8:'lots',m16:3};S=migrate(o)");
|
||||
const c2 = JSON.parse(ev('JSON.stringify(S.cm)'));
|
||||
assert.equal(c2.hold, 25);
|
||||
assert.deepEqual(c2.p.w100, { on: true, min: 4, floor: 80 });
|
||||
assert.deepEqual(c2.off, {});
|
||||
assert.deepEqual(c2.sh, []);
|
||||
assert.deepEqual(c2.news, []);
|
||||
assert.equal(ev("S.biz.find(b=>b.type==='mwave').g"), 100);
|
||||
assert.deepEqual(JSON.parse(ev("JSON.stringify(S.links.find(l=>l.id==='f').list)")), { w: 0, p: 0, m16: 3 });
|
||||
ev('const o=JSON.parse(JSON.stringify(packSave(S)));delete o.cm;S=migrate(o)');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(S.cm.p.spec)')), { on: false, min: 2, floor: 80 });
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
@ -16,6 +16,8 @@ test('a route\'s market follows the eyeballs at both ends, and a landing town co
|
|||
assert.ok(ev("brMarket('nyc','bde')") > ev("brMarket('nyc','gdx')"));
|
||||
});
|
||||
|
||||
// The market moves (37-fiber-market.js): demand has its own cycle and grows, so days pass here; at its hottest a route
|
||||
// wants CM_HMAX times its usual spectrum.
|
||||
test('a listing sells over time, never past the market, and rent from a road to nowhere stays small', () => {
|
||||
const { ev, errors } = load();
|
||||
start(ev);
|
||||
|
|
@ -23,11 +25,11 @@ test('a listing sells over time, never past the market, and rent from a road to
|
|||
fiber(ev, 'far', 'jed', 'gdx', 9089);
|
||||
ev("__reseed(7);ACT.listFiber({id:'big',w:60});ACT.listFiber({id:'far',w:60})");
|
||||
assert.equal(ev("S.biz.length"), 0, 'nothing sells the moment it is listed');
|
||||
ev('for(let d=0;d<720;d++)brTick()');
|
||||
ev('for(let d=0;d<720;d++){S.day++;brTick();}');
|
||||
const sold = (id) => ev(`S.biz.filter(b=>b.link==='${id}').reduce((a,b)=>a+(b.slots||0),0)`);
|
||||
assert.ok(sold('big') >= 3, `Frankfurt–Amsterdam sold ${sold('big')}`);
|
||||
assert.ok(sold('big') <= ev("brMarket('fra','ams')"), 'never more than the route wants');
|
||||
assert.equal(sold('far'), 1, 'Jeddah–Magadan: one wave, then the market is full');
|
||||
assert.ok(sold('big') <= ev("brMarket('fra','ams')*0.5*CM_HMAX*Math.pow(cmGrowth(S.day),0.7)"), 'never more than the route wants at its hottest');
|
||||
assert.ok(sold('far') >= 1 && sold('far') <= 2, `Jeddah–Magadan: a wave or two, then the market is full (${sold('far')})`);
|
||||
assert.equal(ev("brFree(S.links.find(l=>l.id==='far'))"), 0);
|
||||
// random alien-wave offers respect the market too
|
||||
ev("S.offers=[];for(let i=0;i<400;i++)spawnOffer()");
|
||||
|
|
|
|||
|
|
@ -432,8 +432,11 @@ test('F5: rented capacity never outgrows the route\'s market (#203)', () => {
|
|||
const g = load();
|
||||
g.ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip();S.cash=1e9;S.lvl=4;S.biz=[];S.offers=[];for(const c of ['jed','gdx'])ACT.buildPop({city:c})");
|
||||
g.ev("S.links.push({id:'f',a:'jed',b:'gdx',kind:'df',own:true,sys:'roadm',ch:[],km:9089,ready:0,day:0,cut:0,mo:1,trench:'own:f',pairs:1});compute();__reseed(5);ACT.listFiber({id:'f',w:120,p:1})");
|
||||
g.ev('for(let d=0;d<1500;d++){brTick();if(d%7===0)spawnOffer();}for(const o of S.offers.filter(o=>o.link===\'f\'))ACT.accept({id:o.id})');
|
||||
assert.ok(g.ev("brSold('jed','gdx')") <= g.ev("brMarket('jed','gdx')"), 'F5: no more than the route wants');
|
||||
g.ev('for(let d=0;d<1500;d++){S.day++;brTick();if(d%7===0)spawnOffer();}for(const o of S.offers.filter(o=>o.link===\'f\'))ACT.accept({id:o.id})');
|
||||
// The market moves and grows (37-fiber-market.js): never more than the route wants at its hottest, today.
|
||||
const most = g.ev("Math.max(brMarket('jed','gdx'),Math.round(brMarket('jed','gdx')*0.5*CM_HMAX*Math.pow(cmGrowth(S.day),0.7)))");
|
||||
assert.ok(g.ev("brSold('jed','gdx')") <= most, `F5: no more than the route wants (${g.ev("brSold('jed','gdx')")} of ${most})`);
|
||||
assert.ok(g.ev("brSold('jed','gdx')") <= 3, 'a road to nowhere still sells only a little');
|
||||
assert.deepEqual(g.errors, []);
|
||||
});
|
||||
|
||||
|
|
@ -462,6 +465,26 @@ test('F7: extra crews cut a build on land to half its planned time at most (#203
|
|||
assert.deepEqual(g.errors, []);
|
||||
});
|
||||
|
||||
test('F8: a managed wave costs your own capacity, rides one optic, and is priced against its fiber', () => {
|
||||
const g = load();
|
||||
g.ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip();S.cash=1e9;S.lvl=6;S.biz=[];S.offers=[];for(const c of ['fra','ams'])if(!S.pops[c])ACT.buildPop({city:c})");
|
||||
g.ev("S.links.push({id:'f',a:'fra',b:'ams',kind:'df',own:true,sys:'cl',ch:['zr4','zr4'],km:400,ready:0,day:0,cut:0,mo:1,trench:'own:f',pairs:1});compute()");
|
||||
const r = "cmRoutes().get('ams|fra')";
|
||||
for (const [p, land, sea] of [['w400', 2.7, 3.8], ['w800', 4.6, 6.6], ['w1600', 7.8, 11]]) {
|
||||
assert.ok(Math.abs(g.ev(`cmList(${r},'${p}')/cmList(${r},'w100')`) - land) < 1e-9, `F8: ${p} on land`);
|
||||
assert.ok(Math.abs(g.ev(`(()=>{const x={...${r},sub:true};return cmList(x,'${p}')/cmList(x,'w100')})()`) - sea) < 1e-9, `F8: ${p} on subsea`);
|
||||
}
|
||||
for (let i = 1; i < 4; i++) assert.ok(g.ev(`cmList(${r},CM_W[${i}])/CM_G[CM_W[${i}]]<cmList(${r},CM_W[${i - 1}])/CM_G[CM_W[${i - 1}]]`), 'F8: cheaper per bit');
|
||||
assert.ok(Math.abs(g.ev(`cmList(${r},'spec')/(dfLeaseMo(400)+ampCount(400)*AMP_MO)`) - 0.3) < 1e-9, 'F8: spectrum lists at 30%');
|
||||
for (let d = 0; d < 720; d += 9) { const x = g.ev(`cmIdx(${r},'spec',0,0,${d})`); assert.ok(x >= 0.7 - 1e-9 && x <= 1.35 + 1e-9, `F8: heat moves a price by ${x}`); }
|
||||
assert.equal(g.ev("cmSpare(S.links[S.links.length-1],'w800',0)"), 0, 'F8: no 800G wave on 400G optics');
|
||||
g.ev("cmSell(S.links[S.links.length-1],'w400',1,100,0);compute()");
|
||||
assert.equal(g.ev("dfLit(S.links[S.links.length-1])-dfCap(S.links[S.links.length-1])"), 400, 'F8: it comes out of your own capacity');
|
||||
g.ev("S.links[S.links.length-1].ch=[]");
|
||||
assert.equal(g.ev("fiberOk(S.biz.find(b=>b.type==='mwave'))"), false, 'F8: unlit, its customer is down');
|
||||
assert.deepEqual(g.errors, []);
|
||||
});
|
||||
|
||||
// D1–D4: DDoS as networks see it (#242). tests/ddos-model.test.js plays each one in detail.
|
||||
const ddFra = (ev) => ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip();S.cash=1e9;S.lvl=4;S.nextFail=1e9;S.nextEvent=1e9;ACT.launchBB({city:'fra'});S.pops.fra.bb.d=40;ACT.buyTransit({city:'fra',net:'cog',tier:1});S.pops.fra.rgen=RG.findIndex(r=>r.fsN===8);S.biz.push({id:'g',type:'game',name:'G',city:'fra',bw:10,rate:1,mood:80,since:0,reqs:[]},{id:'d',type:'dia',name:'D',city:'fra',bw:5,rate:1,mood:80,since:0,reqs:[]});compute()");
|
||||
const ddHit = (ev, g) => ev(`S.ev.ddos={id:'x',city:'fra',tgt:'g',vec:'dns',gbps:${g},start:S.day,until:S.day+2,bh:false};compute()`);
|
||||
|
|
|
|||
|
|
@ -1270,7 +1270,10 @@ test('#51 a dark fiber shows what is rented out, and spare capacity can be liste
|
|||
ev("for(let i=0;i<120&&!S.biz.some(b=>b.link==='df1');i++)brTick();renderPanel()");
|
||||
const b = JSON.parse(ev("JSON.stringify(S.biz.find(x=>x.link==='df1'))"));
|
||||
assert.equal(b.type, 'wwave');
|
||||
assert.equal(b.rate, ev(`(()=>{const F=dfLeaseMo(450)+ampCount(450)*AMP_MO,M=brMarket('fra','ams');let r=0;for(let i=0;i<${b.slots};i++)r+=F*WW_SHARE*(1-WW_FALL*Math.min(1,i/M));return Math.round(r*0.9)})()`), 'the alien-wave price, priced against the fiber, minus the broker');
|
||||
// The capacity market prices it (37-fiber-market.js): 30% of the fiber's cost a month, moved by how hot the route is
|
||||
// and how full, minus the broker.
|
||||
assert.equal(b.rate, ev(`(()=>{const r=cmRoutes().get('ams|fra');let x=0;for(let i=0;i<${b.slots};i++)x+=cmList(r,'spec')*cmIdx(r,'spec',0,i,S.day);return Math.round(x*0.9*mkt())})()`), 'the alien-wave price, priced against the fiber, minus the broker');
|
||||
assert.ok(Math.abs(ev("cmList(cmRoutes().get('ams|fra'),'spec')/(dfLeaseMo(450)+ampCount(450)*AMP_MO)") - 0.3) < 1e-9);
|
||||
assert.ok(txt().includes(b.name), 'the customer is listed on the fiber');
|
||||
assert.match(txt(), new RegExp(`Free channels\\s*${62 - b.slots} / 64`));
|
||||
assert.equal(ev("S.links[0].list?S.links[0].list.w:0"), 4 - b.slots, 'the listing shrinks by what sold');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue