How do I add an extension to NetLogo 5.2.1 - netlogo

Can someone point me to documentation for how to install an extension such as Rnd for Version 5.2 of NetLogo? Here's why I think I need to do that.
I am trying to use a model created in NetLogo 5.2 and I would like to get it to run in version 6.1.1. I've never done this sort of thing before, so I may be missing something obvious.
If I try to open the model in 6.1.1 the automatic conversion process fails due to a syntax error ( missing parenthesis) and does not un-grey the option to continue to convert it. So I figured, ok, I would download Netlogo 5.2 and open the file with that and fix the syntax error, then try the automated conversion again. So I located and downloaded NetLogo 5.2, the version with bundled java.
The model opens the code fine with NetLogo 5.2, but it requires the Rnd extension, which it doesn't have installed. (I double-checked and there is no Rnd folder in the extensions folder for version 5.2, but other extension folders are there. ) I'd prefer to get that extension so I can actually run the model to confirm I didn't break something else, or at least have the syntax checker work and not get stuck on the missing extension.
Here I become unclear about what I need to do, as NetLogo 5.2 doesn't have a nice tools/extensions... menu choice, so I believe I need to obtain this extension from github myself somehow. I didn't find exact documentation on how to do that. Here I'm sure I'm missing something obvious.
Anyway, I read what documentation I could find and believed that I need to obtain the Rnd.jar file manually and put it into the Rnd folder in the extensions folder, and I'd be good to go. Perhaps that is incorrect.
In any case, I looked on github at https://github.com/NetLogo/Rnd-Extension and there is no Rnd.jar file that I can find there. So "punting" fails and I need to find actual documentation or advice.
Thank you in advance for your help!

Jasper suggested the following,
Did you try any of the releases from GitHub? Anything before "Hexy Pre
Release" (the 6.0 release) might have a shot at working:
github.com/NetLogo/Rnd-Extension/releases – Jasper
and I got version v1.1.0 of the extension downloaded, unzipped, putting the rnd.jar file into the new rnd folder in the extensions folder,
and everything worked.
Thank you Jasper!

Related

How can you Import Forge Mods into Eclipse

Specifically I'm trying to edit this mod: https://www.curseforge.com/minecraft/mc-mods/naruto-anime-mod-plus/files/3050483
I'm not just trying to edit the config, I want to add custom stuff as well.
You can't do it easily because the mods is NOT open-source. In fact, it's All right reserved, so you are not allowed to do it. So do at your own risk.
1) Get the source code
You can ask to the original dev, but it's sure it will decline your question.
Else, you have to decompile the jar thanks to utilities like javadecompilers.com.
2) Create a new Java Project in eclipse
Create a blank java project
3) Copy/paste the code in your eclipse project
*The code obtain thanks to decompilation
4) Before using it, you should fix all decompilation issue.
Finally, I think it's a better idea to create a new one, specially because it will be faster to upgrade it in 1.17 or make more edition.

What is the correct way to include Playgrounds in a Swift Package?

When I publish a Swift Package, I like to include some Playgrounds to show examples of how to use the package. Prior to Swift 5.4, I was able to do this in a relatively straightforward way, but now none of my Playgrounds ever sees the contents of my package module. It doesn't make any sense to me.
I've followed the exact pattern illustrated by Apple's own WWDC videos, which is to have a Playgrounds/ folder as a peer to your Sources/ folder, and then just import the package module.
The import works, but the Playground always reports that it cannot find any of the types from inside the module. They are all marked public, and as I mentioned before, these used to work just fine.
This doesn't work for me in Swift 5.4 or 5.5, in Xcode 12.5 or 13 Beta.
I assume there must be some setting or configuration I am not understanding. Can somebody please explain the best practice here?
For reference, here is one of my simple Swift Packages that has Playgrounds that currently do not work:
https://github.com/dunesailer/Wordsmith
EDIT: It gets even stranger. I have a different Swift Package structured what appears to me to be the exact same way, but its Playgrounds work fine. Whaaat? That one is here:
https://github.com/dunesailer/Aesthete
If you move/ delete the folders Chemical Names, Work Titles and Person Names inside Playgrounds/, all the playgrounds work fine. It looks like Xcode doesn't support folders in Playgrounds/ (/ it's a bug).
So to work around this issue, just put all your playgrounds in the same folder.
EDIT: It looks like this works inconsistently. I've submitted a bug report/ Feedback for Developer Tools in Feedback Assistant.
A longer term workaround is to use DocC (arrived in Xcode 13 beta), which will support more advanced tutorials/ articles in the repo.
Use workspace.
(Xcode: File: New: Workspace)
You use it as "container" for both your package, playground (or app target for that matter). The important thing is to add each of these to the workspace by using "Add files to ..." button in the lower-left section of the Xcode, and from there on, open the .xcworkspace file:
to edit your package
to run playground file.
You can follow instructions from here.
https://stackoverflow.com/a/67580251/13292535

Netlogo: Internal error with Time extention

