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