samer@10: % st_schedule - Make state-threading event action from state transformer and state samer@10: % samer@10: % st_schedule :: samer@10: % timed_action({A},{time,A}) ~'the action to perform at each time', samer@10: % time ~'time of first event', samer@10: % A ~'initial state' samer@10: % -> schedule. samer@10: samer@10: function sch0=st_schedule(action,t0,s0) samer@10: if isempty(s0), sch0={}; samer@10: else sch0={t0,@act}; end samer@10: samer@10: function [err,sch1]=act(t_sched) samer@10: [err,t1,s1]=action(t_sched,s0); samer@10: sch1=st_schedule(action,t1,s1); samer@10: end samer@10: end