Membangun Filter Predikat Membentuk path
Berikut potongan program filter predikat arah :
switch filter
case starlike
[jarak_new, exact_direction_new] = sdm_read_topology_dbdb,lastnode,newnode;
[jarak_last, exact_direction_previous] = sdm_read_topology_dbdb,before_lastnode,lastnode;
absolute exact direction if
strcmp exact_direction_new , exact_direction_previous;, tf=1; else
if strcmpexact_direction_previous,
timur strcmpexact_direction_new,
tenggara |
strcmpexact_direction_new, timurlaut
, tf=1; elseif
strcmpexact_direction_previous, barat
strcmpexact_direction_new, baratdaya
| strcmpexact_direction_new,
baratlaut , tf=1;
elseif strcmpexact_direction_previous,
selatan strcmpexact_direction_new,
tenggara |
strcmpexact_direction_new , baratdaya
, tf=1; elseif
strcmpexact_direction_previous, utara
strcmpexact_direction_new, baratlaut
| strcmpexact_direction_new ,
timurlaut , tf=1;
else tf=0;
end end if
end end if strcmp
case variable_starlike
[jarak_new, exact_direction_new] = sdm_read_topology_dbdb,firstnode,newnode;
[jarak_last, exact_direction_previous] = sdm_read_topology_dbdb,firstnode,lastnode;
if strcmp exact_direction_new , exact_direction_previous;, tf=1;
else reli is special relation of rel1
if strcmpexact_direction_new ,
tenggara strcmpexact_direction_previous,
timur |strcmpexact_direction_previous,
selatan ; tf=1;
elseif strcmpexact_direction_new ,
baratdaya strcmpexact_direction_previous,
barat |strcmpexact_direction_previous,
selatan ; tf=1;
elseif strcmpexact_direction_new ,
baratlaut strcmpexact_direction_previous,
barat |strcmpexact_direction_previous,
utara ; tf=1;
elseif strcmpexact_direction_new ,
timurlaut strcmpexact_direction_previous,
timur |strcmpexact_direction_previous,
utara ; tf=1;
else tf=0;
end end special relation
end end check direction predicate
end end switch filter
if tf==1;
extendedpath = [path newnode]; extending path
extendedpath =[firstnode]...[before_lastnode][lastnode][newnode] counter = counter +1;
pathkn{counter,1}= extendedpath; end
if tf