Merge lp:~tapaal-contributor/tapaal/weight-values-fix-1770637 into lp:tapaal

Proposed by Jiri Srba
Status: Merged
Approved by: Jiri Srba
Approved revision: 962
Merged at revision: 962
Proposed branch: lp:~tapaal-contributor/tapaal/weight-values-fix-1770637
Merge into: lp:tapaal
Diff against target: 97 lines (+17/-5)
5 files modified
src/dk/aau/cs/io/PNMLWriter.java (+1/-1)
src/dk/aau/cs/model/tapn/TimedInputArc.java (+4/-0)
src/dk/aau/cs/model/tapn/TimedOutputArc.java (+4/-0)
src/dk/aau/cs/model/tapn/TransportArc.java (+4/-0)
src/dk/aau/cs/verification/TAPNComposer.java (+4/-4)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/weight-values-fix-1770637
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+345478@code.launchpad.net

Commit message

Fixes bug 1770637 where weight names were used instead of constants
in export to PNML and in the composer.

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote :

Tested and works now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/dk/aau/cs/io/PNMLWriter.java'
--- src/dk/aau/cs/io/PNMLWriter.java 2014-06-08 12:58:26 +0000
+++ src/dk/aau/cs/io/PNMLWriter.java 2018-05-13 19:57:55 +0000
@@ -236,7 +236,7 @@
236 arcElement.appendChild(inscription);236 arcElement.appendChild(inscription);
237 Element text = document.createElement("text");237 Element text = document.createElement("text");
238 inscription.appendChild(text);238 inscription.appendChild(text);
239 text.setTextContent(((TimedOutputArcComponent)arc).getWeight().nameForSaving(true)+"");239 text.setTextContent(((TimedOutputArcComponent)arc).getWeight().nameForSaving(false)+"");
240 } 240 }
241 241
242 if(arc instanceof TimedInhibitorArcComponent){242 if(arc instanceof TimedInhibitorArcComponent){
243243
=== modified file 'src/dk/aau/cs/model/tapn/TimedInputArc.java'
--- src/dk/aau/cs/model/tapn/TimedInputArc.java 2014-08-26 15:02:32 +0000
+++ src/dk/aau/cs/model/tapn/TimedInputArc.java 2018-05-13 19:57:55 +0000
@@ -36,6 +36,10 @@
36 return weight;36 return weight;
37 }37 }
38 38
39 public Weight getWeightValue(){
40 return new IntWeight(weight.value());
41 }
42
39 public void setWeight(Weight weight){43 public void setWeight(Weight weight){
40 this.weight = weight;44 this.weight = weight;
41 }45 }
4246
=== modified file 'src/dk/aau/cs/model/tapn/TimedOutputArc.java'
--- src/dk/aau/cs/model/tapn/TimedOutputArc.java 2012-08-14 20:39:56 +0000
+++ src/dk/aau/cs/model/tapn/TimedOutputArc.java 2018-05-13 19:57:55 +0000
@@ -23,6 +23,10 @@
23 public Weight getWeight(){23 public Weight getWeight(){
24 return weight;24 return weight;
25 }25 }
26
27 public Weight getWeightValue(){
28 return new IntWeight(weight.value());
29 }
26 30
27 public void setWeight(Weight weight){31 public void setWeight(Weight weight){
28 this.weight = weight;32 this.weight = weight;
2933
=== modified file 'src/dk/aau/cs/model/tapn/TransportArc.java'
--- src/dk/aau/cs/model/tapn/TransportArc.java 2014-04-08 12:57:51 +0000
+++ src/dk/aau/cs/model/tapn/TransportArc.java 2018-05-13 19:57:55 +0000
@@ -40,6 +40,10 @@
40 public Weight getWeight(){40 public Weight getWeight(){
41 return weight;41 return weight;
42 }42 }
43
44 public Weight getWeightValue(){
45 return new IntWeight(weight.value());
46 }
43 47
44 public void setWeight(Weight weight){48 public void setWeight(Weight weight){
45 this.weight = weight;49 this.weight = weight;
4650
=== modified file 'src/dk/aau/cs/verification/TAPNComposer.java'
--- src/dk/aau/cs/verification/TAPNComposer.java 2018-05-05 07:19:39 +0000
+++ src/dk/aau/cs/verification/TAPNComposer.java 2018-05-13 19:57:55 +0000
@@ -377,7 +377,7 @@
377 } else {377 } else {
378 newInterval.setUpperBound(new IntBound(newInterval.upperBound().value()));378 newInterval.setUpperBound(new IntBound(newInterval.upperBound().value()));
379 }379 }
380 TimedInputArc addedArc = new TimedInputArc(source, target, newInterval, arc.getWeight());380 TimedInputArc addedArc = new TimedInputArc(source, target, newInterval, arc.getWeightValue());
381 constructedModel.add(addedArc);381 constructedModel.add(addedArc);
382 382
383 // Gui work383 // Gui work
@@ -435,7 +435,7 @@
435 String destinationTemplate = arc.destination().isShared() ? "" : tapn.name();435 String destinationTemplate = arc.destination().isShared() ? "" : tapn.name();
436 TimedPlace target = constructedModel.getPlaceByName(mapping.map(destinationTemplate, arc.destination().name()));436 TimedPlace target = constructedModel.getPlaceByName(mapping.map(destinationTemplate, arc.destination().name()));
437437
438 TimedOutputArc addedArc = new TimedOutputArc(source, target, arc.getWeight());438 TimedOutputArc addedArc = new TimedOutputArc(source, target, arc.getWeightValue());
439 constructedModel.add(addedArc);439 constructedModel.add(addedArc);
440 440
441 // Gui work441 // Gui work
@@ -504,7 +504,7 @@
504 } else {504 } else {
505 newInterval.setUpperBound(new IntBound(newInterval.upperBound().value()));505 newInterval.setUpperBound(new IntBound(newInterval.upperBound().value()));
506 }506 }
507 TransportArc addedArc = new TransportArc(source, transition, destination, newInterval, arc.getWeight());507 TransportArc addedArc = new TransportArc(source, transition, destination, newInterval, arc.getWeightValue());
508 constructedModel.add(addedArc);508 constructedModel.add(addedArc);
509 509
510 //Create input transport arc510 //Create input transport arc
@@ -628,7 +628,7 @@
628 } else {628 } else {
629 newInterval.setUpperBound(new IntBound(newInterval.upperBound().value()));629 newInterval.setUpperBound(new IntBound(newInterval.upperBound().value()));
630 }630 }
631 TimedInhibitorArc addedArc = new TimedInhibitorArc(source, target, newInterval, arc.getWeight());631 TimedInhibitorArc addedArc = new TimedInhibitorArc(source, target, newInterval, arc.getWeightValue());
632 constructedModel.add(addedArc);632 constructedModel.add(addedArc);
633 633
634 // Gui work634 // Gui work

Subscribers

People subscribed via source and target branches