~tapaal-contributor/tapaal/autodetect-lens-check2

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/translations/tapn/BroadcastTranslation.java

merged in lp:~yrke/tapaal/fix-1887524-prepostSetSize fixing issues with calculating preset and postset sizes for nets with inhibitor arcs

Show diffs side-by-side

added added

removed removed

Lines of Context:
188
188
                }
189
189
 
190
190
                for (TimedTransition t : model.transitions()) {
191
 
                        if(t.presetSize() == 0 && !t.hasInhibitorArcs()) {
 
191
                        if(t.presetSizeWithoutInhibitorArcs() == 0 && !t.hasInhibitorArcs()) {
192
192
                                continue;
193
193
                        } else if (isTransitionDegree1(t) && !t.hasInhibitorArcs()) {
194
194
                                builder.append("broadcast chan ");
221
221
        }
222
222
 
223
223
        private boolean isTransitionDegree1(TimedTransition t) {
224
 
                return t.presetSize() == 1 && t.postsetSize() == 1;
 
224
                return t.presetSizeWithoutInhibitorArcs() == 1 && t.postsetSize() == 1;
225
225
        }
226
226
        
227
227
        private boolean isTransitionDegree2(TimedTransition t) {
228
 
                return t.presetSize() == 2 && t.postsetSize() == 2;
 
228
                return t.presetSizeWithoutInhibitorArcs() == 2 && t.postsetSize() == 2;
229
229
        }
230
230
 
231
231
        private TimedAutomaton createControlTemplate(TimedArcPetriNet model) {
256
256
        protected void createTransitionSimulations(TimedAutomaton control, Location lock, TimedArcPetriNet model) {
257
257
 
258
258
                for (TimedTransition transition : model.transitions()) {
259
 
                        if(transition.presetSize() == 0 && !transition.hasInhibitorArcs())
 
259
                        if(transition.presetSizeWithoutInhibitorArcs() == 0 && !transition.hasInhibitorArcs())
260
260
                                continue;
261
261
                        
262
262
                        if (!(isTransitionDegree1(transition) || isTransitionDegree2(transition)) || transition.hasInhibitorArcs()) {
430
430
                ta.setLocations(CreateLocationsFromModel(model));
431
431
 
432
432
                for (TimedTransition t : model.transitions()) {
433
 
                        int presetSize = t.presetSize() + t.getInhibitorArcs().size();
 
433
                        int presetSize = t.presetSizeWithoutInhibitorArcs() + t.getInhibitorArcs().size();
434
434
                        
435
435
                        if(presetSize == 0)
436
436
                                continue;