You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Magicbot programs have some boilerplate involved with variables that get reset at the end of each execute loop. An idea I have is to mark some variables to be reset to defaults at the end of each loop.
Notionally, a component using this functionality would look like this:
I imagine the implementation would be similar to how tunable is implemented: an object is stored on the class, and then at initialization time the object is switched with the default value. At the end of every loop, the defaults are placed. I imagine an efficient implementation would just store a per-class dictionary, and then do component.__dict__.update(defaults).
Haven't decided on a name for the marker yet. Some proposals were:
magicreset
magicdefault
magicDefaultTo
magic_reset_to
will_reset_to
magic_loop_var
Other proposals accepted!
The text was updated successfully, but these errors were encountered:
Magicbot programs have some boilerplate involved with variables that get reset at the end of each execute loop. An idea I have is to mark some variables to be reset to defaults at the end of each loop.
Notionally, a component using this functionality would look like this:
I imagine the implementation would be similar to how tunable is implemented: an object is stored on the class, and then at initialization time the object is switched with the default value. At the end of every loop, the defaults are placed. I imagine an efficient implementation would just store a per-class dictionary, and then do
component.__dict__.update(defaults)
.Haven't decided on a name for the marker yet. Some proposals were:
Other proposals accepted!
The text was updated successfully, but these errors were encountered: