reversed order of nodes in dot
parent
d85a1e68e4
commit
46080d7d5a
|
@ -163,7 +163,13 @@ TEST(DiscreteBayesNet, Dot) {
|
||||||
fragment.add((Either | Tuberculosis, LungCancer) = "F T T T");
|
fragment.add((Either | Tuberculosis, LungCancer) = "F T T T");
|
||||||
|
|
||||||
string actual = fragment.dot();
|
string actual = fragment.dot();
|
||||||
EXPECT(actual == "digraph G{\n3->5\n6->5\n4->6\n0->3\n}");
|
EXPECT(actual ==
|
||||||
|
"digraph G{\n"
|
||||||
|
"0->3\n"
|
||||||
|
"4->6\n"
|
||||||
|
"3->5\n"
|
||||||
|
"6->5\n"
|
||||||
|
"}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
|
@ -39,8 +39,8 @@ void BayesNet<CONDITIONAL>::dot(std::ostream& os,
|
||||||
const KeyFormatter& keyFormatter) const {
|
const KeyFormatter& keyFormatter) const {
|
||||||
os << "digraph G{\n";
|
os << "digraph G{\n";
|
||||||
|
|
||||||
for (auto conditional : boost::adaptors::reverse(*this)) {
|
for (auto conditional : *this) {
|
||||||
typename CONDITIONAL::Frontals frontals = conditional->frontals();
|
auto frontals = conditional->frontals();
|
||||||
const Key me = frontals.front();
|
const Key me = frontals.front();
|
||||||
auto parents = conditional->parents();
|
auto parents = conditional->parents();
|
||||||
for (const Key& p : parents)
|
for (const Key& p : parents)
|
||||||
|
|
Loading…
Reference in New Issue