From dfffa590945289c3ad48c8f987bffc6ad2b7d1e5 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Thu, 6 Nov 2025 22:27:09 -0500 Subject: [PATCH] estimation started --- graph/graph.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/graph/graph.js b/graph/graph.js index a1bd1cf..9a9bd74 100644 --- a/graph/graph.js +++ b/graph/graph.js @@ -227,7 +227,11 @@ const Scan =(desk, pass)=> let makeMin = Infinity; let needMax = -Infinity; - + + // added for estimation + let estMin = Infinity; + let estMax = -Infinity; + let estSum = 0; /* @@ -260,6 +264,13 @@ Loop parts: } if(time > needMax) needMax = time; + + // estimation + if(time < estMin) estMin = time; + const projectedTime = time + desk.time[i]; + estSum += desk.time[i]; + if(projectedTime > estMax) estMax = projectedTime; + if(!time) emptyNeed.push(i) } @@ -290,5 +301,14 @@ Loop parts: if(time > makeMin) dirtyNeed.push(i); } + if(estMax > estSum) + { + // use estMax + } + else + { + // use estSum + } + desk.pass.set(pass, {need_dirty:dirtyNeed, make_dirty:dirtyMake, need_empty:emptyNeed, make_empty:emptyMake}) }; \ No newline at end of file