Sara_BB
Sara_BB

Reputation: 13

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 [email protected], 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)

Upvotes: 1

Views: 81

Answers (2)

Steve Railsback
Steve Railsback

Reputation: 1736

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.

Upvotes: 3

mattsap
mattsap

Reputation: 3806

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.

Upvotes: 3

Related Questions