You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add to the class Nodes the property connected_edges containing the connected edges. This will replace the property connected_nodes. To keep reading access of connected_nodes somehow, calculate the connected nodes based on the connected_edges and use a @property decorator.
Do the same with connected_on_left, connected_on_right and connected_on_head and set_connection_left, set_connection_right and set_connection_head.
Therefore, every writing access of connected_edges and call of set_connection_left, set_connection_right, and set_connection_head has to be refactored.
Affected repositories are
With this refactoring, we can identify "Abstellgleise", because we have two different connected edges instead of the same connected node.
Additionally, we can improve calc_anschluss_of_all_nodes. Currently, this function calculates the angles between three edges with their top nodes. This leads to failures if the edge is very long and straight.
Acceptance criterion
Add connected_edges
Replace connected_nodes with function and @property decorator
Add connected_edge_on_left, connected_edge_on_right and connected_edge_on_head property with type Edge
Use connected_edge_on_left, connected_edge_on_right and connected_edge_on_head in set_connection_left, set_connection_right, set_connection_head.
Use connected_edges in set_connection_left, set_connection_right and set_connection_head
Replace connected_on_left, connected_on_right and connected_on_head with function and @property decorator
Add function to Edge given a top node of the edge, get the opposite one.
Add function to Edge given a top node of the edge, get the nearest geo node
The text was updated successfully, but these errors were encountered:
Suggested refactoring
Add to the class
Nodes
the propertyconnected_edges
containing the connected edges. This will replace the propertyconnected_nodes
. To keep reading access ofconnected_nodes
somehow, calculate the connected nodes based on theconnected_edges
and use a@property
decorator.Do the same with
connected_on_left
,connected_on_right
andconnected_on_head
andset_connection_left
,set_connection_right
andset_connection_head
.Therefore, every writing access of
connected_edges
and call ofset_connection_left
,set_connection_right
, andset_connection_head
has to be refactored.Affected repositories are
Advantage of refactoring
With this refactoring, we can identify "Abstellgleise", because we have two different connected edges instead of the same connected node.
Additionally, we can improve calc_anschluss_of_all_nodes. Currently, this function calculates the angles between three edges with their top nodes. This leads to failures if the edge is very long and straight.
Acceptance criterion
connected_edges
connected_nodes
with function and@property
decoratorconnected_edge_on_left
,connected_edge_on_right
andconnected_edge_on_head
property with type Edgeconnected_edge_on_left
,connected_edge_on_right
andconnected_edge_on_head
inset_connection_left
,set_connection_right
,set_connection_head
.connected_edges
inset_connection_left
,set_connection_right
andset_connection_head
connected_on_left
,connected_on_right
andconnected_on_head
with function and@property
decoratorEdge
given a top node of the edge, get the opposite one.Edge
given a top node of the edge, get the nearest geo nodeThe text was updated successfully, but these errors were encountered: