NetLogo icon indicating copy to clipboard operation
NetLogo copied to clipboard

Breed Equality optimization

Open mrerrormessage opened this issue 8 years ago • 1 comments

Consider a model with the breed ts. The code count turtles with [breed = ts] will be quite fast while the code count turtles with [breed = turtles] will be slow by comparison. This only happens when the breed comparison is made against the breed and the agents are breeded agents.

This has to do with the way agentsets are compared. In the general case, we like the way agentsets are compared. In this particular case, we have additional knowledge about the particulars and would like to be able to use that knowledge to enhance the speed of the procedure. This optimization can and should be considered for NetLogo Web as well.

mrerrormessage avatar May 30 '17 15:05 mrerrormessage

yes, agreed.

—Uri

Uri Wilensky

On May 30, 2017, at 10:56 AM, Robert Grider [email protected] wrote:

Consider a model with the breed ts. The code count turtles with [breed = ts] will be quite fast while the code count turtles with [breed = turtles] will be slow by comparison. This only happens when the breed comparison is made against the breed and the agents are breeded agents.

This has to do with the way agentsets are compared. In the general case, we like the way agentsets are compared. In this particular case, we have additional knowledge about the particulars and would like to be able to use that knowledge to enhance the speed of the procedure. This optimization can and should be considered for NetLogo Web as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_NetLogo_NetLogo_issues_1411&d=DwMCaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=3MqBF7qr0NcLDqkRmbayrNl8ngBdhnLx94XK9q7mwRU&m=YRJkx0cCbyrEF_gyLj_VsED8wyOhtUJhlbW50bsV9Qs&s=wqzuQm5UhckbGUvIEFcAeN596dzwKASDY1oG0iKCYlE&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AGMgwZj2ZQiC7gHsa-2DVeu-5F3eL-5FiJbgjeks5r-5FDwSgaJpZM4Nqf7S&d=DwMCaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=3MqBF7qr0NcLDqkRmbayrNl8ngBdhnLx94XK9q7mwRU&m=YRJkx0cCbyrEF_gyLj_VsED8wyOhtUJhlbW50bsV9Qs&s=COSG0V_eJ2yqCPnBIgTzSTk8KKYYZ0vOFhSEwT-7Nrg&e=.

UriCCL avatar May 30 '17 16:05 UriCCL