// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Age waiting jobs to prevent starvation // Not compiled or tested in-world // Setup: Place in a spare owned prim. Edit paired base priorities and waiting ages. Owner touch runs the local demonstration. // Stop / restore: Disable/remove. No external requests or scene changes occur; reset clears memory. // Notes: One scheduling decision is simulated. The age multiplier determines fairness versus original priority; ties keep the earliest job. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Local owner-only protocol laboratory. list LABELS=["urgent-new","old-low","routine"]; list PRIORITY=[9,2,5]; list AGE=[0,8,2]; integer AGE_WEIGHT=1; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer n=llGetListLength(LABELS); if(n==0||n!=llGetListLength(PRIORITY)||n!=llGetListLength(AGE)) { llOwnerSay("Mismatched tables."); return; } integer best=-1; integer bestScore=-2147483647; integer i; for(i=0;i