Age of tokens in simulation is wrong

Bug #352457 reported by Jiri Srba
2
Affects Status Importance Assigned to Milestone
TAPAAL
Fix Released
High
Jiri Srba

Bug Description

Open the attached net, go to simulation mode and run

Time delay: 0.3
T0
Time delay: 0.01
Time delay: 0.01
Time delay: 0.01

and this point the age of tokens still shows only 0.32

Fire now T1 and the age of tokens in places and on MouseOver is different.

Revision history for this message
Jiri Srba (srba) wrote :
Changed in tapn:
importance: Undecided → High
milestone: none → version1
Revision history for this message
Kenneth Yrke Jørgensen (yrke) wrote :

Joakim Bygs says:
I made a place and a couple of tokens, repeatedly change the age with
0.01 and at some point it will not update.
Then I tried with 0.1 and I found that the problem is that at some point
it will update, not 0.1 but 0.09.

The graphic at the places is limited to showing 2 decimals, so when
issuing a 0.01 that instead becomes 0.009, then it looks like the age is
not updated in the place.

I am really tired of these float problems and I don't really see what
more than one (perhaps two) decimal(s) after the separator is good for.
So I suggest to simplify the ages to only have one decimal after the
separator - perhaps using doubles and formating to one decimal is
enough, but we could also make our own number class that has two
integers and a separator; one integer in front of the separator and one
integer from 0 to 9 after the separator.

Changed in tapn:
assignee: nobody → yrke
status: New → Confirmed
Revision history for this message
Kenneth Yrke Jørgensen (yrke) wrote :

Commited a fix that uses the DecimalFormat for formating the age of a token.

Changed in tapn:
status: Confirmed → Fix Committed
Revision history for this message
Jiri Srba (srba) wrote :

I just tried the fix and it still does not work . I can still do some number of delays 0.1 and 0.01 and the tokens in places show
the correct age but on MouseOver one gets a different age.

Changed in tapn:
status: Fix Committed → Incomplete
Revision history for this message
Jiri Srba (srba) wrote :

OK, this was a Mac specific problem. The object had to been destroyed because garbage collector works differently on linux and mac.
Now it should be fixed.

Changed in tapn:
assignee: yrke → srba
status: Incomplete → Fix Committed
Changed in tapn:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.