edu.washington.cs.supple.render.search
Class NaiveShortcutSolver
java.lang.Object
edu.washington.cs.supple.render.AbstractSolver
edu.washington.cs.supple.render.search.BottomUpSearchSolver
edu.washington.cs.supple.render.search.AbstractShortcutSolver
edu.washington.cs.supple.render.search.NaiveShortcutSolver
- All Implemented Interfaces:
- Solver
- public class NaiveShortcutSolver
- extends AbstractShortcutSolver
- Author:
- kgajos
This class hosts a solver for interfaces involving navigational and
primitive shortctus; it was meant to be a strawman for comparisons with the
more sophisticated ShortcutSolver but it proved to be as good but much
faster than its more elaborate relative; at the moment this is the default
shortcut solver
| Fields inherited from class edu.washington.cs.supple.render.AbstractSolver |
bags, BOTTOM_UP, constraintFactory, costFunction, currentRenderingConstraints, currentRenderingHints, curSearchParameters, curSolution, curSolutionRoot, finalSolutionListeners, interrupted, listener, MRV, propagationLevels, searchCount, SORT_COST, SORT_COST_REVERSE, SORT_RANDOM, spies, TOP_DOWN, valueSorting, variableOrdering, widgetFactory |
| Methods inherited from class edu.washington.cs.supple.render.AbstractSolver |
addFinalSolutionListener, addSpy, applyConstraint, applyConstraints, applyCostFunction, applyHint, applyHints, applyRenderingConstraint, applySameRenderingConstraint, applySameRenderingHint, buildBagStructure, getBottomUpNodeList, getLeafNodes, getShortcutCost, getTopDownNodeList, interruptSearch, notifyFinalSolutionListeners, notifySpies, removeFinalSolutionListener, removeSpy, reset, setListener, solutionFound, solutionFound, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
recentShortcuts
protected java.util.Vector recentShortcuts
NaiveShortcutSolver
public NaiveShortcutSolver()
searchDispatch
protected boolean searchDispatch(WidgetBag root,
java.util.Vector nodes)
throws java.lang.InterruptedException
- Description copied from class:
BottomUpSearchSolver
- A convenience method -- subclasses may override it if they need to do
some processing before search procedure is invoked
- Overrides:
searchDispatch in class BottomUpSearchSolver
- Parameters:
root - nodes -
- Returns:
-
- Throws:
java.lang.InterruptedException
findShortcuts
protected java.util.Vector findShortcuts(WidgetBag root)
- Computes both nav and primitive shortcuts for a given rendering
- Parameters:
root - a widget bag representing a concrete rendering
- Returns:
- a set of shortcuts
findNavShortcuts
protected java.util.Collection findNavShortcuts(WidgetBag root,
GraphTransitionCount graph)
- Finds nav shortcuts for a given rendering
- Parameters:
root - a widget bag representing a particular renderinggraph - a graph transition count representing the usage patterns in a
particular rendering
- Returns:
- a collection of nav shortcuts
findFakePrimitiveShortcut
protected java.util.Vector findFakePrimitiveShortcut(UiObject root)
findPrimitiveShortcuts
protected java.util.Vector findPrimitiveShortcuts(WidgetBag root,
GraphTransitionCount tc)
- Finds the best primitive shortcuts given a solved rendering and an
initialized graph transition count; assumes that nav shortcuts have not
been set yet
- Parameters:
root - root of the solved renderingtc - a graph transition count reflecting current trace
- Returns:
- a vector of primitive shortcuts