I’ve reported in the netlogo-devel google group and another user has replied to that post recently. Is there an improved file for the Mathematica Link functionality that could be posted to the git repository or somewhere else?
Hi Christopher,
What operating system are you using? The Google Groups discussion suggests that the issue might be Mac-specific. It works for me in NetLogo 6.4.0 on Windows, using the following commands:
<<NetLogo`
NLStart["C:/Program Files/NetLogo 6.4.0"]
Isaac B.
Ah, that’s interesting to hear that it works for 6.4.0 on Widows. Like the recent replier to my earlier message in the Google Groups thread, I’m using Mac OS. Though, for previous versions of NetLogo it was a fix on their side. So, I’ll mke sure to send a message to the pinned email in this group, too.
Could you let me know if the attached file works? I made a change that I believe should fix the bug. Note that you will need to change the extension back to .m, because I had to change it to .txt to upload it here.
Isaac B.
NetLogo.txt (13.6 KB)
Yes, it works! I also ran through the full tutorial to check up on its functionality, with Wolfram—the application previously known as Mathematica—version 14.2.1.
It may be necessary to quit and restart Wolfram. It seemed to lock up when I went straight from File … Install to executing the <<NetLogo` command, but everything was fine afer quitting and re-opening the tutorial workbook.
Great, I’ll add the fixed script to the GitHub repository for Mathematica-Link. You can download it now, but it will also be packaged with the upcoming beta release of NetLogo 7.
Isaac B.
Thanks for getting this working! You’ve likely already tested it with NetLogo 7, but given past history I’d recommend making sure before it goes out. Also (if you haven’t already) modifying the text in the tutorial workbook. Regardless, this is great!
Yes, I’ve tested it on the latest development branch of NetLogo 7. Thanks for the heads up about the language in the tutorial workbook, it will get updated sometime before the next release.
Isaac B.
It appears NetLogo 7.0.0 isn’t working with the Mathematica link. After reinstalling the NetLogo.m file downloaded from GitHub (which needed to be done after upgrading to Wolfram a.k.a. Mathematica 14.3.0.0), executing <<NetLogo` followed by executing NLStart, and then navigating to the 7.0.0 folder, I got the error in the attached file.
NegLogo7betaMma.txt (3.3 KB)
[Note, too, that the Mathematica tutorial workbook delivered with NetLogo 7.0.0 still refers to NetLogo 6.2.0, so changing that appears not to have made it into the release, nor has the new NetLogo.m file. Maybe that’s just as well!]
Hi Christopher,
I’m sorry for the continued troubles with Mathematica Link, it’s not particularly well-maintained, and it’s tricky to test it. However, based on the stack trace you sent, I don’t think this is a bug with Mathematica Link, but rather in the main NetLogo application. Are you able to reproduce a similar issue by launching the application in other ways, or does it only happen when launching with Mathematica Link?
Isaac B.
Interesting! And thanks for the quick reply.
I have not used 7.0.0 other than in the way I’ve described in this thread, and I’m not sure what you mean by launching the application in other ways. Just running it? Using Java to run it?
To that point, at the beginning of this semester I asked students in my class that uses agent-based models to work through the NetLogo User Manual’s introduction (Party Model) and Tutorials (Wolf-Sheep, Traffic). They experienced crashes on a variety of machines using 7.0.0 beta, so I had them go to the web page with older versions to get 6.4.0.
So are you saying that there are general problems with this release? It’s still beta, and yet is the only version shown on the main web page?
NetLogo 7 is no longer in beta, and the full version is available at netlogo.org. There will always be more bugs to discover, but we certainly wouldn’t expect to see complete crashes on startup at this point. Unfortunately, I am also able to reproduce this issue, on a Windows computer. But here’s something strange I noticed:
No matter what I type in the path argument for NLStart, it launches NetLogo 7. Same for the 6.4 version of NetLogo.m, no matter what I type in the path argument for its NLStart, it launches NetLogo 6.4. So, clearly something has been messed up about this script for a while, and I have a feeling that it’s trying to launch NetLogo in an incorrect way. Let me know if this happens for you as well, or if you’re able to launch (or at least begin the launch process) other versions of NetLogo using different path arguments.
Isaac B.
Understood as regards bugs and any software. I appreciate the new features described in the version 7 release, too!
[I still don’t know what you mean about having a problem launching the application in other ways, but that’s what got me thinking about those crash experiences the students had. I’ll move on to trying out what you’ve asked me to do with Mathematica and we can focus on that.]
When you say the 6.4 version of NetLogo.m, I’m assuming that you mean the version on GitHub, not the one delivered with the 6.4.0 download. (But you’ll see, too, that I’m not sure this is relevant — though I’m not at all the expert here!)
You’ll need to try this yourself (I’m not sure I’ve kept careful enough track of it all nor been clear enough in the description below) but …
- The behavior you’re describing seems to be happening with the NetLogo.m file from 6.2.2, as well: When I install that package, and then use NLQuit[ ] and NLStart[ ] with its argument indicating a different pre-6.4.0 version, it just loads 6.2.2.
- Here’s the key: If I quit the Mma kernel and then run <<NetLogo` again, with for example 6.1.1, then it’s stuck on 6.1.1. The same is true for the GitHub or 7.0.0 version of NetLogo.m. So, what you’ve identified appears to only be true when under the same kernel run of <<NetLogo`.
- This issue with the argument of NLStart[ ] may thus be nothing new with 6.4.0 or 7.0.0. It’s just that the NetLogo.m file on GitHub needs to be installed to be able to see 6.4.0 and 7.0.0. (I’ve noticed before that NLQuit[ ] doesn’t clear things out as well as quitting the Mma kernel does.)
- What’s special about 7.0.0 is that once it’s found by Mathematica (after installing either the GitHub version of NetLogo.m or the one downloaded with 7.0.0), it gives the NetLogo Startup Error that I attached to my previous message. That error does not occur when I install the NetLogo.m file downloaded with 7.0.0 but use 6.4.0 with NLStart[ ].
I don’t know much about the code behind any of this, so it could easily be that this issue with the argument of NLStart[ ] tells you something about the NetLogo Startup Error that escapes me. It seems to me to be a separate issue, though.
They experienced crashes on a variety of machines using 7.0.0 beta, so I had them go to the web page with older versions to get 6.4.0.
If you have further information on these crashes, please pass it along. We’d definitely like to fix anything that makes NetLogo 7 unusable for people.
Hi Christopher,
I have attached a (hopefully) fixed version of NetLogo.m. Note that it may take a bit of work to convince Mathematica to use the new version; I had to manually remove the old version, which I found at C:\Users\isaac\AppData\Roaming\Wolfram\Applications\NetLogo.wl. Let me know if you aren’t able to get it working.
Isaac B.
NetLogo.m (14.0 KB)
Hi Isaac,
Apologies for my delay in sending this resonse. Yes, the new NetLogo.m did work. Thanks! I didn’t need to do anything other than the Install described in the Mathematica Tutorial to get it to overwrite the previous version.
Great to hear! Must have been something funky with my development setup.
Isaac B.