view sched/st_schedule.m @ 19:1eb0ea29ec40

Doesn't belong here.
author samer
date Thu, 17 Jan 2013 13:32:19 +0000
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