@Test public final void testAddFork() { }
public static void addFork(RoadSegment fromRoad, RoadSegment toRoad1, RoadSegment toRoad2) { assert fromRoad.laneCount() == toRoad1.laneCount() + toRoad2.laneCount(); final int laneCount1 = toRoad1.laneCount(); for (int i = 0; i < laneCount1; ++i) { addLanePair(i, fromRoad, i, toRoad1); } final int laneCount2 = toRoad2.laneCount(); for (int i = 0; i < laneCount2; ++i) { addLanePair(i + laneCount1, fromRoad, i, toRoad2); } }
Link { public static void addFork(RoadSegment fromRoad, RoadSegment toRoad1, RoadSegment toRoad2) { assert fromRoad.laneCount() == toRoad1.laneCount() + toRoad2.laneCount(); final int laneCount1 = toRoad1.laneCount(); for (int i = 0; i < laneCount1; ++i) { addLanePair(i, fromRoad, i, toRoad1); } final int laneCount2 = toRoad2.laneCount(); for (int i = 0; i < laneCount2; ++i) { addLanePair(i + laneCount1, fromRoad, i, toRoad2); } } }
Link { public static void addFork(RoadSegment fromRoad, RoadSegment toRoad1, RoadSegment toRoad2) { assert fromRoad.laneCount() == toRoad1.laneCount() + toRoad2.laneCount(); final int laneCount1 = toRoad1.laneCount(); for (int i = 0; i < laneCount1; ++i) { addLanePair(i, fromRoad, i, toRoad1); } final int laneCount2 = toRoad2.laneCount(); for (int i = 0; i < laneCount2; ++i) { addLanePair(i + laneCount1, fromRoad, i, toRoad2); } } private  Link(); }
Link { public static void addFork(RoadSegment fromRoad, RoadSegment toRoad1, RoadSegment toRoad2) { assert fromRoad.laneCount() == toRoad1.laneCount() + toRoad2.laneCount(); final int laneCount1 = toRoad1.laneCount(); for (int i = 0; i < laneCount1; ++i) { addLanePair(i, fromRoad, i, toRoad1); } final int laneCount2 = toRoad2.laneCount(); for (int i = 0; i < laneCount2; ++i) { addLanePair(i + laneCount1, fromRoad, i, toRoad2); } } private  Link(); static void addLanePair(int fromLane, RoadSegment fromRoadsegment, int toLane, RoadSegment toRoadSegment); static RoadSegment addJoin(RoadSegment sourceRoad, RoadSegment sinkRoad); static void addMerge(RoadSegment fromRoad1, RoadSegment fromRoad2, RoadSegment toRoad); static void addFork(RoadSegment fromRoad, RoadSegment toRoad1, RoadSegment toRoad2); }
Link { public static void addFork(RoadSegment fromRoad, RoadSegment toRoad1, RoadSegment toRoad2) { assert fromRoad.laneCount() == toRoad1.laneCount() + toRoad2.laneCount(); final int laneCount1 = toRoad1.laneCount(); for (int i = 0; i < laneCount1; ++i) { addLanePair(i, fromRoad, i, toRoad1); } final int laneCount2 = toRoad2.laneCount(); for (int i = 0; i < laneCount2; ++i) { addLanePair(i + laneCount1, fromRoad, i, toRoad2); } } private  Link(); static void addLanePair(int fromLane, RoadSegment fromRoadsegment, int toLane, RoadSegment toRoadSegment); static RoadSegment addJoin(RoadSegment sourceRoad, RoadSegment sinkRoad); static void addMerge(RoadSegment fromRoad1, RoadSegment fromRoad2, RoadSegment toRoad); static void addFork(RoadSegment fromRoad, RoadSegment toRoad1, RoadSegment toRoad2);  }