Files
secondo/Algebras/Network2/Network2.examples

249 lines
7.1 KiB
Plaintext
Raw Normal View History

2026-01-23 17:03:45 +08:00
Database: testData/networktest
Restore : yes
Operator : junctions
Number : 1
Signature: network -> rel
Example : query junctions(B_NETWORK);
Result : file
Operator : routes
Number : 1
Signature: network -> rel
Example : query routes(B_NETWORK);
Result : file
Operator : sections
Number : 1
Signature: network -> rel
Example : query sections(B_NETWORK);
Result : file
Operator : thenetwork
Number : 1
Signature: rel x rel -> network
Example : query thenetwork(1, B_ROUTES, B_JUNCTIONS);
Result : file_platform
Operator : shortest_path
Number : 1
Signature: gpoint x gpoint -> gline
Example : query shortest_path([const gpoint value(1 1 1.0 2)], [const gpoint value(1 2 1.0 2)]);
Result : (gline(1((1 1.0 773.1299430080975)(2 0.0 1.0))))
Tolerance: %0.01
Operator : shortest_path
Number : 2
Signature: gpoint x gpoint -> gline
Example : query shortest_path([const gpoint value (1 1 0.0 0)],[const gpoint value(1 1 0.5 0)]);
Result : (gline(1((1 0.0 0.5))))
Tolerance: %0.01
Operator : length
Number : 1
Signature: gline -> real
Example : query length([const gline value(1((1 1.0 773.1299430080975)(2 0.0 1.0)))]);
Result : 773.1299430081
Tolerance:%0.01
Operator : isempty
Number : 1
Signature: gline -> bool
Example : query isempty([const gline value(1((1 0.0 0.5)))]);
Result : FALSE
Operator : netdistance
Number : 1
Signature: gpoint x gpoint -> real
Example : query netdistance([const gpoint value(1 1 1.0 2)], [const gpoint value(1 2 1.0 2)]);
Result : 773.1299430080975
Tolerance:%0.01
Operator : netdistance
Number : 2
Signature: gline x gline -> real
Example : query netdistance([const gline value(1((1 0.0 0.5)))], [const gline value(1((2 0.7 1.5)))]);
Result : 774.1299430080975
Tolerance:%0.01
Operator : distance
Number : 1
Signature: gpoint x gpoint -> real
Example : query distance([const gpoint value(1 1 0.8 2)], [const gpoint value (1 1 0.2 2)]);
Result : 0.6
Tolerance:%0.01
Operator : distance
Number : 2
Signature: gline x gline -> real
Example : query distance([const gline value(1((1 0.0 0.5)))], [const gline value(1((1 0.7 1.5)))]);
Result : 0.2
Tolerance:%0.01
Operator : point2gpoint
Number : 1
Signature: point -> gpoint
Example : query point2gpoint(B_NETWORK, [const point value(8594.0 8773.0)]);
Result : (gpoint (1 4 0.0 2))
Tolerance:%0.01
Operator : gpoint2point
Number : 1
Signature: gpoint -> point
Example : query gpoint2point([const gpoint value(1 1 385.0474775448921 2)]);
Result : (point (8594.0 8773.0))
Tolerance:%0.01
Operator : =
Number : 1
Signature: gpoint x gpoint -> bool
Example : query [const gpoint value(1 1 1.0 2)] = [const gpoint value(1 2 1.0 2)];
Result : FALSE
Operator : =
Number : 2
Signature: gpoint x gpoint -> bool
Example : query [const gpoint value(1 1 1.0 2)] = [const gpoint value(1 1 1.0 2)];
Result : TRUE
Operator : =
Number : 3
Signature: gline x gline -> bool
Example : query [const gline value(1((1 0.0 0.5)))] = [const gline value(1((1 0.0 0.5)))];
Result : TRUE
Operator : =
Number : 4
Signature: gline x gline -> bool
Example : query [const gline value(1((1 0.0 1.5)))] = [const gline value(1((1 0.0 0.5)))];
Result : FALSE
Operator : line2gline
Number : 1
Signature: line -> gline
Example : query line2gline(B_NETWORK, [const line value((8594.0 8773.0 8982.0 8781.0))]);
Result : (gline (1 ((1 385.0474775448921 773.1299430080975))))
Tolerance:%0.01
Operator : inside
Number : 1
Signature: gpoint x gline -> bool
Example : query [const gpoint value (1 1 0.8 2)] inside [const gline value(1((1 0.7 1.5)))];
Result : TRUE
Operator : inside
Number : 2
Signature: gpoint x gline -> bool
Example : query [const gpoint value (1 1 5.2 2)] inside [const gline value (1 ((1 0.0 5.0)))];
Result : FALSE
Operator : no_components
Number : 1
Signature: gline -> int
Example : query no_components([const gline value(1((1 0.0 0.5)))]);
Result : 1
Operator : polygpoints
Number : 1
Signature: gpoint x network -> stream(gpoint)
Example : query polygpoints([const gpoint value(1 1 1.0 2)], B_NETWORK) count;
Result : 1
Operator : routeintervals
Number : 1
Signature: gline -> stream(rect)
Example : query routeintervals([const gline value(1((1 0.0 0.5)))]) count;
Result : 1
Operator : routeintervals
Number : 2
Signature: gline -> stream(rect)
Example : query routeintervals([const gline value(1((1 0.0 0.5)(2 0.1 6.5)(4 2.4 3.5)))]) count;
Result : 3
Operator : intersects
Number : 1
Signature: gline x gline -> bool
Example : query [const gline value(1((1 0.0 0.5)))] intersects [const gline value(1((1 0.7 1.5)))];
Result : FALSE
Operator : intersects
Number : 2
Signature: gline x gline -> bool
Example : query [const gline value(1((1 0.0 0.5)))] intersects [const gline value(1((1 0.2 1.5)))];
Result : TRUE
Operator : gpoint2rect
Number : 1
Signature: gpoint -> rect
Example : query gpoint2rect([const gpoint value (1 1 0.8 2)]);
Result : (rect(1.0 1.0 0.8 0.8))
Tolerance: 0.01%
Operator : gline2line
Number : 1
Signature: gline -> line
Example : query gline2line([const gline value(1((1 0.0 1013.204931293)))]);
Result : (line((8209.0 8769.0 8293.0 8768.0)(8293.0 8768.0 8594.0 8773.0)(8594.0 8773.0 8982.0 8781.0)(8982.0 8781.0 9222.0 8787.0)))
Tolerance: 0.01%
Operator : union
Number : 1
Signature: gline x gline -> gline
Example : query [const gline value(1((1 0.0 0.5)))] union [const gline value(1((1 0.7 1.5)))];
Result : (gline(1((1 0.0 0.5) (1 0.7 1.5))))
Operator : union
Number : 2
Signature: gline x gline -> gline
Example : query [const gline value(1((1 0.0 0.5)))] union [const gline value(1((1 0.2 1.5)))];
Result : (gline(1((1 0.0 1.5))))
Operator : update_sectioncost
Number : 1
Signature: network x int x real -> bool
Example : query update_sectioncost(B_NETWORK,1,5.0);
Result : TRUE
Operator : update_sectioncost
Number : 2
Signature: network x rel -> bool
Example : query update_sectioncost(B_NETWORK,[const rel(tuple([Sid: int, Cost: real])) value ((1 5.0)(2 27.0))]);
Result : TRUE
Operator : update_sectionduration
Number : 1
Signature: network x int x real -> bool
Example : query update_sectionduration(B_NETWORK,1,5.0);
Result : TRUE
Operator : update_sectionduration
Number : 2
Signature: network x rel -> bool
Example : query update_sectioncost(B_NETWORK,[const rel(tuple([Sid: int, Duration: real])) value ((1 5.0)(2 27.0))]);
Result : TRUE
Operator : shortestpath_astarplus
Number : 1
Signature: gpoint x gpoint -> gline
Example : query shortestpath_astarplus([const gpoint value (1 1 0.0 0)],[const gpoint value(1 1 0.5 0)]);
Result : (gline(1((1 0.0 0.5))))
Operator : shortestpath_astarplus
Number : 2
Signature: gpoint x gpoint x (map real real real real) -> gline
Example : query shortestpath_astarplus([const gpoint value (1 1 0.0 0)],[const gpoint value(1 1 0.5 0)], fun(cost: real, duration:real, l:real) (cost -(2* duration)));
Result : (gline(1((1 0.0 0.5))))
Operator : optimizenet
Number : 1
Signature: network -> bool
Example : query optimizenet(B_NETWORK);
Result : TRUE
Operator : print_adjacencylist
Number : 1
Signature: network -> bool
Example : query print_adjacencylist(B_NETWORK);
Result : TRUE