NetLogo create-movie: where to find and how to add VID extension? - netlogo

I would like to create a movie from my NetLogo model. I followed the Movies example here: http://ccl.northwestern.edu/netlogo/docs/programming.html#movies
I have added the parts of code into my model, and created the button "make-movie" in my interface.
extensions [vid]
; ....
to make-movie
setup
vid:start-recorder
vid:record-interface ;; show the initial state
repeat 2
[ go
vid:record-view ]
vid:save-recording "out.mp4"
end
When I try to run it, I have an error: Can't find extension: vid and NetLogo directs me on the github website: https://github.com/NetLogo/NetLogo/wiki/Extensions to download one. However, there is no VID extension. I think the closest is the Gst-Video so I downloaded it, unzipped the files and copied the files to this location: C:\Program Files (x86)\NetLogo 5.2.1\app\extensions, as I run on 64-bit Windows with 32-bit NetLogo.
NetLogo still can't find this extension.
Please, where can I find the VID extension? And how can I correctly add this extension in the extension library? Is is sufficient just copy, unzip and paste the downloaded file?

Looks like you're using Netlogo 5.2.1- Vid was added in 6.0. You should upgrade to the latest version if you want to use Vid. If you don't want to upgrade, you should still be able to use the movie primitives in version 5.2.

Related

Dymola - Is there any difference between "Open" and "Load" files?

I’ve been using Dymola (version 2017) for three months and I’d just like to ask a simple issue that I think about it nearly every day. Is there any difference between the file tool “Open” and “Load"? I'm used to use Load for “load” the library packages and Open for “open” the model files, but I've tried to switch them few times and I didn’t notice any difference. I guess that it isn’t relevant and actually it’s just out of curiosity, but maybe someone in this community is able to shed some light on why there are two buttons. Thanks in advance.
Both load your .mo files into the package browser. But Open changes the working directory to the location of the .mo file, whereas Load does not.
From the command line:
openModel("lib.mo", changeDirectory=false) // corresponds to load
openModel("lib.mo") // corresponds to open
You can check your current working directory by typing cd on the command line.

Love 2d is not working in my VS Code setup

I have made a new folder to keep my coding files in and folders of Love2D. But since then whenever I press alt+l in my main.lua file in vs code, the file doesn't run in love app.
But, when I try to drag and drop the folder of my game onto the love2D shortcut on my desktop, the game runs fine.
Why does this happen?
Here are the settings of my love2d support extension:
I have tried reinstalling love, also tried to reinstall the extension, and installing any previous version of love.
I tried to open the project directly as a project too.
Pls, can someone help me at the earliest?
You provided . as the src directory in the support extension, which probably tries to launch PIYUSH_LOVE2D as the game (which does not contain a main.lua).
Either open the game directory directly as a project in VS Code or enter the path of the game in Src Dir.
EDIT: Alt+L while the main.lua is open works and uses the dir containing the main as the root. The correct path is only required if the main.lua is not open.
I found something that can help you on the LÖVE 2D website. Take a look:
“Remember to drag the folder containing main.lua, and not main.lua itself”
I don't know much about VS Code but I think to solve your problem you could configure it to run the game folder in LOVE, instead of its main.
I'm late to answering this but I hope it helps someone. It looks like you have Live Server extension installed, I believe that also has a key combo of ALT+L, which interferes with the Love2D extension.
Try removing Live Server, or change the key combo to something other than ALT+L for either of the extensions.

Problems with adding NetLogo extension for Mac

I'm having a problem adding the matlab-extension folder previously developed (https://github.com/mbi2gs/netlogo-matlab-extension/wiki) into the net logo extension folder. I think there is some problem with my ability to write into the NetLogo folders. I have tried troubleshooting with erasing and rewriting the drive, and by checking the 'ignore ownership on this volume' in the get info box. But neither of these have helped adding files into NetLogo. My system is macOS Sierra v. 10.12.6 and NetLogo 6.1.1.
At the moment I don't have MatLab installed, but here are a few things you could try.
It looks like you are running NetLogo from inside the disk image (dmg file) it came in. This might work, but generally I'd advise copying the NetLogo 6.1.1 folder out of the disk image into your Applications folder and getting rid of the disk image entirely. You can either open the the NetLogo disk image and the Applications folder at the same time then drag the NetLogo 6.1.1 folder over, or you can select the NetLogo 6.1.1 folder and Command-C to copy then Command-V to paste the folder to the Applications.
The second step is to make you sure you have the matlab folder copied into the extensions folder under the NetLogo 6.1.1 folder, per those MatLab extension directions.
If the Matlab extension does write to the NetLogo folder while it's running, you may have to repeat those steps you tried to give your user read and write access to the NetLogo 6.1.1 folder, too.
Here is a pic of how things look with my NetLogo 6.1.1 folder in the Applications folder and the matlab extension copied in.
If none of that helps, one alternative to try is to place the contents of the matlab extension folder in a new folder inside your Documents folder, something like matlab-models. Then if you place an nlogo model file there and load it, NetLogo should use this matlab-models folder's copy of the extension, and you'll definitely have proper permission to write to it in your Documents folder. You want the matlab.jar file right alongside the nlogo models you use Matlab with if you try this.

How do you get the python colour scheme while using sage on VS code?

Currently, I name my files as .py while working on them, and then change them to .sage when I need to execute. Is there a way to get the python colour scheme for sage files on VS code?
There is an extension called SAGE enterprise management that claims to do it, but the instructions are a bit unclear:
It says:
Create a x3-code named folder inside your ~/.vscode/extensions/;
Copy all files in yours recent created folder;
Reload VS Code and enjoy;
I tried both copying my sage files into the folder, and the contents of the x3-extension into the folder, both of which didn't work.
The instructions referred to in the question are for Sage the
accounting software, not for SageMath the Sage mathematics
software system.
In the case of SageMath, we need to tell VS Code to apply Python
formatting not only to files ending in .py, but also to files
ending in .sage. One way to do that is to use the "file to
language association" setting:
https://code.visualstudio.com/updates/vMarch#_file-to-language-association
One would add associations from "*.sage" to "python".
This related question has answers explaining where Visual
Studio Code's language extension files are located on macOS
and Windows:
Stack Overflow question 42498117
Following the first link provided in the prior answer, I got it worked. In details,
go to Settings, type "files.associations" in the search box for Search settings.
It shows you a list of (item, value) in which you can add a new item (*.sage, python). See my screenshot below
Hope it works for you!

Opening Simulink models created in newer versions of MATLAB

I have received a simulink model from one of my students, but as he is using a newer version of MATLAB (8.6) than the one i have installed (8.5) i get an error when i try to open it.
How can i open it without asking him to save in an older format?
If you have a .slx file that you need to convert, the process is a little different. Using a tool like 7Zip, open the .slx file (a .slx is really just a disguised .zip file) so you can edit it without extracting all the files. Go into the "metadata" folder. Edit each of the .xml files in there and change the tags for <cp:version> and <matlabVersion>. Save each and have 7Zip update the archive for you.
Like the other responder said though, if you used any part of your model uses features inherent to the newer version, those components will be broken.
It was actaully quite simple.
I opened the .mdl file in a text editor and search/replaced
8.6->8.5
and 2015b->2015a
Sometimes when doing this an error occurs when opening a model for the first time. After saving it the first time and reopening it this error dissapears.
It should however be noted that if the model contains a new component or if the functionality of a component has been changed this method will not work.
Sigurd