Skip to content

Triggers #19

@jmorris335

Description

@jmorris335

Triggers are when the value of one node is based off of the value of another node switching. This can be thought graphically as the following: $f := (A_i, A_{i-1}) \rightarrow B$ for $f = A_i \neq A_{i-1}$ (or something similar), and $g := (C, B) \rightarrow C$ for $g = c' \text{ if } B \text{ else } C$, for some specified constant $c'$. The point is that $B$ becomes the value indicating whether $A$ switches states between cycle indices. This is a valid node, and can be implemented using normal methods.

However, this happens frequently enough that it might be useful to have prescribed methods for it. Certainly there should be some kind of relation given of the following form:

def Rtrigger(trig, prev_trig, switch_val, val):
     switched = trig != prev_trig
     if switched:
          return switch_val
      return val

But it might be even more useful to describe a pseudo-node method that allows you to calculate $B$ directly. For instance, right now trig and prev_trig are different nodes. To implement them you need to create an edge making them the same value, and then add a index_via method that constrains them to be one index offset from each other. This is messy and slow. I assume that when we solve #6 this can be addressed because we can pass the same node twice, though the index_via method remains.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions