Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
trainbenchmark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jesper
trainbenchmark
Commits
45501a10
Commit
45501a10
authored
7 years ago
by
Johannes Mey
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/collection-attribute' into runtime-extensions
parents
3b49d047
9b2c7a1f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
trainbenchmark-tool-jastadd-base/libs/jastadd2.jar
+0
-0
0 additions, 0 deletions
trainbenchmark-tool-jastadd-base/libs/jastadd2.jar
trainbenchmark-tool-jastadd-namelookup-base/src/main/jastadd/TreeNavigation.jrag
+17
-19
17 additions, 19 deletions
...tadd-namelookup-base/src/main/jastadd/TreeNavigation.jrag
with
17 additions
and
19 deletions
trainbenchmark-tool-jastadd-base/libs/jastadd2.jar
+
0
−
0
View file @
45501a10
No preview for this file type
This diff is collapsed.
Click to expand it.
trainbenchmark-tool-jastadd-namelookup-base/src/main/jastadd/TreeNavigation.jrag
+
17
−
19
View file @
45501a10
import java.util.HashSet;
aspect TreeNavigation {
aspect TreeNavigation {
// collections of things
// collections of things
...
@@ -215,29 +217,25 @@ aspect TreeNavigation {
...
@@ -215,29 +217,25 @@ aspect TreeNavigation {
return getTarget().getSwitch();
return getTarget().getSwitch();
}
}
syn Collection<Sensor> TrackElement.monitoredBy() {
coll ArrayList<Sensor> TrackElement.monitoredBy() [new ArrayList()] with add;
return getRoot().monitoredByMap().get(this.id());
}
syn Map<Integer,Set<Sensor>> RailwayContainer.monitoredByMap() {
Sensor contributes this
Map<Integer,Set<Sensor>> sensorMap = new java.util.HashMap<>();
to TrackElement.monitoredBy()
for each monitoredElements();
// fill the keys
RailwayContainer contributes {
for (Region region: getRegionList()) {
// Explicitly traverses regions, skips routes.
for (TrackElement trackElement: region.getTrackElementList()) {
getRegionList().collectContributions();
sensorMap.put(trackElement.id(), new java.util.HashSet<>());
} to TrackElement.monitoredBy();
}
}
// update the values
Region contributes {
for (Sensor sensor : sensors()) {
// Explicitly traverses sensors, skips elements.
for (TrackElementRef trackElementRef : sensor.getMonitoredElementList()) {
getSensorList().collectContributions();
sensorMap.get(trackElementRef.getValue()).add(sensor);
} to TrackElement.monitoredBy();
}
}
return sensorMap;
Sensor contributes {
}
// Stop at sensor, only contains refs.
} to TrackElement.monitoredBy();
syn Collection<Route> Sensor.requiringRoutes() {
syn Collection<Route> Sensor.requiringRoutes() {
return getRoot().requiringRoutesMap().get(this.id());
return getRoot().requiringRoutesMap().get(this.id());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment