-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 320 bug graphical timetable streckengrafik renders only one trainrun segement #325
Merged
aiAdrian
merged 20 commits into
main
from
320-bug-graphical-timetable-streckengrafik-renders-only-one-trainrun-segement
Oct 28, 2024
Merged
fix: 320 bug graphical timetable streckengrafik renders only one trainrun segement #325
aiAdrian
merged 20 commits into
main
from
320-bug-graphical-timetable-streckengrafik-renders-only-one-trainrun-segement
Oct 28, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
SergeCroise
reviewed
Oct 25, 2024
src/app/streckengrafik/services/sg-1-load-trainrun-item.service.ts
Outdated
Show resolved
Hide resolved
images added
…e.ts Co-authored-by: Serge Croisé <[email protected]>
Iterator pattern for iterating through all trainrun parts seperatly getForwardTrainrunPartIterator(trainrunSection : TrainrunSection) {
// find both start nodes ( N1 - N2 - N3 - N4 ) => N1 , N2
const bothEndNodes =
this.trainrunService.getBothEndNodesFromTrainrunPart(trainrunSection);
// get start / end node from Top/Left -> Botton / Right
const startForwardNode = GeneralViewFunctions.getLeftOrTopNode(
bothEndNodes.endNode1,
bothEndNodes.endNode2,
);
// get start trainrun section -> forward direction/orientation
const startTrainrunSection = startForwardNode.getStartTrainrunSection(
trainrun.getId(),
);
// create forward iterator
const iterator: TrainrunIterator = this.trainrunService.getIterator(
startForwardNode,
startTrainrunSection,
);
return iterator;
}
simpleTrainrunAllPartsIterator(trainrun: Trainrun) {
let alltrainrunsections =
this.trainrunSectionService
.getAllTrainrunSectionsForTrainrun(trainrun.getId());
while (alltrainrunsections.length > 0) {
// traverse over all trainrun parts
const iterator= getForwardTrainrunPartIterator(alltrainrunsections[0]);
while (iterator.hasNext()) {
// move iterator forward
const currentTrainrunSectionNodePair = iterator.next();
// get data
const trainrunSection = currentTrainrunSectionNodePair.trainrunSection;
const node = currentTrainrunSectionNodePair.node;
...
user
defined
data
processing
...
// filter all still visited trainrun sections
alltrainrunsections = alltrainrunsections.filter(ts =>
ts.getId() !== trainrunSection.getId()
);
}
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
documentation
Improvements or additions to documentation
enhancement
New feature or request
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change fixes the problem if a trainrun does not have a continuous path from the start to the destination, i.e. if sections are missing in the path that should continuously connect the nodes from the start to the end. These holes are artifacts that can occur during drawing if the train has not been drawn correctly or has not yet been fully drawn. So there can always be a train run that has "holes" along the path, i.e. missing train run sections along the path, e.g.
A - B - C ---- missing --- E - F - G --> also no section between C and E.
The solution to the problem - described above - is proposed in this fix: The trainrun has two parts: [(A B), (A C)] and [(E F)(F G)]. The trainrun is now interpreted as two separate train runs. The network diagram provides no information as to whether the missing part is between C - E, C - D - E, or another possible variant. Thus the best assumption we can make here is that each part of the train run can be interpreted as a single trainrun.
(In principle, however, this should not occur in a perfect Netzgrafik.)
Example Netzgrafik
Graphical timetable
Issues fixed
The issue was fixed in the graphical timetable (Streckengrafik) within the TrainrunSection collector. All trainruns are now selected using the default iteration, which starts at the top-left end and traverses through the trainrun. Previously, if a trainrun had more than one segment the old version only collected a "random" trainrun part. This has now been fixed.
Additionally, the cumulativeTimePropagation for the trainrun had a similar issue, which caused other problems in the graphical timetable. This has also been resolved. Each trainrun segment is now interpreted as a single trainrun and is propagated separately.
The trainrun part issue was as well found in the pearlsview - it's as well resolved.

Checklist
documentation/