diff --git a/src/vault/gear/load-controller.hpp b/src/vault/gear/load-controller.hpp index e70d2f5f5..14a977e47 100644 --- a/src/vault/gear/load-controller.hpp +++ b/src/vault/gear/load-controller.hpp @@ -95,6 +95,7 @@ namespace gear { using lib::time::Time; using lib::time::FSecs; + using lib::time::TimeVar; using lib::time::Offset; using lib::time::Duration; using std::chrono_literals::operator ""ms; @@ -126,6 +127,8 @@ namespace gear { { BlockFlowAlloc& allocator_; + TimeVar tendedHead_{Time::ANYTIME}; + public: explicit LoadController (BlockFlowAlloc& blockFlow) @@ -134,18 +137,25 @@ namespace gear { /** + * did we already tend for the indicated next head time? * @note const and non-grooming */ bool - tendedNext() const + tendedNext (Time nextHead) const { - UNIMPLEMENTED ("Predicate to determine if next foreseeable Activity was tended for"); + return nextHead == tendedHead_; } + /** + * Mark the indicated next head time as tended. + * @remark while this is just implemented as simple state, + * the meaning is that some free capacity has been directed + * towards that time, and thus further capacity go elsewhere. + */ void - tendNext() + tendNext (Time nextHead) { - UNIMPLEMENTED ("tend for the next foreseeable Activity"); + tendedHead_ = nextHead; } enum diff --git a/tests/vault/gear/scheduler-load-control-test.cpp b/tests/vault/gear/scheduler-load-control-test.cpp index 4d4a14abc..b131e38e7 100644 --- a/tests/vault/gear/scheduler-load-control-test.cpp +++ b/tests/vault/gear/scheduler-load-control-test.cpp @@ -65,6 +65,7 @@ namespace test { { simpleUsage(); classifyTimings(); + tendNextActivity(); walkingDeadline(); setupLalup(); } @@ -94,9 +95,6 @@ namespace test { void classifyTimings() { - BlockFlowAlloc bFlow; - LoadController ctrl{bFlow}; - Time next{0,10}; Time ut{1,0}; @@ -121,6 +119,46 @@ namespace test { + /** @test verify the mark for _tended next head_ Activity. + * @todo WIP 10/23 ✔ define ⟶ ✔ implement + */ + void + tendNextActivity() + { + BlockFlowAlloc bFlow; + LoadController lctrl{bFlow}; + + Time t1{1,0}; + Time t2{2,0}; + Time t3{3,0}; + + CHECK (not lctrl.tendedNext (t2)); + + lctrl.tendNext (t2); + CHECK ( lctrl.tendedNext (t2)); + CHECK (not lctrl.tendedNext (t3)); + + lctrl.tendNext (t3); + CHECK ( lctrl.tendedNext (t3)); + + // However — this is not a history memory... + CHECK (not lctrl.tendedNext (t1)); + CHECK (not lctrl.tendedNext (t2)); + CHECK ( lctrl.tendedNext (t3)); + + lctrl.tendNext (t1); + CHECK ( lctrl.tendedNext (t1)); + CHECK (not lctrl.tendedNext (t2)); + CHECK (not lctrl.tendedNext (t3)); + + lctrl.tendNext (t2); + CHECK (not lctrl.tendedNext (t1)); + CHECK ( lctrl.tendedNext (t2)); + CHECK (not lctrl.tendedNext (t3)); + } + + + /** @test TODO * @todo WIP 10/23 🔁 define ⟶ implement */ diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index c2f57bc88..495994ff6 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -82507,95 +82507,83 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - - + + + + + + + + + + - - - +

sent to work

- -
+
- - - +

reserved for next task

- -
+
- - - +

awaiting imminent activities

- -
+
- - - +

capacity for active processing required

- -
+
- - - +

typical stable work task rhythm expected

- -
+
- - - +

time to go to sleep

- -
+
@@ -82632,14 +82620,16 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+
- - + + +
@@ -87575,6 +87565,21 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + + + + + + + +