Skip to main content

Simulator service (Kaleido.Gre.Simulator, :8082)

Real customer data is hard to get and unsafe to experiment on, so the simulator invents customers with personas, makes them play, and keeps the ground truth of what each one was built to like. It has three jobs:

  1. Batch runs: generate a world and post its events to the activity service.
  2. Streams: publish a world to Kafka at a target rate, which also makes it the load generator.
  3. Evaluation: measure the recommender against the ground truth and against a hidden future.

API​

MethodPathPurpose
GET/personasThe six personas
POST/runsStart a batch run: customers (1 to 100,000), days (1 to 365), seed, anchorDate, poolSize (20 to 20,000), taggedOnly
GET/runs, /runs/{id}Progress and counters
POST/streamsStart a stream: adds tps (1 to 200,000), repeat (1 to 1,000), sourceId (ingestion)
GET, DELETE/streamsStatus; stop
GET/customers?persona&after&size, /customers/{id}Ground truth
POST/evaluatePersona fit of the current recommendations on a sample
POST/evaluate/holdoutHidden-future accuracy test with several blends
DELETE/dataForget runs and customers

Determinism​

Generator is pure. A customer depends only on (seed, index, catalogue), and their events on (customer, seed, catalogue, anchor date, days). Each customer gets its own random stream derived from a SplitMix-style hash of seed, index and a salt, so customers can be generated in any order or in parallel, and event ids (NewGuid(rng)) repeat exactly. Re-running the same seed and anchor date adds nothing, because the activity service sees the same ids and counts them as duplicates.

How a customer is generated​

Daily activity then follows these rules:

AspectRule
Sessions per dayPoisson with mean SessionsPerWeek / 7 x activity, x1.4 at weekends, x0.9 on weekdays
Which gameA favourite (weighted 1, 1/2, 1/3...) unless exploring; when exploring, with chance Taste a game tagged like a favourite, else any game by persona weight
Start timeNormal around 20:00 with a 3.5-hour spread
LengthSessionMinutes x log-normal, clamped to 1 to 240 minutes
Roundsminutes x SpinsPerMinute, clamped to 1 to 150
Stake per roundMeanWager x wager level x U(0.5, 1.5), rounded to 0.05 EUR
Payout30% chance; exponential multiplier scaled so the expected return equals the game's RTP
FutureNothing after "now": a run anchored today stops at the current time

Personas​

KeyShareLikesFavouritesExplorationSessions per weekMinutesMean wagerNew-release biasTaste
high-roller-slots8%Slots40.1043580.20.7
casual-slots35%Slots80.352120.40.50.6
table-strategist15%Table games40.1234050.10.6
live-social15%Live casino50.1536030.10.6
explorer17%Anything01.0560.50.30.3
new-release-hunter10%Slots30.5541524.00.4

Game pool​

A whole catalogue spread over a few hundred customers is too thin for patterns, so a world plays a pool (Pool.Choose): every tagged game first, then random untagged games up to poolSize. With taggedOnly, only tagged games. The pool is fetched from /similarity/export, which also supplies each game's tag neighbours for the Taste rule.

Batch run sequence​

Stream sequence​

The publisher is idempotent with acks=all, LZ4 compression, 20 ms linger and a 500,000-message queue. A full queue makes the producer wait, so if Kafka or the consumers cannot keep up, ActualTps drops below TargetTps and shows it.

repeat sends the same events again; they get new offsets, so they are real duplicates and inflate totals. It exists for longer load tests.

Evaluation​

  • /evaluate asks the recommender for a sample of customers and measures type fit (share of recommended games whose type the persona likes), distinct studios, average score and empty lists, overall and per persona.
  • /evaluate/holdout is the honest accuracy test. See Evaluation.