MASON-INTEREST-L Archives

December 2016

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version:
1.0 (Mac OS X Mail 9.3 \(3124\))
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Subject:
From:
Marshall <[log in to unmask]>
Date:
Fri, 30 Dec 2016 22:15:16 -0600
Message-ID:
Content-Type:
multipart/alternative; boundary="Apple-Mail=_9DA703EB-E9F5-49A9-8E2E-CC0BF9310DDC"
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (5 kB) , text/html (12 kB)
I encountered an issue with HexaObjectGridPortrayal2D using this week’s MASON commit.  Here
https://github.com/mars0i/masonborder
is a Java example using both setPortrayalForNull and setPortrayalForClass on a grid field in which not every cell is filled.

(Sean, should I just send this kind of bug report directly to you, or is it best to send it to the mailing list?)

1. If I use HexaObjectGridPortrayal2D and double-click on one of the OvalPortrayal2D’s on a null cell, I get an NPE (but the program doesn’t die).  Double-clicking on the portrayal of a cell with an Object produces the normal inspector behavior.  Double-clicking on an unfilled region of the display does nothing (no NPE).  If I switch to using an ObjectGridPortrayal2D, double-clicking on the portrayal of a null cell does nothing—no NPE—and the other behaviors are the same as before.  So the NPE only occurs with HexaObjectGridPortrayal2D.  This occurs with the new version that Sean committed this week, but not with the MASON 19 distribution jar (which doesn’t allow CircledPortrayal2D to work fully with HexaObjectGridPortrayal2D).

This is not such a bad thing in itself: An NPE that doesn’t stop the app, that only happens when the user does something s/he has no need to do.  However, the reason I found this problem is that I was trying to produce a simple Java example that would reproduce a problem in my Clojure model.  I haven’t succeeded in reproducing problem exactly, but the Clojure problem and the problem exhibited by the Java example described above have exactly the same stack traces—line numbers, everything—so it seems plausible that they’re related.

2. The problem in the Clojure model is that double-clicking on the portrayals of one of my agents (OvalPortrayal2D or RectanglePortrayal2D) produces the usual inspector behavior if I use an ObjectGridPortrayal2Ds, but if I use HexaObjectGridPortrayal2Ds, I get the NPE and stack trace but no inspector.  Again, this occurs with the new commit but not with the distribution version of MASON.

[I don’t think anyone on the list will want to run the Clojure model, but if so, it’s here: https://github.com/mars0i/free-agent.  To run it you need Leiningen (http://leiningen.org), which will install Clojure and all libs that you need except for the usual libs that MASON uses.  I put links to those in lib/ under the root of the repo.  There are run scripts in src/scripts.]

Thanks!

Marshall


The stack trace:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at sim.util.SimpleProperties.numProperties(SimpleProperties.java:642)
	at sim.portrayal.SimpleInspector.generateProperties(SimpleInspector.java:195)
	at sim.portrayal.SimpleInspector.<init>(SimpleInspector.java:62)
	at sim.portrayal.SimpleInspector.<init>(SimpleInspector.java:93)
	at sim.portrayal.SimpleInspector.<init>(SimpleInspector.java:85)
	at sim.portrayal.Inspector.getInspector(Inspector.java:98)
	at sim.portrayal.SimplePortrayal2D.getInspector(SimplePortrayal2D.java:79)
	at sim.portrayal.FieldPortrayal.getInspector(FieldPortrayal.java:298)
	at sim.display.Display2D.createInspectors(Display2D.java:1744)
	at sim.display.Display2D.createInspectors(Display2D.java:1767)
	at sim.display.Display2D$8.mouseClicked(Display2D.java:1392)
	at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:269)
	at java.awt.Component.processMouseEvent(Component.java:6536)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6298)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4534)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2280)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	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:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	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)






ATOM RSS1 RSS2