netlogo / view2.5d Goto Github PK
View Code? Open in Web Editor NEWAgent variable viewer
Agent variable viewer
Other primitives probably do too. This prevents models using view2.5d
from being properly tested or from being run in BehaviorSpace (though that could be worked around).
java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
at java.util.AbstractList$Itr.next(AbstractList.java:343)
at view25d.view.gl.PatchGL.display(PatchGL.java:250)
at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78)
at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:435)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194)
at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:412)
at javax.media.opengl.GLCanvas.display(GLCanvas.java:244)
at javax.media.opengl.GLCanvas.paint(GLCanvas.java:277)
at javax.media.opengl.GLCanvas.update(GLCanvas.java:354)
at sun.awt.RepaintArea.updateComponent(RepaintArea.java:267)
at sun.awt.RepaintArea.paint(RepaintArea.java:233)
at apple.awt.ComponentModel.handleEvent(ComponentModel.java:263)
at java.awt.Component.dispatchEventImpl(Component.java:4852)
at java.awt.Component.dispatchEvent(Component.java:4604)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:690)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
I suspect this is a timing bug that will be hard to reproduce. I had messed around with the view (just mouse manipulation, not code), but wasn't when the error occurred.
Thanks for the handy extension. Have you ever looked into drawing links between turtles? It would be very handy for my work. I can code Java and would be very grateful for a few hints to get me going. -- Thanks greatly Rob
In view2.5D extension if a shape is created, edited, deleted or imported no corresponding action happens in the 3D view.
Shapes can be turtle or link shapes.
Except in the case of editing a shape, an uncaught exception occurs.
To reproduce the bug.
Create a model that includes the following code
extensions [ view2.5d ]
to setup
view2.5d:remove-all-turtle-views
view2.5d:remove-all-turtle-views
view2.5d:turtle-view "Test" turtles [ the-turtle -> [3 + abs xcor] of the-turtle ]
wait 1
view2.5d:set-observer-distance "Test" 40
view2.5d:set-z-scale "Test" 2
view2.5d:set-observer-angles "Test" 25 30
;; increase the stem thickness
view2.5d:set-turtle-stem-thickness "Test" .2
view2.5d:update-turtle-view "Test" turtles
end
to create-ambulance
create-turtles 1 [ set color orange set size 4 set shape "ambulance" setxy -2 3]
view2.5d:update-turtle-view "Test" turtles
end
- Open the Turtle Shapes Editor from the Tools menu
- Click on Import from Library ...
- Click on the ambulance entry
- Click Import
Result is
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.com.jogamp.opengl.GLException: Caught NullPointerException: null on thread AWT-EventQueue-0
at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1442)
...
Using view2.5d:set-observer-angles
at the same time that a patch-view
is in the process of opening won't set the angles within the view. The cause is this call to observer.goHome
. Removing it introduces rotation, but also changes how the view would look otherwise. This should be investigated and fixed.
Just like the normal 3d view does.
I want to show the property of turtles using 2.5d-view, but it always gives NullPointerExceptation error.
e.g. the following simple codes.
extensions [view2.5d]
turtles-own[
energy
]
to setup
ca
create-turtles 50[
set color red
setxy random-xcor random-ycor
set energy random 1000
]
create-turtles 50[
set energy random 1000
setxy random-xcor random-ycor
]
view2.5d:turtle-view "test" turtles [the-turtle -> [energy] of the-turtle]
reset-ticks
end
Using the sample model from issue #11, update it to extract the view2.5d turtle view setup like below, to be able to call it stand-alone:
to setup-turtle-view
; Set up a Turtle view
view2.5d:turtle-view "Turtle View 1" turtles [ the-turtle -> [.2 * abs xcor] of the-turtle ]
wait 1
view2.5d:set-observer-distance "Turtle View 1" 40
view2.5d:set-z-scale "Turtle View 1" 2
view2.5d:set-observer-angles "Turtle View 1" 25 30
;; increase the stem thickness
view2.5d:set-turtle-stem-thickness "Turtle View 1" .2
view2.5d:update-turtle-view "Turtle View 1" turtles
end
I then could produce an exception reliably with these steps:
setup
then create-arrow
and confirmed things looked good in both views.arrow
shape and things updated in both views.setup-turtle-view
in the command center, and got the below exception.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.
com.jogamp.opengl.GLException: Caught NullPointerException: null on thread AWT-EventQueue-0
at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1442)
at com.jogamp.opengl.Threading.invoke(Threading.java:223)
at com.jogamp.opengl.awt.GLCanvas.display(GLCanvas.java:503)
at com.jogamp.opengl.awt.GLCanvas.paint(GLCanvas.java:557)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
at sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:64)
at sun.awt.RepaintArea.paint(RepaintArea.java:240)
at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:584)
at java.awt.Component.dispatchEventImpl(Component.java:4965)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NullPointerException
at view25d.view.gl.TurtleGL.display(TurtleGL.java:154)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
at com.jogamp.opengl.awt.GLCanvas$11.run(GLCanvas.java:1428)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
... 29 more
NetLogo 6.2.0
main: org.nlogo.app.AppFrame
thread: AWT-EventQueue-0
OpenJDK 64-Bit Server VM 1.8.0_292 (BellSoft; 1.8.0_292-b10)
operating system: Linux 5.8.0-50-generic (amd64 processor)
Scala version 2.12.12
JOGL: (3D View not initialized)
OpenGL Graphics: (3D View not initialized)
model: test-25dshape-change
08:13:56.408 PeriodicUpdateEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0
08:13:56.401 PeriodicUpdateEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0
08:13:56.399 AddJobEvent (org.nlogo.app.common.CommandLine) AWT-EventQueue-0
08:13:56.399 OutputEvent (org.nlogo.app.common.CommandLine) AWT-EventQueue-0
08:13:56.399 CompiledEvent (org.nlogo.window.CompilerManager) AWT-EventQueue-0
08:13:56.394 CompileMoreSourceEvent (org.nlogo.app.common.CommandLine) AWT-EventQueue-0
08:13:56.237 PeriodicUpdateEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0
08:13:56.037 PeriodicUpdateEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0
08:13:55.836 PeriodicUpdateEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0
08:13:55.636 PeriodicUpdateEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0
Interestingly, the shape delete is necessary to reproduce the error. Just closing the turtle view isn't enough to trigger it, if you re-run the setup-turtle-view
without deleting the shape it'll complete just fine. This error was found with the PR for issue #11 merged, as well as with the bundled version in NetLogo 6.2.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.