aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-04-30 23:58:57 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-30 23:58:57 +0200
commitb613c828a7114a2747fb1d5aaca187e3d73da1d2 (patch)
tree3a2ea1e44b64580fb506a9aac86fa3fdc26818c1 /src
parent4273702bd6a865c13bf02a00388440ae4163ee76 (diff)
generalize variable DEMO_VARIABLES
Diffstat (limited to 'src')
-rw-r--r--src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java
index 9ef75cf..54dbd5d 100644
--- a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java
+++ b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java
@@ -28,6 +28,9 @@ import com.example.portfolio3.Vertex;
/// @see <https://moodle.ruc.dk/mod/assign/view.php?id=523186>
public final class Graph {
+ /// amount of iterations in demo
+ private static final int DEMO_ITERATIONS = 1000000;
+
/// data about combinations as a Graph
private AbstractGraph g;
@@ -217,11 +220,11 @@ public final class Graph {
/// loop through random combinations of sets of modules
///
/// @param g sets of disjoint choices as a graph
- /// @return best path out of a hundred shuffles
+ /// @return best path among many random ones
public static int goodSolution(final AbstractGraph g) {
// number higher than total students
int bestPathCost = Integer.MAX_VALUE;
- for (int i = 0; i < 10000; i++) {
+ for (int i = 0; i < DEMO_ITERATIONS; i++) {
int cost = solution(g);
if (cost < bestPathCost) {
// store shortest path