greatspn / SOURCES

Main repository of the GreatSPN framework
GNU General Public License v2.0
42 stars 13 forks source link

Time step "-" causes NumberFormatException #14

Closed millergarym closed 4 years ago

millergarym commented 4 years ago

File SimpleIRENsimulation.PNPRO model PT

When simulating the model a exception is thrown.

java.lang.NumberFormatException: For input string: "-"
    at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
    at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    at java.lang.Double.parseDouble(Double.java:538)
    at editor.gui.net.NetPlayPanel.startNodeFiring(NetPlayPanel.java:637)
    at editor.gui.net.NetPlayPanel.access$1100(NetPlayPanel.java:67)
    at editor.gui.net.NetPlayPanel$6.actionPerformed(NetPlayPanel.java:568)
    at javax.swing.Timer.fireActionPerformed(Timer.java:313)
    at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    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:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at editor.Main$2.dispatchEvent(Main.java:192)

java.lang.NullPointerException
    at editor.gui.net.NetEditorPanel.getPageZoom(NetEditorPanel.java:104)
    at editor.gui.net.NetEditorPanel.updateGUI(NetEditorPanel.java:387)
    at editor.gui.AppWindow.updateGUI(AppWindow.java:878)
amparore commented 4 years ago

which model did you test? Consider that this model was made for a project, and it is incomplete, in the sense that the XML file was then processed by a script to get the final working model.

millergarym commented 4 years ago

Model: JavaGUI/SimpleIRENsimulation.PNPRO :: PT

I managed to reproduce the issue with a model build via the editor, no XML editing.

Note: if the parameters to Uniform are [1,1] the error occurs on launching the simulator.

image

amparore commented 4 years ago

This bug should now be fixed in the main branch.