1 USING: arrays generic kernel math models models.compose
2 namespaces sequences assocs accessors tools.test ;
5 TUPLE: model-tester hit? ;
7 : <model-tester> model-tester new ;
9 M: model-tester model-changed nip t >>hit? drop ;
11 [ T{ model-tester f t } ]
13 T{ model-tester f f } 3 <model> 2dup add-connection
17 3 <model> "model-a" set
18 4 <model> "model-b" set
19 "model-a" get "model-b" get 2array <compose> "model-c" set
21 "model-c" get activate-model
22 [ { 3 4 } ] [ "model-c" get value>> ] unit-test
23 "model-c" get deactivate-model
25 T{ model-tester f f } "tester" set
27 [ T{ model-tester f t } { 6 4 } ]
29 "tester" get "model-c" get add-connection
30 6 "model-a" get set-model