1 import * as a from "liba.so";
2 function assert(expr) {
7 var ctx = new a.pid_neuro();
8 ctx.set_kpid(10, 1, 0.1, 1);
10 console.log(ctx.run(10, 0));
12 console.log(ctx.inc(10, 0));
14 assert("ctx.k != undefined");
15 assert("ctx.kp != undefined");
16 assert("ctx.ki != undefined");
17 assert("ctx.kd != undefined");
18 assert("ctx.wp != undefined");
19 assert("ctx.wi != undefined");
20 assert("ctx.wd != undefined");
21 assert("ctx.outmax != undefined");
22 assert("ctx.outmin != undefined");
23 assert("ctx.out != undefined");
24 assert("ctx.fdb != undefined");
25 assert("ctx.err != undefined");
26 assert("ctx.ec != undefined");