CX_ACCESS_NODE::FindRouteToObject
Beschreibung:
Die Methode findet den optimalen Weg zwischen den
CX_ACCESS_NODE
Code-Beispiel:
Var(origin, goal, totalWeight)
// Construct the graph
. . .
-> origin // starting point
-> goal // end point
0$ -> totalWeight // total costs of the optimal
way (supposing CX_ACCESS_WAY::edgeWeight is describing costs in $)
goal totalWeight origin Call(FindRouteToObject)
FillObox(win, route) // display the optimal way
totalWeight PutValue(win, totalWeight) // display the
total costs for this way
Window(win, ....) ObjectListView
{
[
INITIALIZE: [ "CX_ACCESS_WAY::accessNode.uniqueID"
HEADER T("next node") ]
SetFormat
[ "CX_ACCESS_WAY::edgeWeight" HEADER
T("weight") ] SetFormat
String(totalWeight, ...)
}
Stack | Position | Objekttyp | Kurzbeschreibung |
---|---|---|---|
Stack(In) | Top | CX_ACCESS_NODE | Startobjekt der Suche |
Top-1 | CX_INTEGER / CX_NUMERIC / CX_VALUE oder NULL | optional: Summe der Wegekosten für den gefundenen Weg | |
Top-2 | CX_ACCESS_NODE | Zielobjekt | |
Stack(Out) | Top | VECTOR<OBJECT> | der gefundene Weg als Vektor von CX_ACCESS_WAY-Objekten |
Funktionsaufruf: Call(FindRouteToObject)