chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.web-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use unionfind=>0 since that works.
[ypp-sc-tools.web-live.git]
/
yarrg
/
yppedia-chart-parser
diff --git
a/yarrg/yppedia-chart-parser
b/yarrg/yppedia-chart-parser
index 068cd1c20e30694e3c56397cb1cbd976e274df82..8b5c50828a4e79996f4d20dc1fbc572d3887fd9c 100755
(executable)
--- a/
yarrg/yppedia-chart-parser
+++ b/
yarrg/yppedia-chart-parser
@@
-8,7
+8,7
@@
use Graph::Undirected;
use CommodsDatabase;
my $widists= Graph::Undirected->new();
use CommodsDatabase;
my $widists= Graph::Undirected->new();
-my $wiarchs= Graph::Undirected->new(
unionfind => 1
);
+my $wiarchs= Graph::Undirected->new();
my @wiarchlabels;
my %wiisland2node;
my %winode2island;
my @wiarchlabels;
my %wiisland2node;
my %winode2island;
@@
-74,6
+74,7
@@
sub parse_yppedia_map () {
$winode2island{$n}= $island;
$widists->add_vertex($n);
$wiarchs->add_vertex($n);
$winode2island{$n}= $island;
$widists->add_vertex($n);
$wiarchs->add_vertex($n);
+#print "\$g->add_vertex('$n');\n";
printf PO "%d,%d island %s\n", $x,$y,$island;
} elsif (($solid,$x,$y,$dirn) =
m/^\{\{ chart\ league((?:\ solid)?) \|(\d+)\|(\d+)\|
printf PO "%d,%d island %s\n", $x,$y,$island;
} elsif (($solid,$x,$y,$dirn) =
m/^\{\{ chart\ league((?:\ solid)?) \|(\d+)\|(\d+)\|
@@
-88,6
+89,8
@@
sub parse_yppedia_map () {
$widists->add_weighted_edge($nn->(), nn_xy($bx,$by), 1);
$wiarchs->add_edge($nn->(), nn_xy($bx,$by)) if $solid;
$widists->add_weighted_edge($nn->(), nn_xy($bx,$by), 1);
$wiarchs->add_edge($nn->(), nn_xy($bx,$by)) 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 PO "%d,%d league %s %s \n", $x,$y,
$solid?'solid':'dotted', $dirn;
printf PO "%d,%d league %s %s \n", $x,$y,
$solid?'solid':'dotted', $dirn;
@@
-172,14
+175,14
@@
sub process_yppedia_graphs () {
} sort $wiarchs->connected_component_by_index($ccix);
if (exists $wiccix2arch{$ccix}) {
} sort $wiarchs->connected_component_by_index($ccix);
if (exists $wiccix2arch{$ccix}) {
- error("archi
tecture determination fail
ed:\n".
+ error("archi
pelago determination failed, wrongly merg
ed:\n".
" archipelago $arch\n".
" archipelago $wiccix2arch{$ccix}\n".
$desc);
next;
}
$wiccix2arch{$ccix}= $arch;
" archipelago $arch\n".
" archipelago $wiccix2arch{$ccix}\n".
$desc);
next;
}
$wiccix2arch{$ccix}= $arch;
-
print "$ccix $arch ::\n$desc\n";
+
#
print "$ccix $arch ::\n$desc\n";
}
}
}
}
@@
-195,8
+198,3
@@
parse_yppedia_map();
parse_database_map();
process_yppedia_graphs();
compare_island_lists();
parse_database_map();
process_yppedia_graphs();
compare_island_lists();
-
-printf "%d %d %d %d\n", $wiarchs->has_edge('32,17','33,18'),
- $wiarchs->connected_component_by_vertex('32,17'),
- $wiarchs->connected_component_by_vertex('33,18'),
- $wiarchs->same_connected_components('32,17','33,18');