Skip to content
Snippets Groups Projects
Commit b9294084 authored by Markus Hamann's avatar Markus Hamann
Browse files

Fixed error with location deletion in extension script

parent 7fc48777
No related branches found
No related tags found
No related merge requests found
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<roadnetworks identifier="DG/1" length="95.0" source="//@locations.0" target="//@locations.3"> <roadnetworks identifier="DG/1" length="95.0" source="//@locations.0" target="//@locations.3">
<roads identifier="A4" length="95.0"/> <roads identifier="A4" length="95.0"/>
</roadnetworks> </roadnetworks>
<roadnetworks identifier="DL/3" length="20.0" source="//@locations.0" target="//@locations.5"> <roadnetworks identifier="DL/3" length="20.0" source="//@locations.0" target="//@locations.4">
<roads identifier="A4" length="20.0"/> <roads identifier="A4" length="20.0"/>
</roadnetworks> </roadnetworks>
<roadnetworks identifier="DL/2" length="67.0" source="//@locations.5" target="//@locations.6"> <roadnetworks identifier="DL/2" length="67.0" source="//@locations.4" target="//@locations.5">
<roads identifier="A14" length="67.0"/> <roads identifier="A14" length="67.0"/>
</roadnetworks> </roadnetworks>
<roadnetworks identifier="DL/1" length="15.0" source="//@locations.6" target="//@locations.2"> <roadnetworks identifier="DL/1" length="15.0" source="//@locations.5" target="//@locations.2">
<roads identifier="A38" length="15.0"/> <roads identifier="A38" length="15.0"/>
</roadnetworks> </roadnetworks>
<roadnetworks identifier="DC/1" length="64.0" source="//@locations.0" target="//@locations.1"> <roadnetworks identifier="DC/1" length="64.0" source="//@locations.0" target="//@locations.1">
...@@ -44,10 +44,6 @@ ...@@ -44,10 +44,6 @@
</locations> </locations>
<locations/> <locations/>
<locations/> <locations/>
<locations/>
<locations/>
<locations/>
<locations/>
<routes identifier="R1" start="//@locations.0" end="//@locations.1"> <routes identifier="R1" start="//@locations.0" end="//@locations.1">
<vehicle identifier="V03" location="//@locations.0" model="eTruck" fuelCapacity="150.0"/> <vehicle identifier="V03" location="//@locations.0" model="eTruck" fuelCapacity="150.0"/>
</routes> </routes>
......
...@@ -34,6 +34,9 @@ rule SplitRoadNetworks ...@@ -34,6 +34,9 @@ rule SplitRoadNetworks
var originalRN:source!RoadNetwork = s.eContainer(); var originalRN:source!RoadNetwork = s.eContainer();
var network:source!TransportationNetwork = originalRN.eContainer(); var network:source!TransportationNetwork = originalRN.eContainer();
network.roadnetworks.add(rn);
network.locations.add(l);
rn.identifier = originalRN.identifier + "/" + originalRN.roads.size(); rn.identifier = originalRN.identifier + "/" + originalRN.roads.size();
rn.roads.add(s); rn.roads.add(s);
rn.length = s.length; rn.length = s.length;
...@@ -43,11 +46,9 @@ rule SplitRoadNetworks ...@@ -43,11 +46,9 @@ rule SplitRoadNetworks
delete l; delete l;
} else{ } else{
rn.target = l; rn.target = l;
}
originalRN.source = l; originalRN.source = l;
}
network.roadnetworks.add(rn);
network.locations.add(l);
} }
rule deleteEmptyRoadNetworks rule deleteEmptyRoadNetworks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment