/// <summary> /// Kopiert diese Liste und gibt ein neues Objekt zurück /// </summary> /// <returns>neue Instanz dieser Liste</returns> public CTSPPointList copy() { // neues Objekt erstellen CTSPPointList newList = new CTSPPointList(); // Objekt füllen for (int pointIndex = 0; pointIndex < length(); pointIndex++) { newList.addPoint(getPoint(pointIndex)); } newList.optimizeList(); return(newList); }
public void addPoint(CTSPPoint point) { if (mPoints.length() == 0) { mTourLength = 0; } else { CTSPPoint lastPointInList = mPoints.getPoint(mPoints.length() - 1); CConnection additinalConnection = CConnectionList.getInstance().getConnection(lastPointInList, point); mTourLength += additinalConnection.getDistance(); } mPoints.addPoint(point); }