Increaseing speed of searching/operating multiple elements

Case number:671071-2009506
Topic:Game: Other
Opened by:marsfan
Opened on:Monday, April 20, 2020 - 19:17
Last modified:Tuesday, April 21, 2020 - 03:10

My apologies if something like this has been asked for before, I did not see anything recent in the suggestions page.

I just started teaching myself scripting a few days ago, and discovered that operations that run across the entire structure can take a long time because their operations require being done in a for loop.
A couple examples I can think of:

  • Determining which parts of the structure are selected require looping across the entire structure and finding the selected elements.
  • Changing the strength of multiple bands requires looping through them and setting strength individually

The core issue with this is that there is no way to query for all elements that fit a specific criteria, or specify a set of elements to operating on. This could be solved by allowing users to query for a list of elements with specific parameters, or to pass a list of elements to operate on.
Below are examples of using a list based system that would (in theory), speed up the examples I mentioned above

  • A listof all segments that are currently selected could be queried with structure.getCurrentlySelected()
  • The strength of a specfic set of bands could be set by passing a list of the bands to adjust, for example: band.setStrength({1, 2, 3}, 5} would set bands 1, 2, and 3 to have a strength of 5.

I have never used LUA before, so I do not know if it is actually possible to perform operations like this with LUA, but I feel that this would allow for faster scripts, and cleaner code than what we currently have to work with.

(Mon, 04/20/2020 - 19:17  |  1 comment)

agcohn821's picture
User offline. Last seen 6 hours 56 min ago. Offline
Joined: 11/05/2019
Groups: Foldit Staff

Hey Marsfan! I have sent your question along to the team! Thank you!


Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, Boehringer Ingelheim, RosettaCommons