foldPenaltyMemory

fun foldPenaltyMemory(newObservations: ResponseMap, priorMemory: Map<String, PenaltyMemory>, iteration: Int): Map<String, PenaltyMemory>(source)

Folds a visit's new observations into the penalty memory carried by a solution, for each response constraint whose bound penalty uses memory. Returns the penalty-memory map to stamp on the resulting solution: priorMemory carried forward with each memoryful response constraint's entry updated by its penalty's foldVisit over the new observations. A problem with no memoryful penalty (the common case) returns priorMemory unchanged, so memoryless evaluation is unaffected.

Only response (stochastic) constraints are folded: their observations can be standardized, whereas deterministic constraints have exact violations and carry no memory.

Parameters

newObservations

the freshly simulated batch's responses — the new observations obtained at this visit, not the merged cumulative responses

priorMemory

the memory carried by the solution being revisited; empty on a first visit

iteration

the current evaluation iteration