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.
Related
Greeting Everyone, I am a new one here.
I'm a brand new Modelica user. I'm trying to learn the language with OpenModelica. I'd like to use OpenHydraulics which is in github link in OpenModelica (specifically in the OMEdit Connection Editor).
I downloaded OpenModelica v1.19.2 and Modelica Standard Lib v3.2 to browse and run the library OpenHydraulics v1.0.1. However, when I open the Excavator example and try to Instantiate or Simulate the model I get many errors of the form:
[OpenHydraulics.Basic.VariableRestriction: 51:3-54:64]: Function ReynoldsNumber_m_flow not found in scope VariableRestriction.
Could you help me with this problem?
Thanks in advance.
there are a couple of things you need to take into consideration:
The current version of OpenHydraulics is still the original release from almost 10 years ago.
The library was developed using Dymola which at the time also supported a couple of non-standard Modelica, Dymola-specific constructs that other tools struggle to work with.
The example you are trying to run is the most complex one utilizing almost all of the power of the library and hence has quite a high degree of complexity.
Taking all this together means that OpenModelica is bound to struggle with that example. But all is not lost. If you actually look at the more simple circuit examples (under Circuit) you'll find that they work just fine. And depending on your application area they might already demonstrate a usage that will fit your needs.
I hope this helps.
It's me again!
After getting help with this question here, I managed writing a little microservice in Ballerina. For that I switched to Swan Lake as recommended.
But now I'm having difficulties using IDEs and their plugins. Because all questions related to that are pretty old I'm creating a new post.
I'm writing a paper about Ballerina and cloud native languages and thought it would be cool to show a generated sequence diagram, so I tried setting up a proper project and generating one.
However: The IntelliJ plugin doesn't seem to support Swan Lake yet. I always get an error message that the SDK is invalid. So I switched to VS Code.
Here I have a lot of problems. I can run and build my stuff just fine and I also have syntax highlight, but I don't know how to get a diagram. The documentation tells me to either open it through the project overview or the file overview. But I do not have that. My VS Code Window looks as follows:
If I try to use "Ballerina: Document" it tells me "Current file does not belong to a Ballerina project"
Also notice that the explorer one the left looks completely different compared to the documentation
But how would I set this up correctly? I did everything that the docs tell me to do and I have tried the integrator. Doesn't support Swan Lake yet. And as I said: IntelliJ doesn't work either.
Is it even possible to set this up correctly with Swan Lake at the moment? Am I just to stupid? I have never used VS Code before, so maybe there's a trick?
The sequence diagram view in Ballerina has been removed temporarily in Swan Lake. But this support will be brought back before the GA version. I guess it will be available in the Beta release, which is due in April.
Download the latest Ballerina extension for Visual Studio Code and either navigate to the button showed in num 1 for Ballerina Low-Code or navigate to num 2 to Show Diagram for the diagram view of current ballerina file. Read more from here. Ballerina provides language support through VS Code for Swan Lake but not for IntelliJ yet(Hope Ballerina will provide language support to IntelliJ with Fleet).
So I am converting a project from Unity 4.x to 5.x and there are a number of functions that the Unity compiler is warning me that are no longer supported or are obsolete.
My question is do these functions still work? (even though they are marked as obsolete)
I know at some point they need to be updated to the newer API but for the moment I just need to fix the bugs so that the game works. Are these functions still usable? or are they potentially the source of runtime bugs?
Thanks
All obsolete functions has been replaced with new functions. So should take a backup and update your project. Go to Assets->Run API Updater, if your project in not getting updated automatically. Dont worry unity will take care of most of the things.
Yes, it's still work ! They just only warning it.
But i suggest you should change for better result, Unity 5 will update you code from old project, then you should change it following warning, just replace
using "xxxx" instead.
to the current context.
I have an OpenERP 5.0 installation with a few custom modules, that I wish to upgrade to OpenERP 6.0.
I have some experience with this kind of sofware and I have inspected OpenERP. Sadly, I don't have actual experience with OpenERP, and I like to ask for some help in order to avoid mistakes. When researching this, I found there are several strategies (ETL processes, data-upgrade modules)... I assume I'll need to review all custom modules.
What are the guidelines or best practice in order to upgrade an OpenERP 5.0 installation to 6.0?
We're still planning our migration from 5.0 to 6.0, so I don't have any personal experience with the process. We are planning to tackle the work ourselves, but we've done a lot of custom development, so we're pretty comfortable with the OpenERP code. If I were inheriting the system from someone else as it sounds like you are, I would be very tempted by the support contract that includes doing migrations for you.
In addition to the paid service, there also appears to be an open-source tool available for running data migrations. It is also discussed in several forum posts. (There really are a lot.)
Our tentative plans are:
Try out the migration tool for a demo database from plain 5.0 to plain 6.1.
Migrate the code for our custom modules to 6.1, following the Pragtech guidelines.
Extend the migration tool's configuration to cover our custom modules and any others that weren't included with the tool.
Run the migration on our full database into a sandbox and test the heck out of it.
Launch and celebrate!
Update:
We've started our migration process, and we're using OpenUpgrade instead of the Domsense tool. We never really looked at the Domsense tool, so I can't say which is better. I'm very happy with OpenUpgrade so far.
In general, I've found version 6.1 much easier to customize than 5.0 was. So far, I haven't had to change any core modules. For example, most places where a core module inserts a record, it calls a helper method to prepare the data. If you add a new column that you want to be populated, you can just override that helper method. For example, we added a grouping field to several tables and then wanted to copy it from sales order line to stock move. We overrode the sale module's version of sale_order._prepare_order_line_move() with our own version.
I posted a separate question about customizing reports.
The down side is that every customized feature we try to migrate requires some change. So far there has always been a change in the core module that somehow breaks our customization. Either a field name changed, or the screen layout changed, or the whole model name changed. You can usually figure out how to fix it, but everything takes time.
The best approach is to contract an OpenERP Enterprise. Migrating is quite complex and OpenERP can do the job for you. It's a fixed price for unlimited bugfixes and migrations: http://www.openerp.com/catalog/146
I've got a (dirty) production installation of Simple Machines Forum (SMF 1.1.13). It was a clean install, once... about five years, twenty updates, and 40 mods ago. Not to mention the custom code that was patched directly into the code base. This started as a for-fun side project, and didn't have any code management practices at the get-go.
Now SMF 2 is (getting closer to) going live, and I want to upgrade. But without leaving the custom features behind.
Keep reading, this is a general software management question, not an SMF support question...
I'm trying to figure out the best way to port the custom features into the new code branch.
In some cases, the custom 1.1.x functionality will already exist in 2.0. Yay, no work for me!
In some cases, there will be mod packages versioned for 2.0, and I can just install them directly on a clean SMF 2 build. Yay, minimal work for me!
In some cases, the code port will be fairly straightforward between the two versions (e.g. a few small changes in queries or global variable construction). (I've ported a few features/mods back from 2.0 to 1.1.x, so I'm starting to get familiar with it.)
In some cases, I'm just going to have to redevelop the features mostly from scratch.
Those last two options are gonna be hard to manage.
Any suggestions on how to port a large number of changes from one branch to another?
When it's not my own in-house code, that is. Here's my initial plan:
Diff between a clean version of 1.1.x and my "dirty" production code
Map each line diff to a feature ("That code update is the custom tagging feature, gonna have to port it line by line, and that one over there is the gallery, I can probably install an updated mod.") This would be SOMUCHEASIER if there were a diff tool that generated a consolidated report, instead of having to go through scores of files one at a time. Google and SO searches didn't find a tool like that-- Is there one?
Install a clean 2.0 branch
Install the available updated mods
Roll up my sleeves and go through my diffs feature by feature (this? is why I need the consolidated diff report. It would be hell to do page by page.) and build them back in.
Any better ideas? (Pointers to release management info are welcome, though of course with the caveat that it's not actually my code so I have limited control.)
Otherwise? I fear my options are ditch the custom features (not really feasible) or stay on the old branch. Both suck. Help!
tl;dr: Point me to a diff tool that will do consolidated file-by-file diff reports for entire directories. And/or help me figure out an easier way to migrate my custom code.
Your plan is generally the most practical approach, although I would say that you're heading in the wrong direction by looking for code-level differences. With no version control over the project lifetime and with no concise record of applied changes, in examining differences at the code level you are looking for a level of detail that may not give you the information you need to apply the same changes to a new implementation.
Move away from thinking of code-level changes and consider application-level feature and behavioural changes. What features have your changes introduced? In what ways does your application now behave differently due to your changes?
You say that there have been many unversioned changes over a long period - you will fail to find all the changes no matter what tools you have at your disposal and you will still need to consider the feature and behavioural changes that exist to fully represent the same features and behaviours in any upgraded implementation.
You know your application well, you use it and you do appreciate the feature changes that you have introduced even if you may not realise this.
Install a vanilla 2.0 release
Apply all appropriate mods
Apply relevant styling
Use the new system, note the differences in behaviour and develop from this a set of required features
Your feature set does not need to be complete - don't stall at the stage of trying to figure out all required changes, this will take too long.
Apply features gathered from most recent feedback (ideally through revertable mods)
Note the differences in behaviour at develop from this a set of required features
Repeat