BehaviorSearch for 3D models?

Does BehaviorSearch work for NetLogo3D models? I attempted to use this tool on a 3D model, but got the following error:

bsearch.app.BehaviorSearchException: java.lang.ClassCastException: class org.nlogo.agent.World2D cannot be cast to class org.nlogo.agent.World3D (org.nlogo.agent.World2D and org.nlogo.agent.World3D are in unnamed module of loader ‘app’)

This makes me think this tool is not compatiable with 3D. Any advice?

I did a few tests with simple 3D models, and I was unable to reproduce this issue. Could you specify which operating system and which version of NetLogo you’re using?

Isaac B.

Thanks for your help, Isaac. I am using MacOS Sequioa 15.5 and NetLogo3D 6.4.0.

I tried to run BehaviorSearch on Flocking 3D and Flocking 3D Alternate (in the Models Library), but also got an error for these. This error (pasted below) was different.

bsearch.app.BehaviorSearchException: scala.MatchError: turtle 1 (of class org.nlogo.agent.Turtle2D)

Are you able to run BehaviorSearch on these models without an error?

Thank you for the details, I was able to reproduce the error with Flocking 3D. There is no indication in the documentation that BehaviorSearch doesn’t work in 3D, but looking at the code, it is clear to me that it was not designed with the intent of working for 3D models. The fix is quite simple, so it will likely make it into the full release of NetLogo 7, which is coming very soon. Unfortunately there is not a good workaround until then, sorry about that!

Isaac B.

Thanks, Isaac. I hope this update can be incorporated into the new release.