INNER CODE UNIT · JavaScript

fatigueMultiplier

figranium/figranium · src/agent/figranite/index.js:322

            const fatigueMultiplier = fatigue ? 1 + (actionIdx * 0.1) : 1;
            const microPause = fatigue && Math.random() < 0.08 ? randomBetween(120, 480) : 0;
            return ((ms + Math.random() * 140) * fatigueMultiplier) + microPause;
        };

        const { startToEnd, startToElse, elseToEnd, endToStart } = buildBlockMap(actions);
        const repeatState = new Map();
        const foreachState = new Map();
        let errorHandler = null;
        let inErrorHandler = false;

        const setLoopVars = (item, index, count) => {
            runtimeVars['loop.index'] = index;
            runtimeVars['loop.count'] = count;
            runtimeVars['loop.item'] = item;
            if (item && typeof item === 'object') {
                if ('text' in item) runtimeVars['loop.text'] = item.text;
                if ('html' in item) runtimeVars['loop.html'] = item.html;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…