Tokens from initial marking disappear

Bug #2038418 reported by Jiri Srba
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TAPAAL
Fix Committed
Undecided
Unassigned

Bug Description

Open the ERK example. Go to the simulator (press M), execute the transition r1 (double click it), and return back to the editor (press M again). Now all tokens from the initial marking disappeared.

Jiri Srba (srba)
Changed in tapaal:
assignee: nobody → Kenneth Yrke Jørgensen (yrke)
Revision history for this message
Kenneth Yrke Jørgensen (yrke) wrote :

Based on testing, it seems to also affect when changing marking from history.

Looking in the debugger it seems the markings are saved as empty.

Traced the code back to NetworkMarking.Java line 34-36:

<code>
for (TimedPlace place : tapn.places()) {
    place.resetNumberOfTokens();
}
</code>

Git message is: "Fixed initial markings not updating" changed 2023-04-17.

Removing the change fixes the issue, but will properly bring back the old issue.

This might refer to bugs:
https://bugs.launchpad.net/tapaal/+bug/1988664 or
https://bugs.launchpad.net/tapaal/+bug/2016304

I guess we need to revisit this to find a proper fix.

Changed in tapaal:
assignee: Kenneth Yrke Jørgensen (yrke) → nobody
Revision history for this message
Jiri Srba (srba) wrote :

Indeed, removing the code above solves the problem with the initial marking but reintroduces this bug: https://bugs.launchpad.net/tapaal/+bug/2016304

Revision history for this message
Jiri Srba (srba) wrote :

The problem seems that by removing the tokens from the marking, we modify the initial marking.

Revision history for this message
Jiri Srba (srba) wrote (last edit ):

It is actually me who introduced this problem by modifying TimedPlace.java and adding line 83
this.tokens().clear();

in attempt to fix this bug:

https://bugs.launchpad.net/tapaal/+bug/2037705

I think that line 83 should be deleted and a better fix should be done for the above bug.

Jiri Srba (srba)
Changed in tapaal:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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