Class HammingDistanceAlgorithm
java.lang.Object
org.graffiti.plugin.algorithm.AbstractAlgorithm
de.ipk_gatersleben.ag_nw.graffiti.plugins.algorithms.hamming_distance.HammingDistanceAlgorithm
- All Implemented Interfaces:
UndoableEdit
,Algorithm
public class HammingDistanceAlgorithm extends AbstractAlgorithm
This algorithm computes the hamming distances between directed graphs. The
hamming distance is the number of pairwise differences between the graphs,
whereas nodes, edges, or both and also edge labels can be considered. It uses
the node labels to compare nodes and the labels of nodes connected to the
edge to compare edges. Each node may have a distinguishable label.
- Author:
- Falk Schreiber
-
Constructor Summary
Constructors Constructor Description HammingDistanceAlgorithm()
-
Method Summary
Modifier and Type Method Description void
check()
Checks the preconditions of the algorithm.void
execute()
The main methodString
getCategory()
Returns the category an algorithm should assigned to.String
getName()
Returns the name of the algorithm.Parameter[]
getParameters()
Get parametersSet<Category>
getSetCategory()
Returns a set of categories to classify this algorithm .static void
main(String[] args)
void
setParameters(Parameter[] params)
Sets parametersMethods inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
addEdit, attach, canRedo, canUndo, die, doesUndo, getAcceleratorKeyStroke, getActionEvent, getDescription, getMenuCategory, getPresentationName, getRedoPresentationName, getUndoPresentationName, isAlwaysExecutable, isLayoutAlgorithm, isSignificant, markExecutionDone, markRedoDone, markUndoDone, mayWorkOnMultipleGraphs, redo, replaceEdit, reset, setActionEvent, showMenuIcon, undo
-
Constructor Details
-
HammingDistanceAlgorithm
public HammingDistanceAlgorithm()
-
-
Method Details
-
getName
Returns the name of the algorithm.- Returns:
- the name
-
check
Checks the preconditions of the algorithm.- Specified by:
check
in interfaceAlgorithm
- Overrides:
check
in classAbstractAlgorithm
- Throws:
PreconditionException
-
execute
public void execute()The main method -
main
-
getParameters
Get parameters- Specified by:
getParameters
in interfaceAlgorithm
- Overrides:
getParameters
in classAbstractAlgorithm
- Returns:
- Parameter
-
setParameters
Sets parameters- Specified by:
setParameters
in interfaceAlgorithm
- Overrides:
setParameters
in classAbstractAlgorithm
- Parameters:
params
- DOCUMENT ME!
-
getCategory
Description copied from interface:Algorithm
Returns the category an algorithm should assigned to. Return NULL if the algorithm should be sorted directly in the plugin menu.- Specified by:
getCategory
in interfaceAlgorithm
- Overrides:
getCategory
in classAbstractAlgorithm
- Returns:
- The category an algorithm should assigned to.
-
getSetCategory
Description copied from interface:Algorithm
Returns a set of categories to classify this algorithm . e.g. return new HashSet(Arrays.asList( Category.GRAPH, Category.NODE )); is an algorithm, working on graphs and more specific on nodes - Specified by:
getSetCategory
in interfaceAlgorithm
- Overrides:
getSetCategory
in classAbstractAlgorithm
- Returns:
- Set of Category Enums that classify this algorithm.
-