Re: Curt's Nets




Curt Welch wrote:

[...]

> If input == 1 then
> current_gap = currentTime - timeStamp
> If current_gap > threshold_gap then
> threshold_gap = threshold_gap + 0.01 * 3
> output1 = 1
> output2 = 0
> Else
> threshold_gap = threshold_gap - 0.01 * 2
> output1 = 0
> output2 = 1
> End If
> timeStamp = currentTime
> End If
>
>
> That will cause the threshold_gap to seek a value such that the number of
> times output2 is used will on average be 1.5 times more than output1.
>
> You can see how this works because if threshold_gap is set to a value which
> splits the set of all pulses in half, then each pulse sent to output1 will
> cause the gap to move 3 "steps". But each pulse sent to output2 makes it
> moves 2 "steps" in the other direction. With an even number of pulses
> going out both directions, the output1 adjustment will be "winning" by a
> factor of 3 to 2 causing the threshold_gap to drift in the direction which
> makes output1 happen less. It will keep winning until the threshold_gap is
> pushed to the point that output 2 happens 1.5 times more often than output1
> at which time the two adjustments will become a net wash and the threshold
> gap value will stay in that same range.
>
> You could call threshold_gap something like median_gap or
> biased_median_previous_gaps or just previous_gaps but just calling it
> "previous_gap" makes it sound to me like it's simply the last gap value
> which it is not.


Right, I've got it now. Indeed left to itself the
node does eventually output with the given ratio.
You really have two variables that can be adjusted.
The ratio values and the multiplier (the 0.01 value
in the above example).

JC

.