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
1=== modified file 'src/dk/aau/cs/io/PNMLWriter.java'
2--- src/dk/aau/cs/io/PNMLWriter.java 2014-06-08 12:58:26 +0000
3+++ src/dk/aau/cs/io/PNMLWriter.java 2018-05-13 19:57:55 +0000
4@@ -236,7 +236,7 @@
5 arcElement.appendChild(inscription);
6 Element text = document.createElement("text");
7 inscription.appendChild(text);
8- text.setTextContent(((TimedOutputArcComponent)arc).getWeight().nameForSaving(true)+"");
9+ text.setTextContent(((TimedOutputArcComponent)arc).getWeight().nameForSaving(false)+"");
10 }
11
12 if(arc instanceof TimedInhibitorArcComponent){
13
14=== modified file 'src/dk/aau/cs/model/tapn/TimedInputArc.java'
15--- src/dk/aau/cs/model/tapn/TimedInputArc.java 2014-08-26 15:02:32 +0000
16+++ src/dk/aau/cs/model/tapn/TimedInputArc.java 2018-05-13 19:57:55 +0000
17@@ -36,6 +36,10 @@
18 return weight;
19 }
20
21+ public Weight getWeightValue(){
22+ return new IntWeight(weight.value());
23+ }
24+
25 public void setWeight(Weight weight){
26 this.weight = weight;
27 }
28
29=== modified file 'src/dk/aau/cs/model/tapn/TimedOutputArc.java'
30--- src/dk/aau/cs/model/tapn/TimedOutputArc.java 2012-08-14 20:39:56 +0000
31+++ src/dk/aau/cs/model/tapn/TimedOutputArc.java 2018-05-13 19:57:55 +0000
32@@ -23,6 +23,10 @@
33 public Weight getWeight(){
34 return weight;
35 }
36+
37+ public Weight getWeightValue(){
38+ return new IntWeight(weight.value());
39+ }
40
41 public void setWeight(Weight weight){
42 this.weight = weight;
43
44=== modified file 'src/dk/aau/cs/model/tapn/TransportArc.java'
45--- src/dk/aau/cs/model/tapn/TransportArc.java 2014-04-08 12:57:51 +0000
46+++ src/dk/aau/cs/model/tapn/TransportArc.java 2018-05-13 19:57:55 +0000
47@@ -40,6 +40,10 @@
48 public Weight getWeight(){
49 return weight;
50 }
51+
52+ public Weight getWeightValue(){
53+ return new IntWeight(weight.value());
54+ }
55
56 public void setWeight(Weight weight){
57 this.weight = weight;
58
59=== modified file 'src/dk/aau/cs/verification/TAPNComposer.java'
60--- src/dk/aau/cs/verification/TAPNComposer.java 2018-05-05 07:19:39 +0000
61+++ src/dk/aau/cs/verification/TAPNComposer.java 2018-05-13 19:57:55 +0000
62@@ -377,7 +377,7 @@
63 } else {
64 newInterval.setUpperBound(new IntBound(newInterval.upperBound().value()));
65 }
66- TimedInputArc addedArc = new TimedInputArc(source, target, newInterval, arc.getWeight());
67+ TimedInputArc addedArc = new TimedInputArc(source, target, newInterval, arc.getWeightValue());
68 constructedModel.add(addedArc);
69
70 // Gui work
71@@ -435,7 +435,7 @@
72 String destinationTemplate = arc.destination().isShared() ? "" : tapn.name();
73 TimedPlace target = constructedModel.getPlaceByName(mapping.map(destinationTemplate, arc.destination().name()));
74
75- TimedOutputArc addedArc = new TimedOutputArc(source, target, arc.getWeight());
76+ TimedOutputArc addedArc = new TimedOutputArc(source, target, arc.getWeightValue());
77 constructedModel.add(addedArc);
78
79 // Gui work
80@@ -504,7 +504,7 @@
81 } else {
82 newInterval.setUpperBound(new IntBound(newInterval.upperBound().value()));
83 }
84- TransportArc addedArc = new TransportArc(source, transition, destination, newInterval, arc.getWeight());
85+ TransportArc addedArc = new TransportArc(source, transition, destination, newInterval, arc.getWeightValue());
86 constructedModel.add(addedArc);
87
88 //Create input transport arc
89@@ -628,7 +628,7 @@
90 } else {
91 newInterval.setUpperBound(new IntBound(newInterval.upperBound().value()));
92 }
93- TimedInhibitorArc addedArc = new TimedInhibitorArc(source, target, newInterval, arc.getWeight());
94+ TimedInhibitorArc addedArc = new TimedInhibitorArc(source, target, newInterval, arc.getWeightValue());
95 constructedModel.add(addedArc);
96
97 // Gui work

Subscribers

People subscribed via source and target branches