mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 17:37:09 +01:00
9db76ee180
* fix(editor): track edits keep the joints, the norms, the records and the saved speed together
- The cant typed in the inspector goes on into the track joined at that end, as the gizmo and the
joints tool do it; the neighbours go into the same undo step. The joint stepped before.
- A track laid on from a canted joint takes the cant off along the ramp the norms ask for at the
speed (`alignment::cant_ramp_length`), not at a fixed 1.5 mm a metre whatever the speed and the
norms: 120 mm at 100 km/h over 120 m, not 80 m.
- Deleting a track of the line under the route tool keeps the laying norms. They went back to the
defaults, and every later lay, extend and join used those.
- The gauge is a paste group of its own, off by default: pasting how a track rides or sounds no
longer changes its gauge.
- The speed of a turntable set in the editor is the one saved. The editor changed the speed the
turntable runs at, while the file keeps the limit it was loaded with.
- Deleting a set of tracks does what Del does with each: a double switch, a slip and a crossover go
whole, the records of the switches go with them, and the model and events of a turntable too. The
records stayed behind and on saving were given to another switch, which then showed a wrong type.
- Deleting a switch of a crossover takes the crossover out whole, as the connection tools do: the
outer track of a crossover on a curve comes down by its lift and the record of the connection
goes. Alone, the switch left the outer track up for good, and the connection to the next switch
given its name. A switch bent out of the shape of its record is found by its name.
Tests: a unit test of the norm ramp. The other changes are in the editor's UI, which the unit tests
don't reach.
* test(editor): self-test scripts that fail, a runner, and a case for each fix of the track editing
The editor's self-test scripts only logged: nothing made a run fail. Now:
- `expect` commands check the state and log `SELFTEST PASS` or `SELFTEST FAIL ... got X, expected Y`:
the cant at a track end, the joint at an end (gap, angle, cant step), the records of a switch and
the connections naming it, speed, gauge, a track present or removed, the laying norms' gauge,
heights and lifts against a mark, whether a track is in the line under the route tool, and the
includes of a turntable. A command no group takes counts as a failure, so a mistyped one can't
make the checks after it pass.
- At `quit` the result is logged, and a script whose expectations failed ends the editor with exit
code 2 (a failed start stays 1; the simulator's test mode is unchanged).
- The commit of the inspector's cant field is `track_cant_commit`, which the inspector and the
`trackcant` command both call; `routegauge` sets the laying norms as the route tool does, and
`tracksetdelete` deletes a set of tracks by name.
- `tests/editor/run.py` runs each script of `tests/editor/cases` on a copy of the fixture scenery
in the game folder, with a wall-time limit and a memory cap, reads the exit code and the
`SELFTEST` lines, and deletes the copy. A `#> reopen` line restarts the editor on the saved
scenery. See `tests/editor/README.md`.
- One case per fix of the track editing quick fixes (inspector cant, norms after deleting, the
gauge paste group, turntable speed saved, deleting a set, a set with a double switch, a slip
and a crossover, deleting a switch of a crossover, a bent switch). All pass; with the fixes
reverted all fail.
* feat(editor): the track tool panels keep their fields, results and buttons within the panel
- The card of the tool: after a long gesture the action goes under it, at its indent, when what is
left of the row is narrower than 8 font sizes or the longest word of the action. It was squeezed
into a sliver and broken in the middle of its words.
- A click on the title row of the card folds it to that row (icon, name, family, key, and a small
triangle marker) and opens it again. One flag for all the tools, kept with the editor settings
(`track_card_folded` in eu07_editor.ini), open by default: the card took 250-300 px at the top
of every tool and repeats the hint bar of the view.
- The grade labels of the vertical profile, on the graph and in the view, write the per mille as
the panel does (the translated "per mille", the per mille sign in Polish), not "o/oo".
- The track analysis window: the thresholds of the speed check and of the joints keep to their
widest name and a field of 10 font sizes where the window is wider than that, as docked across
the bottom (`begin_fields_fitted`). The results are tables with each column as wide as what is in
it: the speed check with its column names kept at the top as the list scrolls, the joints with
the kind, the value and the two tracks next to each other. A click on a row shows it as before.
- `same_line_if_fits` puts the next button beside the one before only when it fits in what is left
of the line, at the start of the next line otherwise. Used where the route design puts buttons
side by side, for "Forget the design" in the profile panel, which was cut off at the edge, and for
the buttons of a switch in the inspector.
- The laying options: the speed, the curve radius and the longest path are fields with the name on
the left in two columns (`begin_fields`/`field_row`), as in the inspector, the route and the
profile, the chips of the quick values under them. The segmented choices give the short names
less of the room when a long one doesn't fit in its even share, and go on in a second bar when
they don't fit side by side: "Through the clicked points" overflowed its third of the bar.
* fix(editor): a switch laid gets the speed of its diverging track, one breaking a hard rule of ST-T1-A6 isn't laid
- Every switch laid writes the speed of its diverging track (`velocity`): the switch tool on a
straight, into a curve, from a free end and linked, a double switch, the switches of a slip, a
switch given another template of the catalogue, and a switch moved along the curve it's bent
into. A switch of the catalogue had no limit before, one copied from a switch of the scenery kept
that one's, one laid without a track had the laying speed on both its tracks. The limit is for the
diverging track alone (`velocity -V`); the own limit of the track it goes into stays for both
where it's the lower. The switch tool says the speed and what gives it.
- The speed is formula 9.9 of PKP PLK ST-T1-A6 the other way round, V = sqrt((I + D) r / 11.8), with
the normal cant deficiency of the frog of table 9.7 (110 mm a fixed frog, 130 mm a movable nose),
rounded down to the steps of the speed limits and no more than table 11.2 gives the basic switch.
For the fixed frogs the formula gives table 11.2 itself (190 40, 300 50, 500 60, 760 80, 1200
100 km/h); the 2500-1:26.5 with a movable nose stays 130. A switch bent into a curve takes the
radius of its diverging track from table 11.8 (one-sided r" = (Rr - t^2)/(R + r), two-sided
(Rr + t^2)/(R - r)) and the cant of the line with its sign: leaning against the diverging track it
takes speed away, where the speed check counted it as helping. Rz 60E1-190-1:9 bent out of the
curve R 600 m with 60 mm: 30 km/h, not 40; the 60E1-500-1:12 of the review, out of R 1200 m with
60 mm: 60 km/h at its fixed frog (54 at I = 100 mm, the 0.65 m/s2 the editor took), not 107.
- A switch breaking a hard rule isn't laid, the tracks left as they were, and the switch tool says
why, with the value, the limit and the paragraph: the cant changing within it (11.4 pkt 7), a cant
ramp ending within it or nearer than 6 m (9.6 pkt 16-17; one ending right at an end of the switch
is let be, as the snapping of the start offers it), a double switch, a slip or a crossing bent
(11.4 pkt 4), the curvature of its diverging or its main track turning from one side to the other
(9.7 pkt 12, KZW II). They were warnings shown after the switch was laid, and on a straight the
cant wasn't looked at at all. The line is looked at 10 m past the ends of the curve or the
straight too, so the ramp on the straight before a curve counts. The previews show the refusals.
- A switch moved along its straight or the curve it's bent into, a double switch moved along its
straight, and a switch given another template go through the same checks; one breaking a rule
stays as it is.
- Warnings still: 1:9.403 and steeper than 1:9 bent (11.4 pkt 4c-d), a rule of the running and the
main tracks, which the editor doesn't tell from the side ones, as the warning now says; the limits
of table 11.9 and a cant over 100 mm in a bent switch (table 9.6), as before.
Tests: unit tests of tables 11.8 and 11.9 (the least main radius bends the diverging track to the
least radius the table gives), table 9.7, the speeds of table 11.2 by formula 9.9, the speed of a
bent switch with the cant with its sign (the example of the review), the cant over a switch on a
straight and a double switch bent. Editor cases `q2_1_switch_speed`, `q2_2_switch_refusals` and
`q2_3_switch_move`, with `expect status` (the status of the switch tool) and `expect steps` (the
undo steps), the fixture with a straight taking a cant on and a compound curve without cant. All
pass; with the changes of the editor reverted all three fail.
* test(editor): golden round trips of the tracks and of the //$ lines, the cant at the joints
The safety net of the track editor before its domain model changes (E0 of
editor-tracks-tests.md): what the editor reads from the scenery files and
writes back is read, written and read again in tests/unit, with no game data.
Tracks (test_track_text.cpp, data/tracks/). Entries written the way the game
writes them, read by TTrack::Load() and written by export_as_text(), come out
byte for byte the same, and read again give the same track field by field:
plain tracks with all their attributes (events, speed, isolated, overhead,
vradius, rail profile, friction cell), a curve with cant, radius, uneven,
buckle, cwr and sleeper models, a bridge, switches with trackbed, frogs,
movable nose, blades, uneven of both paths and timbers, a turntable, paths of
pieces, the speeds +40, -40, 0.5, 0 and none of tracks, switches and
turntables, a river, a tributary, a road and a crossing. What the game writes
otherwise than given is checked as it is (table as turn, mountain as
mountains, the length of the path, a switch heard from 10 m, the events in
order, names in lower case, model paths with forward slashes, the texture
length, rolls as floats, no overhead and no vradius left out).
The seam: TTrack built from text with no scene. The engine stubs of the tests
had none of it, so the tests link the few sources reading and writing a track
takes (world/Track.cpp, Segment.cpp, TrackUneven.cpp, MemCell.cpp,
scene/scenenode.cpp, utilities/Timer.cpp, rendering/geometrybank.cpp) and
track_stubs.cpp stands in for the rest: a renderer keeping the materials by
their names, and the scene, events, vehicles and the geometry of the rails,
which reading and writing never reach and which stop the test with their name
if one does. It tests the game's own Load() and export, where a parser of its
own would have meant rewriting Load(), and changes no code of the game. The
stub of basic_node::radius_() goes, scenenode.cpp brings the real one. The
rails don't buckle in the tests (TrackBuckle.cpp needs the environment), the
buckle declared is read and written either way; material names go through a
stand-in, the game's material manager isn't tested here.
The //$ lines (test_editor_records.cpp, data/records/). Their readers and
writers were members of editor_mode, srk_tool and the stores, with the scene
around them; they move as they were into editor/editorRecords.cpp, the one
place each kind is read and written, which the stores call (and which the
migration to the project file of E3 will need apart anyway). The methods of
scene::layer_context move into scene/scenelayercontext.cpp so it links alone.
Each kind, h r k p t w b s c o z, read from golden lines and written back comes
out the same, in the coordinates of the file and of a file placed at an
origin; //$e, the descriptions of the templates, read and saved by
editor_includes in a template in a scratch folder, leaves the file as it was.
Cant (test_cant.cpp). The paths an alignment lays roll by asin(cant/gauge),
signed with the turn, back to the cant of the line at every end; a curve the
other way rolls the other way. At a joint editor_track::match_rolls() gives
the joined track the roll for the travel across it, turned where the paths
face or stand back to back, and the track written keeps it. The inspector's
own conversion on 1500 mm stays in its lambdas here; named, as
editor_mode::cant_of_roll()/roll_of_cant(), it comes with the quick fixes.
Known bugs found, tests of the change each (doctest::should_fail, passing
until fixed, then reported to drop the decorator), data/tracks/known_lost.scn:
- angle1/angle2 are read and dropped: not written back.
- fouling1/fouling2 are read and dropped: not written back.
- name@circuit: the circuit is taken out of the name with the letter before
the @ ("tor1@iso1" becomes track "tor"; substr(0, i - 1)).
- the attributes of the entry (gauge, friction, texture sizes, speed...) are
written to 6 significant digits, a float has 9: more digits are lost on the
first save.
None in the //$ lines.
Unit tests: 957 cases before, 974 after, all passing.
* feat(editor): the norms of the track geometry, a module of their own: the profiles as tables, one engine
Stage E1 of editor-tracks-domain.md (§3, §6): the norms stand on their own in editor/norms, with no scene, no tracks and no user
interface, so they are tested whole in tests/unit. Nothing of the editor uses them yet but the report of the next commit;
alignment::limits stays as the laying tools use it.
- The profiles are tables of rows (normsTables.cpp). A row holds the limits of PREFER / WARN / BLOCK of one parameter where its
conditions hold (a band of the speed, of the radius or of the load, main or side track, the traffic, a switch and its frog, a
crossing, an expansion device, a platform, a station track, ballastless track, crest or sag), with the table or the paragraph of
its document. Where several rows hold the strictest limit of each tier counts. A cell can be unconfirmed: it warns, never blocks.
- PLK, ST-T1-A6 v1.0: P0 PREFER, P1 WARN, P2 BLOCK; tab. 8.1, 9.1, 9.2, 9.6 - 9.8, 9.10, 9.12 - 9.16, 10.1, 10.2, formula 9.8.
- TSI only, Reg. 1299/2014 consolidated 28.9.2023: BLOCK; 4.2.3.3 - 4.2.3.5, 4.2.4.2 - 4.2.4.4.
- EN 13803-1:2010 5.2.1 - 5.2.5: normal WARN, exceptional BLOCK.
- CH, AB-EBV AB 17 (Normalspur, 1.7.2024): Grenzwert im Normalfall WARN, maximaler Grenzwert BLOCK.
- In every profile the global hard limits of §6.3: the TSI rows and the cant gradient of 2.5 mm/m (EN 13803-1 5.2.5, the twist).
- The line class: Vmax, Vmin of the slow trains (by tab. 8.1 when not given), passenger / mixed / freight, main or side track,
the load, and what holds along the line (platform, station, ballastless, suburban, tilting).
- One engine (normsEngine.cpp) over a line of elements (straights, transitions, arcs, the curvature changing evenly along each),
its cant (points, a step being two at one chainage) and its grade line: I at Vmax and E at Vmin; dI/dt along the transitions
and the ramps; ΔI at every jump of the curvature or of the cant, the jumps closer than the intermediate length of the profile
(tab. 9.16) taken together while the deficiency keeps changing one way (9.11 pkt 8 - 13); dD/ds and dD/dt along the ramps, a
step of the cant as its twist on the 5 m base; the lengths of the straights, arcs and transitions and the shift of the arc; R;
D with (R - 50) / 1.5 and the least cant; Rv and the breaks of the grade over 2 per mille; the held grades. A finding names the
parameter, the value, the limit, the tier, the profile, the source, confirmed or not, hard or not, and the chainage. The module
makes no text, its users write the messages.
- Areas (§6.4): the default profile of the scenery, areas outlined in the plan, lines by name (a line's own wins). An element with
its ends under two profiles is checked against both, the worse kept (the stricter one); an arc across a boundary is a warning.
- describe() reads a line from samples along it (the curvature, the cant and the grade simplified by Douglas and Peucker), with a
precision of 0.2 % for the values measured on it.
- The formulas of ST-T1-A6 9.1 - 9.10: Deq, Dreg, I, E, Dmin, Dmax, Rmin, V.
The sources, and what they gave:
- The cells of ST-T1-A6 spanning two or three columns (tab. 9.1, 9.6, 9.7, 9.13 - 9.15, 10.1, 10.2; §6.5 pkt 4) were read on the
pages of the PDF. Tab. 9.15 has for the connections of tracks P0 = P1 = 80 mm at 100 < V <= 160 and 60 mm at 160 < V <= 200,
P2 160 - 0.35 V; the table of §6.2 has P1 = 160 - 0.35 V there. Tab. 9.1 has P1 = P0 (one cell), not "-".
- TSI tab. 8 (§6.5 pkt 3): the 153 mm spans both columns up to 300 km/h, 100 mm only above 300 km/h.
- Unconfirmed, warning only: tab. 9.8, 5 < q <= 10, P0 95 mm, and tab. 9.7, movable frog 230 < V <= 250, P2 110 mm (as printed,
out of line with the rows around them); EN 13803-2:2006+A1:2009 7.1.3, ΔI of the plain line 50 / 40 / 30 mm, read from a garbled
preview.
- Not there: ST-T1-A6 tab. 9.4 (a picture); EN 13803-1 dD/dt, dI/dt, ΔI in S&C, element lengths, Rv and grades (beyond the part of
the standard published as its preview); AB-EBV a limit of the grade of a line, the least cant, the table of the buffer locking of
5.4.2; the TSI has no dD/ds, dD/dt nor dI/dt. DB (Ril 800.0110) is left out: it isn't published, its values are known from
secondary sources only.
- Simplified: the (R - 50) / 1.5 of the TSI holds for every R < 305 m of mixed and freight traffic, leaving out its condition of
a ramp steeper than 1 mm/m; the intermediate element of tab. 9.16 between transitions is the one of tab. 9.1 at P2 (tab. 9.10 at
P2 would do there); a switch has a fixed frog unless the track says it moves; the track is ballasted unless the class says not.
Tests: test_norms_tables.cpp, every value of the PLK tables and of the TSI with its table in the name of the test, the edges of the
bands (a speed on the boundary, R 300, 250 and 200 m), some of EN and AB-EBV; test_norms_engine.cpp, the examples of ST-T1-A6
(Z1-1, Z1-2, załącznik 2, the ramps of Z3-2 and Z3-3), I at Vmax and E at Vmin, ΔI of arcs turning alike and the other way, taken
together over a short straight or not, dD/ds, dD/dt, a step of the cant, dI/dt, the lengths, the vertical curves, the areas and the
boundary, describe().
* feat(editor): the norms checked on the tracks laid, read only: a Norms tab of the track analysis and its report
The second half of E1: what the tracks of a scenery are against a profile of the norms, listed. Nothing of the tracks is changed.
- editor/editorNormsReport: a line of paths sampled a metre apart, two samples at each joint, into what the norms read a line
from: the plan, the curvature signed by the turn, the cant on the base of 1500 mm (as the simulator takes the rolls) signed by
the side it leans to as the line runs, the grade, the speed of each path (a switch's for its diverging track alone too), and
what the path is a part of (a switch, its diverging track, a curved switch, a movable frog, a crossing). The line described,
checked, and each finding set back on its path with a point of it; its message, "cant ramp 3.00 mm/m, PLK allows at most 2.50 mm/m
(tab. 9.12)", "break of the grade with no vertical curve, PLK asks for a radius of at least 2500 m (tab. 10.2)", through STR_C;
the text of the report: the class, the elements, the cant, the grade line and the findings of each line.
- The Norms tab of the track window, under More beside Speed and Joints, no key; its window is ###trackanalysis, as theirs. The
line through the selected path (run_route, as the speed check walks it) or the whole scenery: the lines through the plain tracks,
then each path of a switch none of them ran along, checked with the line it lies in and its own findings kept, a place two lines
run through listed once. The profile (PLK by default) and the class of the line folded under a line saying it: the line speed for
the tracks with none of their own (on by default: the speed of each track), the slow trains (tab. 8.1 by default), the traffic,
main track or siding, the load, at a platform. The results in the table of the speed check and the joints, the worst first,
coloured by the tier, the values above the recommended ones on a tick; a click on a row shows the place, the hard limits and the
warnings are marked in the view. The icon is drawn into its own cell of editor_icons.png only (the generator has it): the sheet
drawn again with this Pillow differs in other cells.
- Self-test: normsreport <file> [scope] [plk|tsi|en|ch] [km/h] writes the report to the file; expect findings <tier> <least> <most>;
the case e1_norms_report checks the curves k0..k3 of the fixture at 60 km/h against PLK and the whole scenery against the TSI.
- Golden: data/norms/line.scn, a line of 14 tracks written by make_line.py there (curves with and without transitions, cant on and
off a curve and along a straight, reverse curves 10 m apart, short straights, a grade with breaks), and its report against the
four profiles in data/norms/line_report.txt; EU07_UNIT_TESTS_UPDATE_GOLDEN=1 writes it anew. A test lays a canted corner with the
alignment of the editor and finds the samples leaning into it, both turns and run both ways, I = Deq - D.
alignment::limits stays as the laying tools use it. Where its values differ from PLK P0:
- unbalanced 0.6 m/s2 is I 92 mm on the 1500 mm base; P0 110 mm (P1 130) on the running lines, 80 on the sidings;
- ramp_factor 10, a ramp of 1:(10 V), 1 mm/m at 100 km/h and 2.5 mm/m at 40 km/h, has no counterpart: P0 1.6 mm/m at any speed;
- jerk 0.3 m/s3 is dI/dt 46 mm/s; P0 55 mm/s;
- vertical_factor 0.4 V^2 and vertical_min 2000 m; P0 max(0.77 V^2, 5000 m) (P1 max(0.35 V^2, 5000), P2 max(0.25 V^2, 2000));
- arc_min 20 m and arc_min_factor 0.4 V; P0 max(0.35 V, 30 m) up to 120 km/h, 0.40 V up to 200 km/h, also for the straights, where
tangent_min_time is 0;
- the same: cant_max 150 mm (P0 = P1 = P2 on ballast), cant_rate 35 mm/s (P0 of tab. 9.13), the base of 1500 mm.
* test(editor): a mistyped track fails the self-test, indented comments are skipped, case 7b checks the switch got bent
- A blank line or an indented `#` comment in a script is no longer a command no group takes.
- `trackcant`, `routegauge` and `tracksetdelete` with a track that isn't there count as a failed expectation.
- `expect shaped <switch> <yes|no>`: 7b checks that the gizmo drag bent the switch out of its record before deleting it.
- The ramp-length loop of test_alignment counts in an integer (Sonar S2193).
* test(editor): the entries known to be lost are checked apart from should_fail, the cant test says where the inspector conversion is tested
- A normal test checks that known_lost.scn and each of its entries are there and read, so the should_fail tests can't pass for
data gone missing.
- The comment of test_cant.cpp said the tests of cant_of_roll()/roll_of_cant() are here; they are the self-test case
1_inspector_cant.txt, as the unit tests don't link the editor.
* fix(editor): TSI and EN take close jumps of the cant deficiency together, the norms queue keeps its own span after a delete
- TSI INF and EN 13803 limit an abrupt change of the cant deficiency but give no intermediate length, so two jumps a few metres
apart were each checked alone: at km 478 of the golden line CH reported 191 mm over the TSI limit, TSI itself nothing. With
no intermediate length in the profiles of the element, the longest any profile asks for is taken. The golden report changes
that way: TSI gets the 191 mm hard limit at km 478, EN reports it instead of 106 and 85 mm one by one.
- forget() moves the span whose findings alone are kept (a diverging track) down by the spans removed before it, and drops a
queued line whose own span was removed, instead of leaving the index on another span.
- The report test of R 400 / 80 mm runs at 90 km/h and requires the finding: at 80 km/h there was none and the check never ran.
417 lines
20 KiB
C++
417 lines
20 KiB
C++
// the engine of the norms (editor/norms): the formulas of the cant with the examples of ST-T1-A6, the tier of a value, and lines
|
|
// described as elements checked: the cant deficiency at the highest speed and the excess at the slow trains, the abrupt changes of the
|
|
// cant deficiency of curves turning alike and the other way, taken together over a short element, the rates of change along the ramps
|
|
// and the transitions; the profiles of the areas, the stricter one on a boundary; a line read from its samples as elements
|
|
|
|
#include "stdafx.h"
|
|
#include "doctest.h"
|
|
#include "editor/norms/norms.hpp"
|
|
|
|
#include <algorithm>
|
|
#include <cmath>
|
|
#include <optional>
|
|
#include <vector>
|
|
|
|
namespace {
|
|
|
|
using norms::element_kind;
|
|
using norms::parameter;
|
|
using norms::profile_id;
|
|
using norms::tier;
|
|
|
|
// a line of elements one after another along x, the curvature signed, positive to the left
|
|
class line_builder {
|
|
public:
|
|
line_builder &straight(double const Length, double const Speed) { return add(element_kind::straight, Length, 0.0, 0.0, Speed); }
|
|
line_builder &arc(double const Radius, double const Length, double const Speed) { return add(element_kind::arc, Length, 1.0 / Radius, 1.0 / Radius, Speed); }
|
|
line_builder &transition(double const From, double const To, double const Length, double const Speed) {
|
|
return add(element_kind::transition, Length, From != 0.0 ? 1.0 / From : 0.0, To != 0.0 ? 1.0 / To : 0.0, Speed);
|
|
}
|
|
// the cant, mm, from here on evenly to the given at the chainage
|
|
line_builder &cant(double const Chainage, double const Cant) {
|
|
m_line.cant.push_back({Chainage, Cant});
|
|
return *this;
|
|
}
|
|
line_builder &features(unsigned const Features) {
|
|
m_line.elements.back().features = Features;
|
|
return *this;
|
|
}
|
|
norms::line done() {
|
|
if (m_line.grades.empty()) {
|
|
m_line.grades.push_back({0.0, m_end, 0.0, 0.0});
|
|
}
|
|
m_line.elements.front().open_start = true;
|
|
m_line.elements.back().open_end = true;
|
|
return m_line;
|
|
}
|
|
double end() const { return m_end; }
|
|
|
|
private:
|
|
norms::line m_line;
|
|
double m_end{0.0};
|
|
|
|
line_builder &add(element_kind const Kind, double const Length, double const From, double const To, double const Speed) {
|
|
norms::element element;
|
|
element.kind = Kind;
|
|
element.start = m_end;
|
|
element.length = Length;
|
|
element.curvature_start = From;
|
|
element.curvature_end = To;
|
|
element.speed = Speed;
|
|
element.from = {m_end, 0.0};
|
|
element.to = {m_end + Length, 0.0};
|
|
m_line.elements.push_back(element);
|
|
m_end += Length;
|
|
return *this;
|
|
}
|
|
};
|
|
|
|
norms::line_class mixed_main(double const Vmax = 100.0) {
|
|
norms::line_class result;
|
|
result.vmax = Vmax;
|
|
result.kind = norms::traffic::mixed;
|
|
result.track = norms::track_kind::main;
|
|
result.load = 5.0;
|
|
return result;
|
|
}
|
|
|
|
std::vector<norms::finding> evaluate(norms::line const &Line, norms::line_class const &Class, profile_id const Profile = profile_id::plk) {
|
|
norms::area_map areas;
|
|
areas.scenery = Profile;
|
|
return norms::evaluate(Line, Class, areas);
|
|
}
|
|
|
|
std::vector<norms::finding> of(std::vector<norms::finding> const &Findings, parameter const What) {
|
|
std::vector<norms::finding> result;
|
|
std::ranges::copy_if(Findings, std::back_inserter(result), [What](norms::finding const &Finding) { return Finding.what == What; });
|
|
return result;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
TEST_CASE("norms engine: the cant of ST-T1-A6 załącznik 1, Z1-1, P160 R 2000 m, I 90 mm fast and 20 mm slow") {
|
|
// the highest speed with I 90 mm at the fast trains and 20 mm at the slow ones of 120 km/h: 162 km/h
|
|
CHECK(norms::speed_for_deficiencies(2000.0, 90.0, 20.0, 120.0) == doctest::Approx(162.0).epsilon(0.005));
|
|
CHECK(norms::least_cant(160.0, 2000.0, 90.0) == doctest::Approx(61.0).epsilon(0.005));
|
|
CHECK(norms::least_cant(120.0, 2000.0, 20.0) == doctest::Approx(65.0).epsilon(0.005));
|
|
}
|
|
|
|
TEST_CASE("norms engine: the cant of ST-T1-A6 załącznik 1, Z1-2, M160 R 1200 m, Vmin 80 km/h") {
|
|
CHECK(norms::speed_for_deficiencies(1200.0, 90.0, 20.0, 80.0) == doctest::Approx(116.0).epsilon(0.005));
|
|
// Dmin with Idop 130 mm, written 121 mm (121.7), Dmax with Edop 80 mm 143 mm, Deq 251 mm, Dreg 139 mm
|
|
CHECK(norms::least_cant(160.0, 1200.0, 130.0) == doctest::Approx(121.7).epsilon(0.001));
|
|
CHECK(norms::greatest_cant(80.0, 1200.0, 80.0) == doctest::Approx(143.0).epsilon(0.002));
|
|
CHECK(norms::equilibrium_cant(160.0, 1200.0) == doctest::Approx(251.7).epsilon(0.001));
|
|
CHECK(norms::regular_cant(160.0, 1200.0) == doctest::Approx(139.0).epsilon(0.003));
|
|
}
|
|
|
|
TEST_CASE("norms engine: the regular cant of the compound curve of ST-T1-A6 załącznik 2, 105, 96 and 83 mm, 95 mm on average") {
|
|
auto const first{norms::regular_cant(160.0, 1590.0)};
|
|
auto const second{norms::regular_cant(160.0, 1730.0)};
|
|
auto const third{norms::regular_cant(160.0, 2000.0)};
|
|
CHECK(std::round(first) == 105.0);
|
|
CHECK(std::round(second) == 96.0);
|
|
CHECK(std::round(third) == 83.0);
|
|
CHECK(std::round((first + second + third) / 3.0) == 95.0);
|
|
CHECK(norms::cant_deficiency(160.0, 1590.0, 95.0) == doctest::Approx(11.8 * 160 * 160 / 1590.0 - 95.0));
|
|
CHECK(norms::cant_excess(100.0, 1590.0, 95.0) == doctest::Approx(95.0 - 11.8 * 100 * 100 / 1590.0));
|
|
CHECK(norms::least_radius(160.0, 95.0, 130.0) == doctest::Approx(11.8 * 160 * 160 / 225.0));
|
|
CHECK(norms::greatest_speed(1590.0, 95.0, 130.0) == doctest::Approx(std::sqrt(225.0 * 1590.0 / 11.8)));
|
|
}
|
|
|
|
TEST_CASE("norms engine: a cant gradient of ST-T1-A6 przykład Z3-2 and Z3-3, 2.28 and 2.25 mm/m, passes P1 within P2") {
|
|
norms::query where;
|
|
where.speed = 50.0;
|
|
for (auto const gradient : {2.28, 2.25}) {
|
|
CAPTURE(gradient);
|
|
auto const verdict{norms::assess(parameter::cant_gradient, gradient, norms::limits(profile_id::plk, parameter::cant_gradient, where), norms::hard_limits(parameter::cant_gradient, where))};
|
|
CHECK(verdict.level == tier::warn);
|
|
CHECK(verdict.passed.value == doctest::Approx(2.0));
|
|
CHECK(verdict.passed.from.place == "tab. 9.12");
|
|
}
|
|
}
|
|
|
|
TEST_CASE("norms engine: a value beyond an unconfirmed extended limit warns, beyond a hard one it blocks") {
|
|
norms::query where;
|
|
where.speed = 240.0;
|
|
where.features = norms::feature::switch_track | norms::feature::movable_frog;
|
|
auto const limits{norms::limits(profile_id::plk, parameter::cant_deficiency, where)};
|
|
auto const hard{norms::hard_limits(parameter::cant_deficiency, where)};
|
|
auto const beyond_p2{norms::assess(parameter::cant_deficiency, 120.0, limits, hard)};
|
|
CHECK(beyond_p2.level == tier::warn);
|
|
CHECK_FALSE(beyond_p2.passed.confirmed);
|
|
auto const beyond_tsi{norms::assess(parameter::cant_deficiency, 160.0, limits, hard)};
|
|
CHECK(beyond_tsi.level == tier::block);
|
|
CHECK(beyond_tsi.hard);
|
|
CHECK(beyond_tsi.passed.value == doctest::Approx(153.0));
|
|
// within P0 nothing, between P0 and P1 above the recommended value
|
|
CHECK(norms::assess(parameter::cant_deficiency, 70.0, limits, hard).level == tier::none);
|
|
CHECK(norms::assess(parameter::cant_deficiency, 80.0, limits, hard).level == tier::none);
|
|
norms::query plain;
|
|
plain.speed = 100.0;
|
|
CHECK(norms::assess(parameter::cant_deficiency, 120.0, norms::limits(profile_id::plk, parameter::cant_deficiency, plain), hard).level == tier::prefer);
|
|
}
|
|
|
|
TEST_CASE("norms engine: the cant deficiency at the highest speed and the excess at the slow trains of an arc") {
|
|
// R 600 m, transitions of 60 m, the cant 60 mm: at 100 km/h I = 196.7 - 60 = 136.7 mm, above P1 130, within P2 150
|
|
line_builder builder;
|
|
builder.straight(200, 100).transition(0, 600, 60, 100).arc(600, 300, 100).transition(600, 0, 60, 100).straight(200, 100);
|
|
builder.cant(200, 0).cant(260, 60).cant(560, 60).cant(620, 0);
|
|
auto const findings{evaluate(builder.done(), mixed_main())};
|
|
auto const deficiency{of(findings, parameter::cant_deficiency)};
|
|
REQUIRE_FALSE(deficiency.empty());
|
|
auto const &arc{*std::ranges::find_if(deficiency, [](norms::finding const &Finding) { return Finding.element == 2; })};
|
|
CHECK(arc.value == doctest::Approx(11.8 * 100 * 100 / 600.0 - 60.0));
|
|
CHECK(arc.level == tier::warn);
|
|
CHECK(arc.limit == doctest::Approx(130.0));
|
|
CHECK(arc.from.place == "tab. 9.7");
|
|
CHECK(of(findings, parameter::cant_excess).empty());
|
|
|
|
// the cant of 150 mm on it and slow trains of 40 km/h: E = 150 - 31.5 = 118.5 mm, above P2 110 (q <= 5 Tg a year)
|
|
line_builder steep;
|
|
steep.straight(200, 100).transition(0, 600, 100, 100).arc(600, 300, 100).transition(600, 0, 100, 100).straight(200, 100);
|
|
steep.cant(200, 0).cant(300, 150).cant(600, 150).cant(700, 0);
|
|
auto slow{mixed_main()};
|
|
slow.vmin = 40.0;
|
|
auto const excess{of(evaluate(steep.done(), slow), parameter::cant_excess)};
|
|
REQUIRE_FALSE(excess.empty());
|
|
auto const &worst{*std::ranges::max_element(excess, {}, &norms::finding::value)};
|
|
CHECK(worst.value == doctest::Approx(150.0 - 11.8 * 40 * 40 / 600.0));
|
|
CHECK(worst.level == tier::block);
|
|
CHECK(worst.limit == doctest::Approx(110.0));
|
|
CHECK(worst.speed == doctest::Approx(40.0));
|
|
}
|
|
|
|
TEST_CASE("norms engine: the abrupt change of the cant deficiency between arcs turning alike and turning the other way") {
|
|
// R 1000 m straight into R 500 m at 80 km/h with no transition: I 75.5 and 151 mm
|
|
auto const i1{11.8 * 80 * 80 / 1000.0};
|
|
auto const i2{11.8 * 80 * 80 / 500.0};
|
|
line_builder alike;
|
|
alike.straight(100, 80).arc(1000, 200, 80).arc(500, 200, 80).straight(100, 80);
|
|
auto const same{of(evaluate(alike.done(), mixed_main(80)), parameter::deficiency_jump)};
|
|
auto const between = [](std::vector<norms::finding> const &Findings, double const Chainage) {
|
|
return std::ranges::find_if(Findings, [Chainage](norms::finding const &Finding) { return std::abs(Finding.chainage - Chainage) < 1e-6; });
|
|
};
|
|
auto const turning{between(same, 300.0)};
|
|
REQUIRE(turning != same.end());
|
|
CHECK(turning->value == doctest::Approx(i2 - i1));
|
|
CHECK(turning->level == tier::block);
|
|
|
|
line_builder reverse;
|
|
reverse.straight(100, 80).arc(1000, 200, 80);
|
|
reverse.arc(-500, 200, 80).straight(100, 80);
|
|
auto const other{of(evaluate(reverse.done(), mixed_main(80)), parameter::deficiency_jump)};
|
|
auto const reversing{between(other, 300.0)};
|
|
REQUIRE(reversing != other.end());
|
|
CHECK(reversing->value == doctest::Approx(i1 + i2));
|
|
// above the 125 mm of the TSI too: blocked by PLK, the stricter
|
|
CHECK(reversing->level == tier::block);
|
|
CHECK(reversing->limit == doctest::Approx(50.0));
|
|
}
|
|
|
|
TEST_CASE("norms engine: the abrupt changes over a straight shorter than tab. 9.16 asks for are taken together, the other way round or longer one by one") {
|
|
// reverse curves of R 400 m at 60 km/h, I 106.2 mm each, with no transitions; the intermediate length at 60 km/h is 20 m
|
|
auto const each{11.8 * 60 * 60 / 400.0};
|
|
auto const jumps = [](double const Between, double const Second) {
|
|
line_builder builder;
|
|
builder.straight(100, 60).arc(400, 80, 60).straight(Between, 60).arc(Second, 80, 60).straight(100, 60);
|
|
return of(evaluate(builder.done(), mixed_main(60)), parameter::deficiency_jump);
|
|
};
|
|
auto const close{jumps(10.0, -400.0)};
|
|
auto const summed{std::ranges::find_if(close, [](norms::finding const &Finding) { return std::abs(Finding.chainage - 180.0) < 1e-6; })};
|
|
REQUIRE(summed != close.end());
|
|
CHECK(summed->value == doctest::Approx(2.0 * each));
|
|
CHECK(summed->length == doctest::Approx(10.0));
|
|
CHECK(summed->level == tier::block);
|
|
// 30 m apart: each by itself
|
|
auto const apart{jumps(30.0, -400.0)};
|
|
for (auto const &finding : apart) {
|
|
CAPTURE(finding.chainage);
|
|
CHECK(finding.value == doctest::Approx(each));
|
|
CHECK(finding.length == 0.0);
|
|
}
|
|
CHECK(apart.size() == 4);
|
|
// turning alike, the deficiency falls and rises again: no monotonic change, each by itself
|
|
for (auto const &finding : jumps(10.0, 400.0)) {
|
|
CHECK(finding.value == doctest::Approx(each));
|
|
}
|
|
}
|
|
|
|
TEST_CASE("norms engine: TSI and EN, which say nothing of jumps close together, take them together over the intermediate length of the other profiles") {
|
|
// the reverse curves of the test above, 10 m apart: each jump of 106.2 mm passes the TSI, their 212.4 mm don't
|
|
auto const each{11.8 * 60 * 60 / 400.0};
|
|
for (auto const profile : {profile_id::tsi, profile_id::en13803}) {
|
|
CAPTURE(static_cast<int>(profile));
|
|
line_builder builder;
|
|
builder.straight(100, 60).arc(400, 80, 60).straight(10.0, 60).arc(-400, 80, 60).straight(100, 60);
|
|
auto const found{of(evaluate(builder.done(), mixed_main(60), profile), parameter::deficiency_jump)};
|
|
auto const summed{std::ranges::find_if(found, [](norms::finding const &Finding) { return std::abs(Finding.chainage - 180.0) < 1e-6; })};
|
|
REQUIRE(summed != found.end());
|
|
CHECK(summed->value == doctest::Approx(2.0 * each));
|
|
CHECK(summed->length == doctest::Approx(10.0));
|
|
}
|
|
}
|
|
|
|
TEST_CASE("norms engine: the gradient and the rate of change of the cant along a ramp, the rate of change of the deficiency along a transition") {
|
|
// 100 mm over 50 m at 120 km/h: 2 mm/m, 66.7 mm/s
|
|
line_builder ramp;
|
|
ramp.straight(300, 120);
|
|
ramp.cant(0, 0).cant(100, 0).cant(150, 100).cant(300, 100);
|
|
auto const ramped{evaluate(ramp.done(), mixed_main(120))};
|
|
auto const gradient{of(ramped, parameter::cant_gradient)};
|
|
REQUIRE(gradient.size() == 1);
|
|
CHECK(gradient.front().value == doctest::Approx(2.0));
|
|
CHECK(gradient.front().level == tier::prefer);
|
|
auto const rate{of(ramped, parameter::cant_rate)};
|
|
REQUIRE(rate.size() == 1);
|
|
CHECK(rate.front().value == doctest::Approx(2.0 * 120 / 3.6));
|
|
CHECK(rate.front().level == tier::block);
|
|
CHECK(rate.front().from.place == "tab. 9.13");
|
|
// a step of the cant: the twist of 15 mm on the base of 5 m, 3 mm/m, beyond the 2.5 mm/m of every profile
|
|
line_builder step;
|
|
step.straight(300, 80);
|
|
step.cant(0, 0).cant(150, 0).cant(150, 15).cant(300, 15);
|
|
auto const stepped{of(evaluate(step.done(), mixed_main(80), profile_id::tsi), parameter::cant_gradient)};
|
|
REQUIRE(stepped.size() == 1);
|
|
CHECK(stepped.front().value == doctest::Approx(3.0));
|
|
CHECK(stepped.front().level == tier::block);
|
|
CHECK(stepped.front().hard);
|
|
// a transition of 40 m to R 500 m with no cant at 80 km/h: 151 mm over 40 m, 83.9 mm/s
|
|
line_builder curve;
|
|
curve.straight(100, 80).transition(0, 500, 40, 80).arc(500, 100, 80).transition(500, 0, 40, 80).straight(100, 80);
|
|
auto const change{of(evaluate(curve.done(), mixed_main(80)), parameter::deficiency_rate)};
|
|
REQUIRE(change.size() == 2);
|
|
CHECK(change.front().value == doctest::Approx(11.8 * 80 * 80 / 500.0 * 80 / (3.6 * 40.0)));
|
|
CHECK(change.front().level == tier::block);
|
|
}
|
|
|
|
TEST_CASE("norms engine: the lengths of the elements, the transition curves and the radius") {
|
|
line_builder builder;
|
|
builder.straight(100, 100).arc(400, 20, 100).straight(28, 100).transition(0, 400, 20, 100).arc(400, 100, 100).transition(400, 0, 60, 100).straight(100, 100);
|
|
builder.cant(0, 0).cant(148, 0).cant(168, 30).cant(268, 30).cant(328, 0);
|
|
auto const findings{evaluate(builder.done(), mixed_main(100))};
|
|
auto const lengths{of(findings, parameter::element_length)};
|
|
// the arc of 20 m below the 25 m of P2, the straight of 28 m below the 35 m of P1
|
|
REQUIRE(lengths.size() == 2);
|
|
CHECK(lengths[0].level == tier::block);
|
|
CHECK(lengths[0].limit == doctest::Approx(25.0));
|
|
CHECK(lengths[1].level == tier::warn);
|
|
CHECK(lengths[1].limit == doctest::Approx(35.0));
|
|
auto const transitions{of(findings, parameter::transition_length)};
|
|
REQUIRE(transitions.size() == 1);
|
|
CHECK(transitions.front().value == doctest::Approx(20.0));
|
|
CHECK(transitions.front().level == tier::warn);
|
|
auto const radii{of(findings, parameter::radius)};
|
|
REQUIRE_FALSE(radii.empty());
|
|
CHECK(radii.front().value == doctest::Approx(400.0));
|
|
CHECK(radii.front().level == tier::prefer);
|
|
}
|
|
|
|
TEST_CASE("norms engine: the vertical curves, a break of the grade and the grade") {
|
|
line_builder builder;
|
|
builder.straight(1000, 100);
|
|
auto line{builder.done()};
|
|
// level, a break to 8 per mille rising, a vertical curve of 40 m back to level (R 5000 m), then level
|
|
line.grades = {{0.0, 300.0, 0.0, 0.0}, {300.0, 200.0, 0.008, 0.008}, {500.0, 40.0, 0.008, 0.0}, {540.0, 460.0, 0.0, 0.0}};
|
|
auto const findings{evaluate(line, mixed_main(100))};
|
|
auto const vertical{of(findings, parameter::vertical_radius)};
|
|
REQUIRE(vertical.size() == 2);
|
|
CHECK(vertical[0].value == 0.0);
|
|
CHECK(vertical[0].level == tier::block);
|
|
CHECK(vertical[0].limit == doctest::Approx(2500.0));
|
|
CHECK(vertical[1].value == doctest::Approx(5000.0));
|
|
CHECK(vertical[1].level == tier::prefer);
|
|
auto const grades{of(findings, parameter::grade)};
|
|
REQUIRE(grades.size() == 1);
|
|
CHECK(grades.front().value == doctest::Approx(8.0));
|
|
CHECK(grades.front().level == tier::prefer);
|
|
}
|
|
|
|
TEST_CASE("norms engine: an element on the boundary of two areas gets the stricter profile, an arc across it a warning") {
|
|
// TSI west of x = 150, PLK elsewhere: a ramp of 2.2 mm/m is nothing to the TSI and a warning to PLK
|
|
norms::area_map areas;
|
|
areas.scenery = profile_id::plk;
|
|
areas.areas.push_back({"west", profile_id::tsi, {{-1000.0, -1000.0}, {150.0, -1000.0}, {150.0, 1000.0}, {-1000.0, 1000.0}}});
|
|
auto const ramp_at = [&areas](double const From) {
|
|
line_builder builder;
|
|
builder.straight(100, 100).straight(100, 100).straight(100, 100);
|
|
builder.cant(0, 0).cant(From, 0).cant(From + 50, 110).cant(300, 110);
|
|
return of(norms::evaluate(builder.done(), mixed_main(100), areas), parameter::cant_gradient);
|
|
};
|
|
// on the element from 0 to 100, all of it in the TSI area
|
|
CHECK(ramp_at(20.0).empty());
|
|
// on the element from 100 to 200, across the boundary: PLK
|
|
auto const across{ramp_at(120.0)};
|
|
REQUIRE(across.size() == 1);
|
|
CHECK(across.front().profile == profile_id::plk);
|
|
CHECK(across.front().level == tier::warn);
|
|
// on the element from 200 to 300, in PLK
|
|
REQUIRE(ramp_at(220.0).size() == 1);
|
|
|
|
line_builder curve;
|
|
curve.straight(100, 100).arc(2000, 100, 100).straight(100, 100);
|
|
auto const boundary{of(norms::evaluate(curve.done(), mixed_main(100), areas), parameter::profile_boundary)};
|
|
REQUIRE(boundary.size() == 1);
|
|
CHECK(boundary.front().level == tier::warn);
|
|
CHECK(boundary.front().element == 1);
|
|
// a line of its own wins over the area
|
|
areas.lines.emplace_back("main", profile_id::en13803);
|
|
CHECK(areas.at({0.0, 0.0}, "main") == profile_id::en13803);
|
|
CHECK(areas.at({0.0, 0.0}, "other") == profile_id::tsi);
|
|
CHECK(areas.at({500.0, 0.0}, "other") == profile_id::plk);
|
|
}
|
|
|
|
TEST_CASE("norms engine: a line read from its samples: straights, transitions and arcs, the cant points and the grade line") {
|
|
// samples a metre apart: 100 m straight, a transition of 50 m to R 500 m to the right, an arc of 100 m, then at a joint with no
|
|
// transition a straight of 100 m; the cant 0 - 50 mm along the transition and back to 0 along the first 50 m of the straight; level,
|
|
// and the straight rising 5 per mille from a break at its joint
|
|
std::vector<norms::sample> samples;
|
|
auto const add = [&samples](double const Chainage, double const Curvature, double const Cant, double const Grade) {
|
|
norms::sample sample;
|
|
sample.chainage = Chainage;
|
|
sample.at = {Chainage, 0.0};
|
|
sample.curvature = Curvature;
|
|
sample.cant = Cant;
|
|
sample.grade = Grade;
|
|
sample.speed = 100.0;
|
|
samples.push_back(sample);
|
|
};
|
|
for (int i = 0; i <= 100; ++i) {
|
|
add(i, 0.0, 0.0, 0.0);
|
|
}
|
|
for (int i = 0; i <= 50; ++i) {
|
|
add(100.0 + i, -i / 50.0 / 500.0, -i, 0.0);
|
|
}
|
|
for (int i = 0; i <= 100; ++i) {
|
|
add(150.0 + i, -1.0 / 500.0, -50.0, 0.0);
|
|
}
|
|
for (int i = 0; i <= 100; ++i) {
|
|
add(250.0 + i, 0.0, -50.0 + (i < 50 ? i : 50), 0.005);
|
|
}
|
|
auto const line{norms::describe(samples, "test")};
|
|
REQUIRE(line.elements.size() == 4);
|
|
CHECK(line.elements[0].kind == element_kind::straight);
|
|
CHECK(line.elements[0].length == doctest::Approx(100.0));
|
|
CHECK(line.elements[1].kind == element_kind::transition);
|
|
CHECK(line.elements[1].curvature_end == doctest::Approx(-1.0 / 500.0));
|
|
CHECK(line.elements[2].kind == element_kind::arc);
|
|
CHECK(line.elements[2].length == doctest::Approx(100.0));
|
|
CHECK(line.elements[2].curvature_start == doctest::Approx(-1.0 / 500.0));
|
|
CHECK(line.elements[3].kind == element_kind::straight);
|
|
CHECK(line.elements[0].open_start);
|
|
CHECK(line.elements[3].open_end);
|
|
// the cant: 0 to 100 m, -50 at 150 m, held to 250 m, back to 0 at 300 m
|
|
REQUIRE(line.cant.size() >= 4);
|
|
CHECK(line.cant.front().cant == doctest::Approx(0.0));
|
|
auto const at = [&line](double const Chainage) { return std::ranges::find_if(line.cant, [Chainage](norms::cant_point const &Point) { return std::abs(Point.chainage - Chainage) < 1e-6; }); };
|
|
REQUIRE(at(150.0) != line.cant.end());
|
|
CHECK(at(150.0)->cant == doctest::Approx(-50.0));
|
|
REQUIRE(at(300.0) != line.cant.end());
|
|
CHECK(at(300.0)->cant == doctest::Approx(0.0));
|
|
// the grade: level to 250 m, a break, 5 per mille on
|
|
REQUIRE(line.grades.size() == 2);
|
|
CHECK(line.grades[0].grade_start == 0.0);
|
|
CHECK(line.grades[1].start == doctest::Approx(250.0));
|
|
CHECK(line.grades[1].grade_start == doctest::Approx(0.005));
|
|
}
|