I have installed the time extension but my code will setup but not run. Same for the example models I've tried. The error message I receive is below. Thanks for your help!
P.S:I am running NetLogo version 6.0.4.
NetLogo is unable to supply you with more details about this error.
Please report the problem at https://github.com/NetLogo/NetLogo/issues,
or to bugs#ccl.northwestern.edu, and paste the
contents of this window into your report
java.lang.IllegalAccessError: tried to access field
org.nlogo.agent.World.tickCounter from class time.datatypes.LogoSchedule
at time.datatypes.LogoSchedule.getTickCounter(LogoSchedule.java:135)
at time.datatypes.LogoSchedule.performScheduledTasks(LogoSchedule.java:156)
at time.primitives.DiscreteEventSchedulerPrimitives$GoUntil.perform(DiscreteEventSchedulerPrimitives.java:95)
at org.nlogo.prim._extern.perform(_extern.java:36)
at org.nlogo.nvm.Context.stepConcurrent(Context.java:107)
at org.nlogo.nvm.ConcurrentJob.step(ConcurrentJob.scala:65)
at org.nlogo.job.JobThread.runPrimaryJobs(JobThread.scala:133)
at org.nlogo.job.JobThread.$anonfun$run$1(JobThread.scala:68)
at
scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.util.control.Exception$Catch.apply(Exception.scala:224)
at org.nlogo.api.Exceptions$.handling(Exceptions.scala:41)
at org.nlogo.job.JobThread.run(JobThread.scala:66)
I'm not confident in my answer; however,
If you look at the code (updated Jan 14, 2017) (https://github.com/colinsheppard/time/blob/master/src/main/java/time/datatypes/LogoSchedule.java):
TickCounter getTickCounter(ExtensionContext context){
if(tickCounter==null){
tickCounter = context.workspace().world().tickCounter;
}
return tickCounter;
}
We see that the timer is getting the workspace's world's tickCounter.
If we look at the netlogo website for updates (https://ccl.northwestern.edu/netlogo/docs/transition.html), we see that:
One of our goals in NetLogo 6.0 has been to make it easier to develop
extensions and easy to develop more powerful extensions. To that end,
we’ve bumped the extension API from 5.0 to 6.0. Existing extensions
will need to recompile changing the “NetLogo-Extension-API-Version” in
their jar’s MANIFEST.MF from 5.0 to 6.0.
Some of the changes we’ve made to the extensions API include :
org.nlogo.api.Context now allows access to the current world and
workspace objects without requiring a cast to an
org.nlogo.nvm.ExtensionContext. org.nlogo.api.Workspace has been
introduced as a stable API for extensions to depend on. A NetLogo jar
is now available from BinTray. For a full list of changes between 5.0
and 6.0, please visit our Extension Transition Guide on GitHub.
That being said, I think the source code for the timer extension hasn't done the migration to conform to the new updates. You can see that it explicitly mentions the ExtensionContext.
Unfortunately, I believe the solution is to update the timer source code and commit.
I'm afraid I can't tell what the problem is from the error statement posted. The time extension is in flux right now because the NetLogo development team is updating it for inclusion in future releases of NetLogo. But they are not done and not all the bugs are out.
I am using Colin Sheppard's version at https://github.com/colinsheppard/time
It has been reliable except for the discrete event simulation primitives. The date/time utilities and the time series tool work, but we know that the discrete event scheduling does not work under NetLogo 6.x. If you want to use the discrete event scheduling, I'm afraid you'll need to be patient until the NetLogo project gets their version fully debugged.
I temporarily put a fairly comprehensive example code here:
http://langrailsback.com/file-transfers/
It includes Colin's version of the extension.

Multiple _PublishedWebsites Folders

I am using VS Code on Manjaro and have setup a solution with 2 projects, a webapp and a test project.
Each time I do a build it appears to generate a new _PublishedWebsites folder with NetCoreApp underneath it. I am surprised that nobody else seems to have encountered this issue. Can anyone tell me why this is happening and how to fix it?
Many thanks.
You should check your csproj file, particularly PublishDir element which is your specified location for publishing output files and change that if your like.
However, I think this is required behavior for .net core support in app harbor, find more details in the support webpage over here.

discover which Eclipse projects are opened

Is there any way to discover programatically (but not in PDE code) which eclipse projects are opened?
I was hoping that would exist a .metadata anywhere telling me that, but couldn't find any non binary data.
The closer I got was something like:
"$WORKSPACE.metadata/.plugins/org.eclipse.core.resources/.projects/%s/org.eclipse.jdt.core/state.dat" where %s refers to the project name
I think m2eclipse uses that guy for some kind of control, because on a m2project this file gets removed as soon as the projects build.
Also, i found some information on .metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml but none of them give me the full info I was hoping to find.
Does anyone knows how to solve it?
I was trying on eclipse 3.7.
On eclipse 4.3 , at least, its possible to parse $WORKSPACE/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml and look up whether the desired project has a factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory", meaning it is opened.
I Didn't try this on 4.2 tough, maybe it works there as well.
To do it "programmatically", you call the APIs from the org.eclipse.core.resources plug-in. Otherwise, you are doing it wrong.