public void Update() { Road road = new Road(m_xmargin, m_ymargin, m_xpadding, m_ypadding); foreach (INode node in m_model.Nodes) { Lane lane = road.FindExistingLaneFor(node); if (lane == null) { INode lastNodeInLane = FindLastNodeWithContext(node.Context); lane = road.ReserveLaneUntil(lastNodeInLane); } lane.Append(node); } road.UpdateLaneOffsets(); foreach (Lane lane in road.Lanes) { foreach (Car car in lane.Cars) { INode node = car.Driver; node.Position = new Point(car.Offset, lane.StartOffset); } } m_rowCount = (uint)road.Lanes.Count; }