|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
savi.visualization.support.TaskPanel
savi.visualization.support.SimPanel
public abstract class SimPanel
Main class providing settings control for simulation annealing, vizualization, graph and help.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Panel |
---|
java.awt.Panel.AccessibleAWTPanel |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected SimAnnealingStepSolver |
alg
algorithm |
protected VisualizationPanel |
bestScreen
panel for vizualization best solution |
protected StateSkeleton |
bestState
best founded state |
protected VisualizationGraph |
graph
graph visualization panel |
protected java.awt.Panel |
ide
control environment panel |
protected VisualizationInfo |
infoPanel
help panel |
protected boolean |
isRunning
signalizes running of algorithm |
protected java.lang.Thread |
runThread
run thread reference |
protected VisualizationPanel |
screen
palace for visualization panel |
protected java.awt.Panel |
settings
panel with settings controls |
protected StateSkeleton |
state
state of problem |
protected boolean |
viewCurrent
signalizes vizualization visiblity of current or best state |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
SimPanel(VisualizationPanel vp,
double startTemp,
double finalTemp,
double coolingCoef,
int innerLoops)
Creates a new instance of SimPanel, initialize SA starting values. |
Method Summary | |
---|---|
void |
activateScreenView()
This method switch between best and current solution according to viewCurrent variable. |
void |
activateView(int v)
Activate given view. 1 ... view current / best solution 2 ... graph of optimalization criterion 3 ... help |
protected void |
addEmptySpace()
Adds empty space for correct alignment. |
protected java.awt.Button |
addInputButton(java.lang.String title)
Adds button into settings panel. |
protected java.awt.TextField |
addInputField(java.lang.String title,
java.lang.String initialValue)
Adds input field (text field). |
protected java.awt.Label |
addOutputField(java.lang.String title,
java.lang.String baseValue)
Adds output field (label). |
void |
callSaveInstance()
This method opens File save dialog and save current problem instance. |
protected abstract VisualizationInfo |
getInfoPanel()
This method must be implemented. |
protected StateSkeleton |
getState()
Return internal state. |
protected boolean |
initAlg()
Initialize algorithm for solving. |
protected void |
initComponents()
Initialize components. |
protected abstract void |
initState()
This must be implemented, initialize problem state. |
protected void |
oneStep()
Makes one step of algorithm. |
protected void |
oneStepAndUpdateView()
Makes one step of algorithm and updates all information components. |
void |
run()
Thread is constructed using a separate Runnable run object. |
protected void |
running(boolean r)
Set components according to running state. |
void |
setEnableIDE(boolean e)
Enables or disables the IDE (all components for input). |
void |
setViewCurrent(boolean vc)
This method switch between best and current solution. |
void |
startAnimation()
Starts visualization run. |
protected void |
traverseComponentsSetEnabled(java.awt.Component c,
boolean e)
Traverse container and set enabled to each component. |
protected void |
updateComponentsByState(savi.visualization.support.SimPanel.STATE s)
Updates components by current simulation state (definition problem / running simulation). |
protected void |
updateDisplay()
Update info panel (display) in dependence of best/current state. |
protected void |
updateDisplay(StateSkeleton s)
Update info panel (display) with given state. |
protected void |
updateView()
Update visualization panels (alert of state change). |
Methods inherited from class savi.visualization.support.TaskPanel |
---|
getSimulationName |
Methods inherited from class java.awt.Panel |
---|
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, checkImage, checkImage, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.awt.Panel settings
protected java.awt.Panel ide
protected boolean isRunning
protected java.lang.Thread runThread
protected StateSkeleton state
protected VisualizationPanel screen
protected VisualizationPanel bestScreen
protected VisualizationGraph graph
protected VisualizationInfo infoPanel
protected SimAnnealingStepSolver alg
protected StateSkeleton bestState
protected boolean viewCurrent
Constructor Detail |
---|
public SimPanel(VisualizationPanel vp, double startTemp, double finalTemp, double coolingCoef, int innerLoops)
vp
- reference to visualization panelstartTemp
- starting temperaturefinalTemp
- final temperaturecoolingCoef
- cooling coeficientinnerLoops
- number of inner loopsMethod Detail |
---|
protected void initComponents()
protected abstract VisualizationInfo getInfoPanel()
protected java.awt.Label addOutputField(java.lang.String title, java.lang.String baseValue)
title
- label captionbaseValue
- initial value
protected java.awt.TextField addInputField(java.lang.String title, java.lang.String initialValue)
title
- captioninitialValue
- initial value
protected java.awt.Button addInputButton(java.lang.String title)
title
- caption
protected void addEmptySpace()
protected abstract void initState()
protected StateSkeleton getState()
protected void updateView()
protected boolean initAlg()
true
if algorithm is properly initializedprotected void updateDisplay(StateSkeleton s)
s
- stateprotected void updateDisplay()
protected void oneStep()
protected void oneStepAndUpdateView()
protected void running(boolean r)
r
- running statepublic void run()
run
object. The thread
is used for animation.
run
in interface java.lang.Runnable
public void startAnimation()
protected void traverseComponentsSetEnabled(java.awt.Component c, boolean e)
c
- container to traversee
- enable valueprotected void updateComponentsByState(savi.visualization.support.SimPanel.STATE s)
s
- simulation statepublic void setEnableIDE(boolean e)
e
- enables the IDE if true
else disable itpublic void setViewCurrent(boolean vc)
viewCurrent
variable and call activateScreenView
.
vc
- activates current solution view if true
else best solution is
activatedpublic void activateView(int v)
v
- view indexpublic void activateScreenView()
viewCurrent
variable.
public void callSaveInstance()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |