ProgressEvent

sealed interface ProgressEvent

ProgressEvent family

====================

These are the only messages that flow from the solver/model to the outside world. They are intentionally small and transport‑format‑neutral so the model can publish progress without knowing anything about CSV or filesystem details (that’s the View’s job).

Conventions

  • Every event carries:

  • target: BEST | WORST | AVERAGE (so the consumer can route to the right files)

  • threadName: purely informational; useful to keep logs readable

  • Typical controller routing:

when (ev) {
is CardinalityResult -> view.appendCardinality(model, ev)
is TopKReplaceBatch -> view.replaceTopBatch(model, ev.blocks)
is RunCompleted -> view.closeStreams(model)
}
  • CardinalityResult:

  • AVERAGE: exactly once per K (1..#topics)

  • BEST/WORST: only when the per‑K representative improves in that generation

  • functionValuesCsvLine and variableValuesCsvLine are already in the jMetal style expected by the sink; the View appends them and keeps a buffer to globally sort & rewrite on close

  • TopKReplaceBatch:

  • Emitted once per generation (and once at the very end)

  • Contains the set of K blocks whose content changed

  • Each K maps to exactly 10 pre‑sorted CSV lines (by correlation ASC)

  • The View overwrites the entire -Top file with all known blocks ordered by K

  • RunCompleted:

  • Signals end‑of‑stream so the View can close writers and perform the final global sort & rewrite of -Fun/-Var

Inheritors

Properties

Link copied to clipboard
abstract val target: String

Logical target bucket: BEST, WORST, or AVERAGE.

Link copied to clipboard
abstract val threadName: String

Originating thread name (informational for logs).