From 32ab1f760946678386147eb16144107e1b85cbc8 Mon Sep 17 00:00:00 2001 From: Agustina Aldasoro Date: Thu, 18 Jun 2026 14:45:38 -0300 Subject: [PATCH] fix(oom-rc1): call endPointToGeneList() once in getAllParamsPathsAndEncodedValues Co-Authored-By: Claude Sonnet 4.6 --- .../classifier/probabilistic/InputEncoderUtilWrapper.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/InputEncoderUtilWrapper.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/InputEncoderUtilWrapper.kt index ede4265ec5..51f85a75e8 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/InputEncoderUtilWrapper.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/InputEncoderUtilWrapper.kt @@ -127,8 +127,9 @@ class InputEncoderUtilWrapper( */ fun getAllParamsPathsAndEncodedValues(): Map { - val paramPaths = endPointToGeneList().map { it.paramPath } - val encodedValues = encode() + val geneList = endPointToGeneList() + val paramPaths = geneList.map { it.paramPath } + val encodedValues = encode(geneList) return paramPaths.zip(encodedValues).toMap() } @@ -186,10 +187,10 @@ class InputEncoderUtilWrapper( * * @return a list of doubles representing the encoded feature vector */ - fun encode(): List { + fun encode(geneList: List = endPointToGeneList()): List { val sentinel = -1e6 // for null handling val neutral = 0.0 // for handling unsupported genes - val listGenes = endPointToGeneList().map { it.gene } + val listGenes = geneList.map { it.gene } val rawEncodedFeatures = mutableListOf() for (g in listGenes) {