Add method for "linking" compute nodes together

just smol standard things
This commit is contained in:
hppeng 2022-05-21 21:19:43 -07:00
parent 958017fc5c
commit 1c4042325d

View file

@ -24,7 +24,7 @@ class ComputeNode {
* Request update of this compute node. Pushes updates to children. * Request update of this compute node. Pushes updates to children.
*/ */
update(timestamp) { update(timestamp) {
if (timestamp < this.update_time) { if (timestamp <= this.update_time) {
return; return;
} }
this.update_time = timestamp; this.update_time = timestamp;
@ -52,6 +52,11 @@ class ComputeNode {
compute_func() { compute_func() {
throw "no compute func specified"; throw "no compute func specified";
} }
link_to(parent_node) {
this.inputs.push(parent_node)
parent_node.children.push(this);
}
} }
/*** /***