From 43578d0b5b2e8fff413f074b17d30bef948eec20 Mon Sep 17 00:00:00 2001 From: Joachim Date: Fri, 24 Aug 2018 22:31:17 +0200 Subject: [PATCH] added some javadoc to explain edgemodelfacotry --- src/main/kotlin/be/nielandt/CrossSolver.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/be/nielandt/CrossSolver.kt b/src/main/kotlin/be/nielandt/CrossSolver.kt index c2d15b5..804df56 100644 --- a/src/main/kotlin/be/nielandt/CrossSolver.kt +++ b/src/main/kotlin/be/nielandt/CrossSolver.kt @@ -127,6 +127,13 @@ fun allCrossMoveCountUpgraded(edgeModel: EdgeModel): Map> { return moveCounts } +/** + * This thing helps us to create edgemodels using a counter. The advantage is that the edgemodel doesn't need to be calculated + * completely from scratch: previous states are kept, so if, e.g., the third digit changes in the counter (of length 5), + * the previous state that was calculated using the first two states is used to perform move 3,4,5 on. + * + * This is probably equivalent to 8 nested for loops, you'd be able to keep track of temporary solutions there too.... + */ class EdgeModelFactory(val original: EdgeModel, val counter: Counter) { // keep a modified version of the edgemodel for each digit in the counter, from left to right private val history: MutableList = mutableListOf()