chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.web-live.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
025ff2d
)
yppedia-chart-parser better debug
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 21 Aug 2009 16:35:19 +0000
(17:35 +0100)
committer
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Fri, 21 Aug 2009 16:35:19 +0000
(17:35 +0100)
yarrg/yppedia-chart-parser
patch
|
blob
|
history
diff --git
a/yarrg/yppedia-chart-parser
b/yarrg/yppedia-chart-parser
index a8b9f2aaa73a0e81126ea576fdbc1af71bc6a7a9..b3cb1c21c1af5be1b95f5ea681150c43119fa75a 100755
(executable)
--- a/
yarrg/yppedia-chart-parser
+++ b/
yarrg/yppedia-chart-parser
@@
-61,7
+61,7
@@
sub parse_yppedia_map () {
if (($x,$y,$arch) =
m/^\{\{ chart\ label \|(\d+)\|(\d+)\| .*
\'\[\[ [^][\']* \| (\S+)\ archipelago \]\]\'*\}\}$/xi) {
if (($x,$y,$arch) =
m/^\{\{ chart\ label \|(\d+)\|(\d+)\| .*
\'\[\[ [^][\']* \| (\S+)\ archipelago \]\]\'*\}\}$/xi) {
- printf DEBUG "%
d,%
d arch %s\n", $x,$y,$arch;
+ printf DEBUG "%
2d,%-2
d arch %s\n", $x,$y,$arch;
push @wiarchlabels, [ $x,$y,$arch ];
} elsif (($x,$y,$island) =
m/^\{\{ chart\ island\ icon \|(\d+)\|(\d+)\|
push @wiarchlabels, [ $x,$y,$arch ];
} elsif (($x,$y,$island) =
m/^\{\{ chart\ island\ icon \|(\d+)\|(\d+)\|
@@
-72,7
+72,7
@@
sub parse_yppedia_map () {
$widists->add_vertex($n);
$wiarchs->add_vertex($n);
#print "\$g->add_vertex('$n');\n";
$widists->add_vertex($n);
$wiarchs->add_vertex($n);
#print "\$g->add_vertex('$n');\n";
- printf DEBUG "%
d,%
d island %s\n", $x,$y,$island;
+ printf DEBUG "%
2d,%-2
d island %s\n", $x,$y,$island;
} elsif (($solid,$x,$y,$dirn) =
m/^\{\{ chart\ league((?:\ solid)?) \|(\d+)\|(\d+)\|
([-\/\\o]) \| .*\}\}$/xi) {
} elsif (($solid,$x,$y,$dirn) =
m/^\{\{ chart\ league((?:\ solid)?) \|(\d+)\|(\d+)\|
([-\/\\o]) \| .*\}\}$/xi) {
@@
-89,7
+89,7
@@
sub parse_yppedia_map () {
$wiarchs->add_edge($nn->(), nn_xy($bx,$by)) if $solid;
#print "\$g->add_edge('".$nn->()."','".nn_xy($bx,$by)."');\n" if $solid;
$wiarchs->add_edge($nn->(), nn_xy($bx,$by)) if $solid;
#print "\$g->add_edge('".$nn->()."','".nn_xy($bx,$by)."');\n" if $solid;
- printf DEBUG "%
d,%d league %s %s
\n", $x,$y,
+ printf DEBUG "%
2d,%-2d league %-6s %s
\n", $x,$y,
$solid?'solid':'dotted', $dirn;
} elsif (
m/^\{\{ chart\ head \}\}$/xi
$solid?'solid':'dotted', $dirn;
} elsif (
m/^\{\{ chart\ head \}\}$/xi
@@
-133,7
+133,7
@@
sub process_yppedia_graphs () {
map { $weight += $widists->get_edge_weight($delete, $_) } @neigh;
$widists->add_weighted_edge(@neigh, $weight);
$widists->delete_vertex($delete);
map { $weight += $widists->get_edge_weight($delete, $_) } @neigh;
$widists->add_weighted_edge(@neigh, $weight);
$widists->delete_vertex($delete);
- print
DEBUG "$delete elide $weight\n"
;
+ print
f DEBUG "%-5s elide %5s %-5s %2d\n", $delete, @neigh, $weight
;
}
# Check that it's connected.
}
# Check that it's connected.
@@
-165,7
+165,7
@@
sub process_yppedia_graphs () {
my ($vx,$vy) = split /,/, $vertex;
my $d2= ($vx-$ax)*($vx-$ax) + ($vy-$ay)*($vy-$ay);
# printf DEBUG
my ($vx,$vy) = split /,/, $vertex;
my $d2= ($vx-$ax)*($vx-$ax) + ($vy-$ay)*($vy-$ay);
# printf DEBUG
-# "%
d,%
d arch-island-search %s d2=%d ccix=%d cc=%d %s\n",
+# "%
2d,%-2
d arch-island-search %s d2=%d ccix=%d cc=%d %s\n",
# $ax,$ay, $vertex, $d2, $ccix, scalar(@cc),
# $winode2island{$vertex};
next unless @cc > 1;
# $ax,$ay, $vertex, $d2, $ccix, scalar(@cc),
# $winode2island{$vertex};
next unless @cc > 1;
@@
-174,7
+174,7
@@
sub process_yppedia_graphs () {
$d2best= $d2;
}
die 'no island vertices?!' unless defined $best;
$d2best= $d2;
}
die 'no island vertices?!' unless defined $best;
- printf DEBUG "%2d,%-2d arch-island-select %5s d2=%-2d %-10s %s\n",
+ printf DEBUG "%2d,%-2d arch-island-select %
-
5s d2=%-2d %-10s %s\n",
$ax,$ay, $best, $d2best, $arch, $winode2island{$best};
my $ccix= $wiarchs->connected_component_by_vertex($best);
my $desc= join "\n", map {
$ax,$ay, $best, $d2best, $arch, $winode2island{$best};
my $ccix= $wiarchs->connected_component_by_vertex($best);
my $desc= join "\n", map {
@@
-213,14
+213,12
@@
sub compare_island_lists () {
error("would delete island: $island");
next;
}
error("would delete island: $island");
next;
}
- my $ccix= $wiarchs->connected_component_by_vertex($node);
- my $wiarch= $wiccix2arch{$ccix};
+ my $wiarch= winode2arch($node);
if (!defined $wiarch) {
error("island has no arch: $island");
next;
}
my $dbarch= $dbisland2arch{$island};
if (!defined $wiarch) {
error("island has no arch: $island");
next;
}
my $dbarch= $dbisland2arch{$island};
- my $wiarch= winode2arch($node);
if ($wiarch ne $dbarch) {
change("change archipelago from $dbarch to $wiarch".
" for island $island");
if ($wiarch ne $dbarch) {
change("change archipelago from $dbarch to $wiarch".
" for island $island");