After I evaluate the following dynamic expression I encounter an unexpected behavior:
DynamicModule[{c, t, main, f},
Manipulate[
ControlActive[{x, y}, main[x, y]],
{{x, c/2, "n1"}, 1, y - c, 1},
{{y, n - c/2, "n2"}, x + c, n, 1},
SynchronousUpdating -> False,
Initialization :> (
n = 300;
c = 100;
main[x_, y_] := main[x, y] = f[x, y];
)
]
]
When this expression is evaluated from a new kernel, the output without having touched any of the sliders is as follows:
Notice how the value of y
(labeled "n2"
) is as expected and integer (250
).
After using the second slider (which manipulates dynamic variable y
) I get something like:
Notice how now the value of y
is not an integer.
Can someone please explain to me what am I doing wrong and/or suggest a workaround?
ps. this is related to this question of mine.
n
is itself bug-prone. E.g. tryn = 10; ...<OP's code>
. $\endgroup$TimeSeries
in the actual application of the code (please, see linked question) $\endgroup$