view sched/st_schedule.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents f7fb679637ff
children
line wrap: on
line source
% st_schedule - Make state-threading event action from state transformer and state
%
% st_schedule ::
%    timed_action({A},{time,A}) ~'the action to perform at each time',
%    time ~'time of first event',
%    A    ~'initial state'
% -> schedule.

function sch0=st_schedule(action,t0,s0)
	if isempty(s0), sch0={};
	else sch0={t0,@act}; end

	function [err,sch1]=act(t_sched)
		[err,t1,s1]=action(t_sched,s0);
		sch1=st_schedule(action,t1,s1);
	end
end