🧮 MATLAB THAUMATURGY DIFFICULTY: Adept Behavioral

The State of Phase Transitions

Allow an algorithm to alter its behavior when its internal phase shifts.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Divination // Phases
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// MATLAB PATTERN //
classdef (Abstract) ComputationState
    methods (Abstract)
        process(obj, context, data)
    end
end

classdef SolidState < ComputationState
    methods
        function process(obj, context, data)
            disp('Processing in Solid State: Deterministic logic.');
            if norm(data) > 100
                context.setState(LiquidState());
            end
        end
    end
end

State

The algorithm melts from solid deterministic logic into a fluid stochastic approach as its mana threshold is crossed.

Runic Tags: #state #phases #algorithms