annotate 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 |
|
rev |
line source |
samer@10
|
1 % st_schedule - Make state-threading event action from state transformer and state
|
samer@10
|
2 %
|
samer@10
|
3 % st_schedule ::
|
samer@10
|
4 % timed_action({A},{time,A}) ~'the action to perform at each time',
|
samer@10
|
5 % time ~'time of first event',
|
samer@10
|
6 % A ~'initial state'
|
samer@10
|
7 % -> schedule.
|
samer@10
|
8
|
samer@10
|
9 function sch0=st_schedule(action,t0,s0)
|
samer@10
|
10 if isempty(s0), sch0={};
|
samer@10
|
11 else sch0={t0,@act}; end
|
samer@10
|
12
|
samer@10
|
13 function [err,sch1]=act(t_sched)
|
samer@10
|
14 [err,t1,s1]=action(t_sched,s0);
|
samer@10
|
15 sch1=st_schedule(action,t1,s1);
|
samer@10
|
16 end
|
samer@10
|
17 end
|