44 namespace Gecode {
namespace Gist {
48 setWindowFlags(Qt::Tool);
49 QGraphicsScene* scene =
new QGraphicsScene();
56 poly << QPointF(78,100) << QPointF(78+8,100+8)
57 << QPointF(78,100+16) << QPointF(78-8,100+8);
63 pen.setStyle(Qt::DotLine);
65 scene->addLine(78,26,78,60,pen);
66 scene->addLine(78,76,38,100,pen);
67 scene->addLine(78,76,78,100,pen);
68 scene->addLine(78,76,118,100,pen);
70 scene->addLine(135,10,145,10);
71 scene->addLine(145,10,145,110);
72 scene->addLine(145,60,135,60);
73 scene->addLine(145,110,135,110);
75 nodeDepthLabel = scene->addText(
"0");
76 nodeDepthLabel->setPos(150,20);
77 subtreeDepthLabel = scene->addText(
"0");
78 subtreeDepthLabel->setPos(150,75);
80 choicesLabel = scene->addText(
"0");
81 choicesLabel->setPos(45,57);
83 solvedLabel = scene->addText(
"0");
84 solvedLabel->setPos(78-solvedLabel->document()->size().width()/2,120);
85 failedLabel = scene->addText(
"0");
86 failedLabel->setPos(30,120);
87 openLabel = scene->addText(
"0");
88 openLabel->setPos(110,120);
90 QGraphicsView* view =
new QGraphicsView(scene);
91 view->setRenderHints(view->renderHints() | QPainter::Antialiasing);
94 scene->setBackgroundBrush(Qt::white);
96 boxLayout =
new QVBoxLayout();
97 boxLayout->setContentsMargins(0,0,0,0);
98 boxLayout->addWidget(view);
101 setWindowTitle(
"Gist node statistics");
102 setAttribute(Qt::WA_QuitOnClose,
false);
103 setAttribute(Qt::WA_DeleteOnClose,
false);
113 nodeDepthLabel->setPlainText(QString(
"%1").arg(nd));;
118 subtreeDepthLabel->setPlainText(
119 QString(
"%1").arg(pnv.
getCursor().depth));
120 solvedLabel->setPlainText(QString(
"%1").arg(pnv.
getCursor().solved));
121 solvedLabel->setPos(78-solvedLabel->document()->size().width()/2,120);
122 failedLabel->setPlainText(QString(
"%1").arg(pnv.
getCursor().failed));
123 failedLabel->setPos(44-failedLabel->document()->size().width(),120);
124 choicesLabel->setPlainText(QString(
"%1").arg(pnv.
getCursor().choice));
125 choicesLabel->setPos(66-choicesLabel->document()->size().width(),57);
126 openLabel->setPlainText(QString(
"%1").arg(pnv.
getCursor().open));
static const QColor white
White color.
NodeStatInspector(QWidget *parent)
static const QColor green
The color for solved nodes.
A cursor that collects statistics.
static const QColor blue
The color for choice nodes.
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Cursor & getCursor(void)
Return the cursor.
static const QColor red
The color for failed nodes.
void run(void)
Execute visitor.
Run a cursor over a tree, processing nodes in pre-order.
Node class that supports visual layout
Gecode toplevel namespace
void node(const VisualNode::NodeAllocator &, VisualNode *n, const Statistics &stat, bool finished)
Update display to reflect information about n.
Statistics about the search tree
void showStats(void)
Show this window and bring it to the front.