Why use Crc32Hash in PetriNetMarkingImpl?

Anonymous
2003-06-28
2003-07-05
  • Anonymous - 2003-06-28

    Why we use Crc32Hash in PetriNetMarkingImpl?

    when we compare two Markings, we can simply compare every "tokens" in a "for loop" for every place.

    could you kindly enough to explain ?

     
    • Ricardo Padilha

      Ricardo Padilha - 2003-06-30

      Yes, you are right, but this is hardly a scalable solution.

      A while ago, Filip implemented a state-space search. He needed to quickly identify if a marking was already visited. When you have more than 50,000 elements to compare two-by-two, comparision is no match for a hashtable based on a CRC32.

      And since we found no other cases where the use of the CRC induced severe penalties, we decided to keep it that way.

      Is the use of CRC giving you a hard time in any way?

       
    • Anonymous - 2003-06-30

      Thanks for your answer...:)

      I just want to ensure the purpose of using CRC32,
      and not being given a hard time...:)

      btw, when i choose to save a PetriNet as JPEG format, there always an exception:
      "Width (0) and height (0) cannot be <= 0."
      I am trying to solve this bug....do you have any good idea?  :)

       
      • Ricardo Padilha

        Ricardo Padilha - 2003-07-02

        I'm sorry if I sounded harsh, english is not my primary language.

        As for your question, if you could provide the stack trace (save it to jarp.log and then copy/paste it here) maybe I could be more helpful.

        I have some ideas about what could be happening, but I'd rather base my opinion on some "hard" evidence...

         
    • Anonymous - 2003-07-03

      english is not my primary language too...hehe
      so, lets don't worry about too much...:)

      the stack trace is here:

      Tool exception Thu Jul 03 16:08:25 GMT+08:00 2003
      java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
          at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
          at java.awt.image.BufferedImage.<init>(BufferedImage.java:250)
          at org.jarp.filters.JPEGStorageFormat.store(JPEGStorageFormat.java:59)
          at org.jarp.tools.SaveAsTool.saveFile(SaveAsTool.java:87)
          at org.jarp.tools.SaveAsTool.execute(SaveAsTool.java:80)
          at org.jarp.tools.SaveAsTool$SaveTool.execute(SaveAsTool.java:108)
          at org.jarp.tools.AbstractJARPTool.actionPerformed(AbstractJARPTool.java:65)
          at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
          at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
          at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
          at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
          at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
          at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:227)
          at java.awt.Component.processMouseEvent(Component.java:5093)
          at java.awt.Component.processEvent(Component.java:4890)
          at java.awt.Container.processEvent(Container.java:1566)
          at java.awt.Component.dispatchEventImpl(Component.java:3598)
          at java.awt.Container.dispatchEventImpl(Container.java:1623)
          at java.awt.Component.dispatchEvent(Component.java:3439)
          at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
          at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
          at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
          at java.awt.Container.dispatchEventImpl(Container.java:1609)
          at java.awt.Window.dispatchEventImpl(Window.java:1585)
          at java.awt.Component.dispatchEvent(Component.java:3439)
          at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
          at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
          at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
          at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

       
      • Ricardo Padilha

        Ricardo Padilha - 2003-07-05

        Do you have Java Webstart setup in your computer?

        If you do, could you please try accessing http://jarp.sf.net/webstart/jarp.jnlp and telling me if the bug is gone?

        Thanks,
        Ricardo

         

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks