Class AlgorithmVisualizationWindow
- java.lang.Object
-
- ai.libs.jaicore.graphvisualizer.window.AlgorithmVisualizationWindow
-
- All Implemented Interfaces:
java.lang.Runnable
public class AlgorithmVisualizationWindow extends java.lang.Object implements java.lang.RunnableAnAlgorithmVisualizationWindowcan be created to have a visualization of the behavior of an algorithm. We generally differentiate between a live version of anIAlgorithmrun for which an instance of that algorithm and a list ofAlgorithmEventPropertyComputers is required and an offline run, for which only anAlgorithmEventHistoryis required. In the first case, the property computers are used to extract relevant information which is required by theIGUIPlugins (to be displayed) from the underlyingIAlgorithmEvents which are provided by the actual algorithm. When playing a recording, these computers are not required as the data was already computed as is stored as part of the replay in theAlgorithmEventHistory. Furthermore it requires a mainIGUIPluginwhich will be displayed as the main element and optionally an unbounded amount of additionalIGUIPluginwhich will be displayed in order to provide additional information.
-
-
Constructor Summary
Constructors Constructor Description AlgorithmVisualizationWindow(AlgorithmEventHistory history)AlgorithmVisualizationWindow(AlgorithmEventHistory algorithmEventHistory, IGUIPlugin mainPlugin, IGUIPlugin... visualizationPlugins)Creates a newAlgorithmVisualizationWindowbased on the givenAlgorithmEventHistory(i.e. offline version), the mainIGUIPluginand optionally additional plugins.AlgorithmVisualizationWindow(org.api4.java.algorithm.IAlgorithm<?,?> algorithm)Creates a newAlgorithmVisualizationWindowbased on the givenIAlgorithm, the list ofAlgorithmEventPropertyComputers, a mainIGUIPluginand optionally additional plugins.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AlgorithmEventHistorygetAlgorithmEventHistory()Returns the underlyingAlgorithmEventHistory.voidrun()voidsetTitle(java.lang.String title)Sets the title of this window to the givenString.AlgorithmVisualizationWindowwithMainPlugin(IGUIPlugin plugin)AlgorithmVisualizationWindowwithPlugin(IGUIPlugin... pluginArray)
-
-
-
Constructor Detail
-
AlgorithmVisualizationWindow
public AlgorithmVisualizationWindow(AlgorithmEventHistory history)
-
AlgorithmVisualizationWindow
public AlgorithmVisualizationWindow(AlgorithmEventHistory algorithmEventHistory, IGUIPlugin mainPlugin, IGUIPlugin... visualizationPlugins)
Creates a newAlgorithmVisualizationWindowbased on the givenAlgorithmEventHistory(i.e. offline version), the mainIGUIPluginand optionally additional plugins.- Parameters:
algorithmEventHistory- TheAlgorithmEventHistoryproviding data to be displayed.mainPlugin- The mainIGUIPluginwhich will be displayed as the main information source.visualizationPlugins- A list of additionalIGUIPlugins displaying side information.
-
AlgorithmVisualizationWindow
public AlgorithmVisualizationWindow(org.api4.java.algorithm.IAlgorithm<?,?> algorithm)
Creates a newAlgorithmVisualizationWindowbased on the givenIAlgorithm, the list ofAlgorithmEventPropertyComputers, a mainIGUIPluginand optionally additional plugins. This constructor should be used when using a visualization in an online run.- Parameters:
algorithm- TheIAlgorithmyielding information to be displayed.algorithmEventPropertyComputers- TheAlgorithmEventPropertyComputers computing all information from theIAlgorithmEvents provided by theIAlgorithmwhich are required by theIGUIPlugins which are registered.mainPlugin- The mainIGUIPluginwhich will be displayed as the main information source.visualizationPlugins- A list of additionalIGUIPlugins displaying side information.
-
-
Method Detail
-
withMainPlugin
public AlgorithmVisualizationWindow withMainPlugin(IGUIPlugin plugin)
-
withPlugin
public AlgorithmVisualizationWindow withPlugin(IGUIPlugin... pluginArray)
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
setTitle
public void setTitle(java.lang.String title)
Sets the title of this window to the givenString.- Parameters:
title- The new title of this window.
-
getAlgorithmEventHistory
public AlgorithmEventHistory getAlgorithmEventHistory()
Returns the underlyingAlgorithmEventHistory.- Returns:
- The underlying
AlgorithmEventHistory.
-
-