public class ValueFunctionVisualizerGUI
extends javax.swing.JFrame
implements java.awt.event.ItemListener
javax.swing.JFrame.AccessibleJFramejava.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
protected int |
cHeight
Visualizer canvas height
|
protected int |
cWidth
Visualizer canvas width
|
protected PolicyRenderLayer |
pLayer
The policy renderer
|
protected StaticDomainPainter |
sdp
Painter used to visualize general state-independent domain information
|
protected javax.swing.JCheckBox |
showPolicy
The button to enable the visualization of the policy
|
protected StatePolicyPainter |
spp
Painter used to visualize the policy
|
protected java.util.List<State> |
statesToVisualize |
protected StateValuePainter |
svp
Painter used to visualize the value function
|
protected ValueFunctionRenderLayer |
vfLayer
The value function renderer
|
protected MultiLayerRenderer |
visualizer
The multi-layer render layer canvas
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabledCROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
ValueFunctionVisualizerGUI(java.util.List<State> states,
StateValuePainter svp,
ValueFunction valueFunction)
Initializes the visualizer GUI.
|
| Modifier and Type | Method and Description |
|---|---|
static ValueFunctionVisualizerGUI |
createGridWorldBasedValueFunctionVisualizerGUI(java.util.List<State> states,
ValueFunction valueFunction,
Policy p,
java.lang.String classWithPositionAtts,
java.lang.String xAttName,
java.lang.String yAttName,
java.lang.String northActionName,
java.lang.String southActionName,
java.lang.String eastActionName,
java.lang.String westActionName)
A method for creating common 2D arrow glyped value function and policy visualization.
|
MultiLayerRenderer |
getMultiLayerRenderer()
Returns the
MultiLayerRenderer used in this GUI. |
StatePolicyPainter |
getSpp()
Returns the state-wise policy painter
|
StateValuePainter |
getSvp()
Returns the State-wise value function painter
|
void |
initGUI()
Initializes the GUI and presents it to the user.
|
void |
itemStateChanged(java.awt.event.ItemEvent e)
Called when the check back for the policy rendering is checked or unchecked.
|
void |
setBgColor(java.awt.Color col)
Sets the canvas background color
|
void |
setPolicy(Policy p)
Sets the policy to render
|
void |
setSpp(StatePolicyPainter spp)
Sets the state-wise policy painter
|
void |
setSvp(StateValuePainter svp)
Sets the state-wise value function painter
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected MultiLayerRenderer visualizer
protected ValueFunctionRenderLayer vfLayer
protected PolicyRenderLayer pLayer
protected StateValuePainter svp
protected StatePolicyPainter spp
protected java.util.List<State> statesToVisualize
protected StaticDomainPainter sdp
protected javax.swing.JCheckBox showPolicy
protected int cWidth
protected int cHeight
public ValueFunctionVisualizerGUI(java.util.List<State> states, StateValuePainter svp, ValueFunction valueFunction)
states - the states whose value should be rendered.svp - the value function state visualizer to use.valueFunction - the valueFunction that can return the state values.public static ValueFunctionVisualizerGUI createGridWorldBasedValueFunctionVisualizerGUI(java.util.List<State> states, ValueFunction valueFunction, Policy p, java.lang.String classWithPositionAtts, java.lang.String xAttName, java.lang.String yAttName, java.lang.String northActionName, java.lang.String southActionName, java.lang.String eastActionName, java.lang.String westActionName)
ArrowActionGlyph
objects. The GUI will not be launched by default; call the initGUI() on the returned object to start it.states - the states whose value should be rendered.valueFunction - the valueFunction that can return the state values.p - the policy to renderclassWithPositionAtts - the class which contains the x-y position information of the statexAttName - the name of the x attributeyAttName - the name of the y attributenorthActionName - the name of the north actionsouthActionName - the name of the south actioneastActionName - the name of the east actionwestActionName - the name of the west actionValueFunctionVisualizerGUIpublic MultiLayerRenderer getMultiLayerRenderer()
MultiLayerRenderer used in this GUI.MultiLayerRenderer used in this GUI.public StateValuePainter getSvp()
public void setSvp(StateValuePainter svp)
svp - state-wise value function painterpublic StatePolicyPainter getSpp()
public void setSpp(StatePolicyPainter spp)
spp - the state-wise policy painterpublic void setBgColor(java.awt.Color col)
col - the canvas background colorpublic void setPolicy(Policy p)
p - the policy to renderpublic void initGUI()
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListener