Located in ./GitHub/RailCOMPLETE-DNA-[XX-YY]/[XX-YY]/DNA/Switches.

Overview

The Switches folder contains an XML file describing switch geometry that RailCOMPLETE uses to properly analyze tracks and insert switch objects. It is registered in the main DNA XML file using the <SwitchGeometryPath> element.

XML elements

<SwitchDefinitions>
	Parameters:
		xmlns:xsd="<http://www.w3.org/2001/XMLSchema>"
		xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>

	<DefaultFindConnectionsTolerances
		Default tolerances for finding connection point candidates.
		Parameters:
			BranchDistanceTolerance
				Maximum distance between the alignments at the candidate connection point in meters.
			BranchTangentTolerance
				Maximum angular difference between the alignments at the candidate connection point
				in decimal degrees.
			ContinuationDistanceTolerance
				Maximum distance between tha alignments at the candidate connection point in meters.
			ContinuationTangentTolerance
				Maximum angular difference between the alignments at the candidate connection point
				in decimal degrees.
			IntersectionTangentTolerance
				Maximum angular difference between the alignments at the candidate connection point
				in decimal degrees.
			OverlapDistanceToSkipCombination
				The mimimum length of which two alignments overlap before we regard them as overlapping alignments, in meters. If two alignments overlap, the algorithm will not attempt to insert an object to connect them.
			OverlapStepLength
				Each pair of alignments count as overlapping if the are "close" over this distance, in meters, or more. Setting this too high means not spotting large real overlaps. Setting it too low means that switches start counting as overlaps.
			OverlapThreshold
				Distance threshold used when comparing two alignments, in meters. Alignments are considered non-overlapping at a given point (sero match-score) if their distance at tah point is more than the threshold. The match-score increases linearly with reducing the distance. A perfect score is obtained when the distance is zero.
	/>
	<DefaultMatchSwitchTolerances
		Tolerances for finding switch definitions matching the horizontal geometries. The algorithm steps through the alignment starting from the stock rail joint.
		Parameters:
			OverlapFraction
				The fraction of the alignment section which is required to overlap with the definition.
			OverlapStepLength
				The sped length used when matching the alignment geometry with the switch definition in meters.
			OverlapThreshold
				Distance threshold in meters used when comparing two alignments. Alignments are considered non-overlapping at a given point (zero match-score) if their distance at that point is more than the threshold. The match-score increases linearly with reducing the distance. A perfect score is obtained when the distance is zero.
	/>
	<Switch>
		The switch element describes the geometry the alignments must match for a switch to be inserted.
		<VariantName>
			Content should match the name of a switch variant defined in the DNA.
		</VariantName>
		<Branch1>
			<Segment>
				<Type>
					Content should be "Line", "Curve" or "Spiral".
				</Type>
	        	<Parameter>
					A number representing nothing for "Line" type segment, the radius
					of a "Curve" type segment or the clothoid parameter of a "Spiral"
					type segment.
				</Parameter>
        		<Length>
					The arc length of the segment
				</Length>
      		</Segment>
		</Branch1>
		<Branch2>
			Branch2 should contain a <Segment> element as defined above.
		</Branch2>
	</Switch>
</SwitchDefinitions>