|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cm.osm2po.tsp.TspSolverBase
public abstract class TspSolverBase
Abstrakte Basisklasse zum Loesen eines osm2po-TSP, genauer genommen, einer bestehenden Kostenmatrix.
Field Summary | |
---|---|
protected Log |
log
|
protected TspMatrix |
tspMatrix
|
Constructor Summary | |
---|---|
TspSolverBase()
|
Method Summary | |
---|---|
protected float |
calcNeighborhoodCost(int[] tour,
int x)
Berechnet die Nachbarschafts-Kosten. |
protected float |
calcTourCost(int[] tour,
float costLimit)
Berechnet die Kosten einer Tour (Besuchsreihenfolge), bricht allerdings bereits mit Float.NaN
ab, sobald ein Kosten-Limit ueberschritten wurde. |
int[] |
createInitialTour(boolean asRing)
Erstellt eine Anfangskonfiguration fuer eine Tour auf der kompletten Matrix. |
TspSolver |
init(TspMatrix tspMatrix,
Log log)
Quasi-Konstruktor. |
int[][] |
makePaths(int[] tour)
Generiert aus einer Besuchsreihenfolge die entsprechenden Pfade. |
protected void |
moveStation(int[] tour,
int x,
int y)
Verschiebt den Vertex an Position x an Position y. |
protected boolean |
solveOptimalTour(int[] tour)
Permutiert ueber alle Kombinationen und ermittelt die kuerzeste Tour. |
protected void |
swapStations(int[] tour,
int x,
int y)
Tauscht die Positionen x und y innerhalb der Tour. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.cm.osm2po.tsp.TspSolver |
---|
solveTour |
Field Detail |
---|
protected Log log
protected TspMatrix tspMatrix
Constructor Detail |
---|
public TspSolverBase()
Method Detail |
---|
public TspSolver init(TspMatrix tspMatrix, Log log)
TspSolver
init
in interface TspSolver
tspMatrix
- TspMatrix
log
- Log
, NULLABLE
public final int[][] makePaths(int[] tour)
TspSolver
makePaths
in interface TspSolver
tour
- int[] Besuchsreihenfolge.
public final int[] createInitialTour(boolean asRing)
TspSolver
createInitialTour
in interface TspSolver
asRing
- boolean true: Start = Ziel (TSP)
protected final void swapStations(int[] tour, int x, int y)
tour
- int[] Besuchsreihenfolge von Vertices der Matrixx
- int Erste Tauschpositiony
- int Zweite Tauschpositionprotected final void moveStation(int[] tour, int x, int y)
tour
- int[] Besuchsreihenfolge von Vertices der Matrixx
- int Zu verschiebene Positiony
- int Zielpositionprotected final float calcTourCost(int[] tour, float costLimit)
Float.NaN
ab, sobald ein Kosten-Limit ueberschritten wurde.
tour
- int[] Besuchsreihenfolge.costLimit
- float Maximale Kosten, Abbruchkriterium.
Float.NaN
protected final float calcNeighborhoodCost(int[] tour, int x)
tour
- int[] Besuchsreihenfolge.x
- int Station
Float.NaN
protected final boolean solveOptimalTour(int[] tour)
tour
- int[] Initial- und Rueckgabe-Array von Positionen.
Moegliche Werte: [0,1,2,3, ... ,8,0], wenn Ring
aber auch [0,1,2, ... ,9] wenn kein Ring.
|
osm2po-core-4.8.8 (c) 2012 Carsten Moeller - info@osm2po.de | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |