问题
I have the same problem as the user who posted in "Unable to use Mathematica Link in NetLogo 6.0" (Unable to use Mathematica Link in NetLogo 6.0). For me, the Mathematica Link seems to work fine with Netlogo version 5.3.1. Even after I attempted the recommended hotpatch (which was the answer to the original posted question on this topic), still no luck (I get the same error message posted in the original comment cited above). I tried extracting the hotpatch in the NetLogo 6.0 directory and in the NetLogo 6.0 / app subdirectory... neither seemed to work. I'm using a PC with Windows 7.
Any advice on how to properly install the patch would be greatly appreciated.
回答1:
This fix is packaged with 6.0.1 and instructions on using it can be found here. If it's easy for you to upgrade to 6.0.1 I would recommend doing that over trying to install the 6.0 fix. I have verified that the fix works for 6.0, although the installation instructions don't seem to be correct.
My configuration:
- Windows 10 (don't have Windows 7 available, unfortunately)
- NetLogo 6.0 64-bit
- Windows 10 64-bit
The steps I took to install:
- Before starting, go to your NetLogo installation directory and rename the "Mathematica Link" directory to "Mathematica Link - original" (or delete it, if you prefer).
- When I downloaded the file, it extracted to somewhere in my Downloads folder. You may have to extract yourself, depending on your browser and OS configuration
- I copied the enclosed "Mathematica Link" folder (the one with the space in the name, not the "MathematicaLink" folder at the top level) to the NetLogo directory (not the "app" directory as mentioned in the instructions).
I then opened Mathematica and ran the following commands:
- File > Install > type: Package, source: From File, file: C:\Program Files\NetLogo 6.0.1\Mathematica Link\NetLogo.m, install name: NetLogo, install for this user only. Note that when selecting this file, Mathematica will use the last directory you opened, so when the file dialog opens, first navigate to the the top of the drive then navigate down to NetLogo 6.0.1 (using a NetLogo.m file from an older NetLogo version will almost certainly break Mathematica link, and this is a very easy mistake to make).
- Entered in the notebook (cannot code block this): <
- Entered in the notebook:
NLStart["C:\\Program File\\NetLogo 6.0.1"]
(note the double backslashes and no trailing backslash). - The NetLogo window will open after a noticeable delay (depending on your system speed and memory)
Edit:
I wanted to consolidate troubleshooting steps for future readers. I've introduced a new version of NetLogo.m available here, which users should download for troubleshooting purposes (it will be distributed with future versions of NetLogo). Some steps to using this:
Mathematica will cache old "NetLogo.m" files. You can find where these caches are by using the following commands in Mathematica:
FileNameJoin[{ $BaseDirectory, "Applications" }]
FileNameJoin[{ $UserBaseDirectory, "Applications" }]
Visit the directories obtained in Step 1 and delete all "NetLogo.m" files from them.
- Download the new version of NetLogo.m
- Install the downloaded version of NetLogo.m (and run <<NetLogo`)
- Run
NLDiagnostics["C:\\Program Files\\NetLogo 6.0.1"]
to determine what paths are being searched. This function will produce a hash as an output. The keymissingJars
should be an empty list ({}
). - If you want to check java version, you can run
NLJavaDiagnostics[]
. ThejavaVersion
returned should start with "1.8.0", thejavaArchitecture
returned should be "64".
来源:https://stackoverflow.com/questions/43209522/recommended-hotpatch-for-mathematica-link-to-netlogo-6-didnt-work