34#include <QtGui/QPainter>
36#include <QPrintDialog>
53 QWidget* parent,
const Options& opt)
55#if QT_VERSION < 0x060000
56 ,
mutex(QMutex::Recursive)
68 QMutexLocker locker(&
mutex);
78 int rootIdx =
na->allocate(rootSpace);
79 assert(rootIdx == 0); (void) rootIdx;
82 root->setMarked(
true);
87 setAutoFillBackground(
true);
96 Qt::BlockingQueuedConnection);
98 this, SLOT(inspectSolution(
const Space*)));
102 Qt::BlockingQueuedConnection);
108#if QT_VERSION >= 0x060000
114 scaleBar =
new QSlider(Qt::Vertical,
this);
115 scaleBar->setObjectName(
"scaleBar");
119 connect(
scaleBar, SIGNAL(valueChanged(
int)),
127#if QT_VERSION >= 0x060000
133 qRegisterMetaType<Statistics>(
"Statistics");
180 comparators.append(QPair<Comparator*,bool>(c,
false));
193 QSize viewport_size = size();
194 QAbstractScrollArea* sa =
195 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
198 zoomx = viewport_size.width()/2;
200 zoomy = viewport_size.height()/2;
202 int xoff = (sa->horizontalScrollBar()->value()+zoomx)/
scale;
203 int yoff = (sa->verticalScrollBar()->value()+zoomy)/
scale;
208 scale = (
static_cast<double>(scale0)) / 100.0;
209 bb =
root->getBoundingBox();
216 sa->horizontalScrollBar()->setRange(0,w-viewport_size.width());
217 sa->verticalScrollBar()->setRange(0,h-viewport_size.height());
218 sa->horizontalScrollBar()->setPageStep(viewport_size.width());
219 sa->verticalScrollBar()->setPageStep(viewport_size.height());
226 sa->horizontalScrollBar()->setValue(xoff-zoomx);
227 sa->verticalScrollBar()->setValue(yoff-zoomy);
235 QMutexLocker locker(&
mutex);
237 if (
root !=
nullptr) {
247 QSize viewport_size = size();
248 QAbstractScrollArea* sa =
249 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
250 sa->horizontalScrollBar()->setRange(0,w-viewport_size.width());
251 sa->verticalScrollBar()->setRange(0,h-viewport_size.height());
252 sa->horizontalScrollBar()->setPageStep(viewport_size.width());
253 sa->verticalScrollBar()->setPageStep(viewport_size.height());
272 QSize viewport_size = size();
273 QAbstractScrollArea* sa =
274 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
275 sa->horizontalScrollBar()->setRange(0,w-viewport_size.width());
276 sa->verticalScrollBar()->setRange(0,h-viewport_size.height());
305 SearcherThread::updateCanvas(
void) {
307 if (t->
root ==
nullptr)
322 t->root->layout(*t->na);
323 BoundingBox bb = t->root->getBoundingBox();
325 int w =
static_cast<int>((bb.right-bb.left+
Layout::extent)*t->scale);
327 t->root->getShape()->depth()
331 int scale0 =
static_cast<int>(t->scale*100);
333 QWidget* p = t->parentWidget();
336 static_cast<double>(p->width()) / (bb.right - bb.left +
339 static_cast<double>(p->height()) /
342 scale0 =
static_cast<int>(std::min(newXScale, newYScale)*100);
347 double scale = (
static_cast<double>(scale0)) / 100.0;
355 t->layoutMutex.unlock();
382 node->getNumberOfChildNodes(*t->na, t->curBest, t->stats,
384 if (kids == 0 || node->getStatus() ==
STOP) {
391 std::stack<SearchItem> stck;
394 std::max(
static_cast<long unsigned int>(t->stats.maxDepth),
395 static_cast<long unsigned int>(depth+stck.size()));
399 t->stopSearchFlag =
false;
400 while (!stck.empty() && !t->stopSearchFlag) {
401 if (t->refresh > 0 && nodeCount >= t->refresh) {
402 node->dirtyUp(*t->na);
406 if (t->refreshPause > 0)
407 msleep(t->refreshPause);
411 if (si.i == si.noOfChildren) {
420 if (t->moveDuringSearch)
437 std::max(
static_cast<long unsigned int>(t->stats.maxDepth),
438 static_cast<long unsigned int>(depth+stck.size()));
444 t->stopSearchFlag =
false;
446 if (sol !=
nullptr) {
447 t->setCurrentNode(sol,
true,
false);
449 t->setCurrentNode(node,
true,
false);
460 QMutexLocker locker(&
mutex);
466 QMutexLocker locker(&
mutex);
472 QMutexLocker locker(&
mutex);
481 QMutexLocker locker(&
mutex);
490 QMutexLocker locker(&
mutex);
500 QMutexLocker locker(&
mutex);
509 QMutexLocker locker(&
mutex);
524 int zoomCurrent =
static_cast<int>(
scale*100);
540 if (
root !=
nullptr) {
542 bb =
root->getBoundingBox();
543 QWidget* p = parentWidget();
546 static_cast<double>(p->width()) / (bb.
right - bb.
left +
549 static_cast<double>(p->height()) / (
root->getShape()->depth() *
552 int scale0 =
static_cast<int>(std::min(newXScale, newYScale)*100);
562 int zoomCurrent =
static_cast<int>(
scale*100);
563 int targetZoom = scale0;
575 QMutexLocker locker(&
mutex);
580 while (c !=
nullptr) {
583 c = c->getParent(*
na);
588 QAbstractScrollArea* sa =
589 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
591 x -= sa->viewport()->width() / 2;
592 y -= sa->viewport()->height() / 2;
594 sourceX = sa->horizontalScrollBar()->value();
595 targetX = std::max(sa->horizontalScrollBar()->minimum(), x);
596 targetX = std::min(sa->horizontalScrollBar()->maximum(),
598 sourceY = sa->verticalScrollBar()->value();
599 targetY = std::max(sa->verticalScrollBar()->minimum(), y);
600 targetY = std::min(sa->verticalScrollBar()->maximum(),
603 sa->horizontalScrollBar()->setValue(
targetX);
604 sa->verticalScrollBar()->setValue(
targetY);
618 QAbstractScrollArea* sa =
619 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
620 double p =
static_cast<double>(i)/100.0;
623 sa->horizontalScrollBar()->setValue(
sourceX+
static_cast<int>(xdiff));
624 sa->verticalScrollBar()->setValue(
sourceY+
static_cast<int>(ydiff));
629 QMutexLocker locker(&
mutex);
636 int failedInspectorType = -1;
637 int failedInspector = -1;
638 bool needCentering =
false;
649 needCentering =
true;
653 std::max(
stats.maxDepth, depth);
661 failedInspectorType = 0;
674 failedInspectorType = -1;
699 "Something went wrong - probably an incorrect brancher");
709 switch (curSpace->
status()) {
722 if (inspectorNo==-1) {
725 failedInspectorType = 1;
728 failedInspectorType = -1;
732 failedInspectorType = 1;
733 failedInspector = inspectorNo;
735 failedInspectorType = -1;
742 switch (failedInspectorType) {
744 qFatal(
"Exception in move inspector %d: %s.\n Stopping.",
745 failedInspector, e.
what());
748 qFatal(
"Exception in double click inspector %d: %s.\n Stopping.",
749 failedInspector, e.
what());
752 qFatal(
"Exception: %s.\n Stopping.", e.
what());
770 QMutexLocker locker(&
mutex);
778 QMutexLocker locker(&
mutex);
786 TreeCanvas::inspectSolution(
const Space* s) {
787 int failedInspectorType = -1;
788 int failedInspector = -1;
795 failedInspectorType = 1;
798 failedInspectorType = -1;
802 }
catch (Exception& e) {
803 switch (failedInspectorType) {
805 qFatal(
"Exception in move inspector %d: %s.\n Stopping.",
806 failedInspector, e.what());
809 qFatal(
"Exception in solution inspector %d: %s.\n Stopping.",
810 failedInspector, e.what());
813 qFatal(
"Exception: %s.\n Stopping.", e.what());
827 QMutexLocker locker(&
mutex);
841 int rootIdx =
na->allocate(rootSpace);
842 assert(rootIdx == 0); (void) rootIdx;
844 root->setMarked(
true);
860 QMutexLocker locker(&
mutex);
864 QInputDialog::getText(
this,
"Add bookmark",
"Name:",
865 QLineEdit::Normal,
"",&ok);
870 text = QString(
"Node ")+QString().setNum(
bookmarks.size());
885 QMutexLocker locker(&
mutex);
899 QMutexLocker locker(&
mutex);
904 while (nextAlt >= 0) {
915 QMutexLocker locker(&
mutex);
918 setCursor(QCursor(Qt::CrossCursor));
923 QMutexLocker locker(&
mutex);
926 setCursor(QCursor(Qt::CrossCursor));
936 QMutexLocker locker(&
mutex);
949 QMutexLocker locker(&
mutex);
972 QMutexLocker locker(&
mutex);
986 QMutexLocker locker(&
mutex);
1000 QMutexLocker locker(&
mutex);
1007 QMutexLocker locker(&
mutex);
1025#if QT_VERSION >= 0x040400
1026 QString filename = QFileDialog::getSaveFileName(
this, tr(
"Export tree as pdf"),
"", tr(
"PDF (*.pdf)"));
1027 if (filename !=
"") {
1028 QPrinter printer(QPrinter::ScreenResolution);
1029 QMutexLocker locker(&
mutex);
1032 printer.setFullPage(
true);
1033#if QT_VERSION >= 0x060000
1042 printer.setOutputFileName(filename);
1043 QPainter painter(&printer);
1045 painter.setRenderHint(QPainter::Antialiasing);
1046#if QT_VERSION >= 0x060000
1047 QRect pageRect = printer.pageLayout().paintRectPixels(printer.resolution());
1049 QRect pageRect = printer.pageRect();
1052 static_cast<double>(pageRect.width()) / (bb.
right - bb.
left +
1055 static_cast<double>(pageRect.height()) /
1058 double printScale = std::min(newXScale, newYScale);
1059 painter.scale(printScale,printScale);
1064 QRect clip(0,0,0,0);
1077#if QT_VERSION >= 0x040400
1078 exportNodePDF(
root);
1084#if QT_VERSION >= 0x040400
1092 if (QPrintDialog(&printer,
this).exec() == QDialog::Accepted) {
1093 QMutexLocker locker(&
mutex);
1096#if QT_VERSION >= 0x060000
1097 QRect pageRect = printer.pageLayout().paintRectPixels(printer.resolution());
1099 QRect pageRect = printer.pageRect();
1102 static_cast<double>(pageRect.width()) / (bb.
right - bb.
left +
1105 static_cast<double>(pageRect.height()) /
1108 double printScale = std::min(newXScale, newYScale)*100;
1111 if (printScale > 400.0)
1113 printScale = printScale / 100.0;
1115 QPainter painter(&printer);
1116 painter.setRenderHint(QPainter::Antialiasing);
1117 painter.scale(printScale,printScale);
1118 painter.translate(
xtrans, 0);
1119 QRect clip(0,0,0,0);
1129 switch (
event->type()) {
1130 case QEvent::ToolTip:
1132 QHelpEvent* he =
static_cast<QHelpEvent*
>(
event);
1137 case QEvent::MouseButtonDblClick:
1138 case QEvent::MouseButtonPress:
1139 case QEvent::MouseButtonRelease:
1140 case QEvent::MouseMove:
1142 QMouseEvent* me =
static_cast<QMouseEvent*
>(
event);
1143#if QT_VERSION >= 0x060000
1144 x = me->position().x();
1145 y = me->position().y();
1152 case QEvent::ContextMenu:
1154 QContextMenuEvent* ce =
static_cast<QContextMenuEvent*
>(
event);
1162 QAbstractScrollArea* sa =
1163 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
1164 int xoff = sa->horizontalScrollBar()->value()/
scale;
1165 int yoff = sa->verticalScrollBar()->value()/
scale;
1170 if (w < sa->viewport()->width())
1171 xoff -= (sa->viewport()->width()-w)/2;
1176 static_cast<int>((y-30)/
scale+yoff));
1182 if (
mutex.tryLock()) {
1183 if (
event->type() == QEvent::ToolTip) {
1186 QHelpEvent* he =
static_cast<QHelpEvent*
>(
event);
1187 QToolTip::showText(he->globalPos(),
1191 QToolTip::hideText();
1196 return QWidget::event(
event);
1208 QPainter painter(
this);
1209 painter.setRenderHint(QPainter::Antialiasing);
1211 QAbstractScrollArea* sa =
1212 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
1213 int xoff = sa->horizontalScrollBar()->value()/
scale;
1214 int yoff = sa->verticalScrollBar()->value()/
scale;
1219 if (w < sa->viewport()->width())
1220 xoff -= (sa->viewport()->width()-w)/2;
1222 QRect origClip =
event->rect();
1223 painter.translate(0, 30);
1225 painter.translate(
xtrans-xoff, -yoff);
1226 QRect clip(
static_cast<int>(origClip.x()/
scale-
xtrans+xoff),
1227 static_cast<int>(origClip.y()/
scale+yoff),
1228 static_cast<int>(origClip.width()/
scale),
1229 static_cast<int>(origClip.height()/
scale));
1246 if (
mutex.tryLock()) {
1247 if(
event->button() == Qt::LeftButton) {
1263 if (
mutex.tryLock()) {
1279 QAbstractScrollArea* sa =
1280 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
1282 int w = sa->horizontalScrollBar()->maximum()+e->oldSize().width();
1283 int h = sa->verticalScrollBar()->maximum()+e->oldSize().height();
1285 sa->horizontalScrollBar()->setRange(0,w-e->size().width());
1286 sa->verticalScrollBar()->setRange(0,h-e->size().height());
1287 sa->horizontalScrollBar()->setPageStep(e->size().width());
1288 sa->verticalScrollBar()->setPageStep(e->size().height());
1293 if (
event->modifiers() & Qt::ShiftModifier) {
1295#if QT_VERSION >= 0x060000
1298 event->position().x(),
event->position().y());
1332 Space* curSpace =
nullptr;
1335 if (curSpace ==
nullptr)
1340 qFatal(
"Exception in move inspector %d: %s.\n Stopping.",
1353 setCursor(QCursor(Qt::ArrowCursor));
1363 if (
mutex.tryLock()) {
1364 if (
event->button() == Qt::LeftButton) {
1370 Space* curSpace =
nullptr;
1371 Space* compareSpace =
nullptr;
1374 if (curSpace ==
nullptr) {
1382 switch (compareSpace->
status()) {
1396 comparators[i].first->compare(*curSpace,*compareSpace);
1398 qFatal(
"Exception in comparator %d: %s.\n Stopping.",
1408 setCursor(QCursor(Qt::ArrowCursor));
int size(void) const
Return size of array (number of elements).
Exception: Base-class for exceptions
virtual const char * what(void) const noexcept
Return information.
Static reference to the currently best space.
int right
Right coordinate.
Abstract base class for comparators.
A cursor that frees all memory.
A cursor that draws a tree on a QWidget.
Abstract base class for inspectors.
A cursor that finds the next solution.
Cursor & getCursor(void)
Return the cursor.
NodeAllocatorBase< VisualNode > NodeAllocator
unsigned int getNumberOfChildren(void) const
Return the number of children.
int getParent(void) const
Return the parent.
int getChild(int n) const
Return index of child no n.
bool isRoot(void) const
Check if this node is the root of a tree.
Run a cursor over a tree, processing nodes in pre-order.
void run(void)
Execute visitor.
A stack item for depth first search.
int noOfChildren
The number of children.
SearchItem(VisualNode *n0, int noOfChildren0)
Constructor.
int i
The currently explored child.
void update(int w, int h, int scale0)
void solution(const Space *)
void searchFinished(void)
void search(VisualNode *n, bool all, TreeCanvas *ti)
void moveToNode(VisualNode *n, bool)
int depth(void) const
Return depth of the shape.
bool hasCopy(void)
Return whether the node has a copy.
const Choice * getChoice(void)
Return choice of this node.
const Space * getWorkingSpace(void) const
Return working space (if present).
int getNumberOfChildNodes(NodeAllocator &na, BestNode *curBest, Statistics &stats, int c_d, int a_d)
Compute and return the number of children.
int getAlternative(const NodeAllocator &na) const
Return alternative number of this node.
bool isOpen(void)
Return whether this node still has open children.
NodeStatus getStatus(void) const
Return current status of the node.
Space * getSpace(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Return working space. Receiver must delete the space.
void purge(const NodeAllocator &na)
Clear working space and copy (if present and this is not the root).
Statistics about the search tree
A canvas that displays the search tree.
double scale
Current scale factor.
void navNextSol(bool back=false)
Move selection to next solution (in DFS order).
void update(void)
Update display.
void zoomToFit(void)
Zoom the canvas so that the whole tree fits.
void resizeToOuter(void)
Resize to the outer widget size if auto zoom is enabled.
void activateComparator(int i, bool active)
Set active comparator.
void exportPDF(void)
Export pdf of the current subtree.
int targetX
Target x coordinate after smooth scrolling.
void wheelEvent(QWheelEvent *event)
Handle mouse wheel events.
Statistics stats
Statistics about the search tree.
void resizeEvent(QResizeEvent *event)
Handle resize event.
int targetScale
Target scale after layout.
QVector< VisualNode * > bookmarks
The bookmarks map.
SearcherThread searcher
Search engine thread.
VisualNode * currentNode
The currently selected node.
bool finish(void)
Stop search and wait for it to finish.
void exportWholeTreePDF(void)
Export pdf of the whole tree.
int xtrans
Offset on the x axis so that the tree is centered.
void activateDoubleClickInspector(int i, bool active)
Set active inspector.
void navUp(void)
Move selection to the parent of the selected node.
bool autoHideFailed
Whether to hide failed subtrees automatically.
void labelBranches(void)
Label all branches in subtree under current node.
VisualNode * eventNode(QEvent *event)
Return the node corresponding to the event position.
void contextMenuEvent(QContextMenuEvent *event)
Handle context menu event.
void startCompareNodesBeforeFP(void)
Wait for click on node to compare with current node before fixpoint.
void startCompareNodes(void)
Wait for click on node to compare with current node.
void addComparator(Comparator *c)
Add comparator c.
void inspectBeforeFP(void)
Calls inspectCurrentNode(false).
void hideFailed(void)
Hide failed subtrees of selected node.
bool getAutoZoom(void)
Return preference whether to automatically zoom to fit.
void setRefreshPause(int i)
Set refresh pause in msec.
void bookmarkNode(void)
Bookmark current node.
void print(void)
Print the tree.
void searchAll(void)
Explore complete subtree of selected node.
QTimeLine scrollTimeLine
Timer for smooth scrolling.
int layoutDoneTimerId
Timer id for delaying the update.
void addSolutionInspector(Inspector *i)
Add inspector i.
int targetH
Target height after layout.
bool smoothScrollAndZoom
Whether to use smooth scrolling and zooming.
QTimeLine zoomTimeLine
Timer for smooth zooming.
void setPath(void)
Set the current node to be the head of the path.
void navRoot(void)
Move selection to the root node.
void statusChanged(VisualNode *, const Statistics &, bool)
Status bar update.
TreeCanvas(Space *rootSpace, bool bab, QWidget *parent, const Options &opt)
Constructor.
~TreeCanvas(void)
Destructor.
bool event(QEvent *event)
General event handler, used for displaying tool tips.
void setMoveDuringSearch(bool b)
Set preference whether to move cursor during search.
void searchOne(void)
Find next solution below selected node.
void scroll(void)
React to scroll events.
void navDown(void)
Move selection to the first child of the selected node.
QVector< QPair< Comparator *, bool > > comparators
The registered comparators, and whether they are active.
bool compareNodes
Whether node comparison action is running.
void scaleTree(int scale0, int zoomx=-1, int zoomy=-1)
Set scale factor to scale0.
void activateSolutionInspector(int i, bool active)
Set active inspector.
int c_d
The recomputation distance.
void mousePressEvent(QMouseEvent *event)
Handle mouse press event.
void navLeft(void)
Move selection to the left sibling of the selected node.
QSlider * scaleBar
The scale bar.
int targetY
Target y coordinate after smooth scrolling.
QVector< QPair< Inspector *, bool > > doubleClickInspectors
The registered click inspectors, and whether they are active.
void autoZoomChanged(bool)
The auto-zoom state was changed.
void setRefresh(int i)
Set refresh rate.
Node::NodeAllocator * na
Allocator for nodes.
BestNode * curBest
The currently best solution (for branch-and-bound).
void paintEvent(QPaintEvent *event)
Paint the tree.
GecodeQMutex mutex
Mutex for synchronizing access to the tree.
void unstopAll(void)
Do not stop at any stop node.
bool moveDuringSearch
Whether to move cursor during search.
bool getSmoothScrollAndZoom(void)
Return preference whether to use smooth scrolling and zooming.
void mouseDoubleClickEvent(QMouseEvent *event)
Handle mouse double click event.
int a_d
The adaptive recomputation distance.
void unhideAll(void)
Unhide all nodes below selected node.
void searchFinished(void)
Signals that Gist is finished.
int sourceX
Source x coordinate after smooth scrolling.
GecodeQMutex layoutMutex
Mutex for synchronizing layout and drawing.
void scaleChanged(int)
The scale factor has changed.
bool getAutoHideFailed(void)
Return preference whether to automatically hide failed subtrees.
void solution(const Space *)
Signals that a solution has been found.
int targetW
Target width after layout.
void setRecompDistances(int c_d, int a_d)
Set recomputation distances.
void addMoveInspector(Inspector *i)
Add inspector i.
bool autoZoom
Whether to zoom automatically.
void emitStatusChanged(void)
Re-emit status change information for current node.
void setAutoZoom(bool b)
Set preference whether to automatically zoom to fit.
void centerCurrentNode(void)
Center the view on the currently selected node.
void setSmoothScrollAndZoom(bool b)
Set preference whether to use smooth scrolling and zooming.
bool finishedFlag
Flag signalling that Gist is ready to be closed.
void removedBookmark(int idx)
Signals that a bookmark has been removed.
VisualNode * pathHead
The head of the currently selected path.
void activateMoveInspector(int i, bool active)
Set active inspector.
void setCurrentNode(VisualNode *n, bool finished=true, bool update=true)
Set the selected node to n.
void contextMenu(QContextMenuEvent *)
Context menu triggered.
bool stopSearchFlag
Flag signalling the search to stop.
void setShowCopies(bool b)
Set preference whether to show copies in the tree.
void labelPath(void)
Label all branches on path to root node.
void layoutDone(int w, int h, int scale0)
Layout done.
virtual void timerEvent(QTimerEvent *e)
Timer invoked for smooth zooming and scrolling.
bool getMoveDuringSearch(void)
Return preference whether to move cursor during search.
bool compareNodesBeforeFP
Whether node comparison action computes fixpoint.
void toggleStop(void)
Do not stop at selected stop node.
void toggleHidden(void)
Toggle hidden state of selected node.
void navRight(void)
Move selection to the right sibling of the selected node.
void navPrevSol(void)
Move selection to previous solution (in DFS order).
bool showCopies
Whether to show copies in the tree.
void inspectPath(void)
Call the double click inspector for all nodes on the path from root to head of the path.
bool getShowCopies(void)
Return preference whether to show copies in the tree.
VisualNode * root
The root node of the tree.
void stopSearch(void)
Stop current search.
void inspectCurrentNode(bool fix=true, int inspectorNo=-1)
Call the double click inspector for the currently selected node.
int sourceY
Target y coordinate after smooth scrolling.
void setAutoHideFailed(bool b)
Set preference whether to automatically hide failed subtrees.
void addDoubleClickInspector(Inspector *i)
Add inspector i.
int refreshPause
Time (in msec) to pause after each refresh.
QVector< QPair< Inspector *, bool > > moveInspectors
The registered move inspectors, and whether they are active.
QVector< QPair< Inspector *, bool > > solutionInspectors
The registered solution inspectors, and whether they are active.
void addedBookmark(const QString &id)
Signals that a bookmark has been added.
Node class that supports visual layout
bool isHidden(void)
Return if node is hidden.
void dirtyUp(const NodeAllocator &na)
Mark all nodes up the path to the parent as dirty.
std::string toolTip(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Return string that is used as a tool tip.
void hideFailed(const NodeAllocator &na, bool onlyDirty=false)
Hide all failed subtrees of this node.
BoundingBox getBoundingBox(void)
Return the bounding box.
void setMarked(bool m)
Set mark of this node.
Shape * getShape(void)
Return the shape of this node.
int bab(Space *root, const Gist::Options &opt=Gist::Options::def)
Create a new stand-alone Gist for branch-and-bound search of root.
Space * clone(void) const
Clone space.
SpaceStatus status(StatusStatistics &stat)
Query space status.
void commit(const Choice &c, unsigned int a)
Commit choice c for alternative a.
@ SS_BRANCH
Space must be branched (at least one brancher left)
@ SS_SOLVED
Space is solved (no brancher left)
@ SS_FAILED
Space is failed
const int maxScale
Maximum scale factor.
const int defScale
Default scale factor.
const int minScale
Minimum scale factor.
const int maxAutoZoomScale
Maximum scale factor for automatic zoom.
The Gecode Interactive Search Tool.
@ UNDETERMINED
Node that has not been explored yet.
@ UNSTOP
Node representing ignored stop point.
@ FAILED
Node representing failure.
@ STOP
Node representing stop point.
@ SOLVED
Node representing a solution.
@ BRANCH
Node representing a branch.
Space * snapshot(Space *s, const Options &o)
Clone space s depending on options o.
Gecode toplevel namespace
T * dfs(T *s, const Search::Options &o=Search::Options::def)
Invoke depth-first search engine for subclass T of space s with options o.
#define GECODE_NEVER
Assert that this command is never executed.