use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class LevenshteinDistancePlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<SingleChoiceParameterType.SingleChoiceParameterValue> attributeType = SingleChoiceParameterType.build(ATTRIBUTE_PARAMETER_ID);
attributeType.setName("Compare Attribute");
attributeType.setDescription("The node attribute to compare");
parameters.addParameter(attributeType);
final PluginParameter<IntegerParameterValue> maxDistance = IntegerParameterType.build(MAXIMUM_DISTANCE_PARAMETER_ID);
maxDistance.setName("Maximum Distance");
maxDistance.setDescription("Only draws links between nodes whose attributes are at most this far apart");
maxDistance.setIntegerValue(1);
IntegerParameterType.setMinimum(maxDistance, 0);
parameters.addParameter(maxDistance);
final PluginParameter<BooleanParameterValue> caseInsensitiveParameter = BooleanParameterType.build(CASE_INSENSITIVE_PARAMETER_ID);
caseInsensitiveParameter.setName("Case Insensitive");
caseInsensitiveParameter.setDescription("Ignore case when comparing attribute");
caseInsensitiveParameter.setBooleanValue(false);
parameters.addParameter(caseInsensitiveParameter);
final PluginParameter<BooleanParameterValue> selectedOnlyParameter = BooleanParameterType.build(SELECTED_ONLY_PARAMETER_ID);
selectedOnlyParameter.setName("Selected Only");
selectedOnlyParameter.setDescription("Compare selected nodes only");
selectedOnlyParameter.setBooleanValue(false);
parameters.addParameter(selectedOnlyParameter);
return parameters;
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class PreferentialAttachmentPlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<BooleanParameterValue> includeConnectionsInParameter = BooleanParameterType.build(INCLUDE_CONNECTIONS_IN_PARAMETER_ID);
includeConnectionsInParameter.setName("Include Incoming");
includeConnectionsInParameter.setDescription("Include incoming connections");
includeConnectionsInParameter.setBooleanValue(true);
parameters.addParameter(includeConnectionsInParameter);
final PluginParameter<BooleanParameterValue> includeConnectionsOutParameter = BooleanParameterType.build(INCLUDE_CONNECTIONS_OUT_PARAMETER_ID);
includeConnectionsOutParameter.setName("Include Outgoing");
includeConnectionsOutParameter.setDescription("Include outgoing connections");
includeConnectionsOutParameter.setBooleanValue(true);
parameters.addParameter(includeConnectionsOutParameter);
final PluginParameter<BooleanParameterValue> treatUndirectedBidirectionalParameter = BooleanParameterType.build(TREAT_UNDIRECTED_BIDIRECTIONAL_PARAMETER_ID);
treatUndirectedBidirectionalParameter.setName("Include Undirected");
treatUndirectedBidirectionalParameter.setDescription("Treat undirected connections as bidirectional connections");
treatUndirectedBidirectionalParameter.setBooleanValue(true);
parameters.addParameter(treatUndirectedBidirectionalParameter);
final PluginParameter<BooleanParameterValue> selectedOnlyParameter = BooleanParameterType.build(SELECTED_ONLY_PARAMETER_ID);
selectedOnlyParameter.setName("Selected Only");
selectedOnlyParameter.setDescription("Calculate using only selected elements");
selectedOnlyParameter.setBooleanValue(false);
parameters.addParameter(selectedOnlyParameter);
return parameters;
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class EccentricityPluginNGTest method testNormalisedEccentricity.
@Test
public void testNormalisedEccentricity() throws Exception {
final EccentricityPlugin instance = new EccentricityPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(EccentricityPlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, true);
parameters.setBooleanValue(EccentricityPlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, true);
parameters.setBooleanValue(EccentricityPlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, true);
parameters.setBooleanValue(EccentricityPlugin.NORMALISE_AVAILABLE_PARAMETER_ID, true);
parameters.setBooleanValue(EccentricityPlugin.NORMALISE_CONNECTED_COMPONENTS_PARAMETER_ID, false);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId0), 1.0f - (3.0f / 3.0f));
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId1), 1.0f - (2.0f / 3.0f));
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId2), 1.0f - (2.0f / 3.0f));
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId3), 1.0f - (2.0f / 3.0f));
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId4), 1.0f - (3.0f / 3.0f));
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class EccentricityPluginNGTest method testEccentricity.
@Test
public void testEccentricity() throws Exception {
final EccentricityPlugin instance = new EccentricityPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(EccentricityPlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, true);
parameters.setBooleanValue(EccentricityPlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, true);
parameters.setBooleanValue(EccentricityPlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, true);
parameters.setBooleanValue(EccentricityPlugin.NORMALISE_AVAILABLE_PARAMETER_ID, false);
parameters.setBooleanValue(EccentricityPlugin.NORMALISE_CONNECTED_COMPONENTS_PARAMETER_ID, false);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId0), 3.0f);
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId1), 2.0f);
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId2), 2.0f);
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId3), 2.0f);
assertEquals(graph.getFloatValue(vertexEccentricityAttribute, vxId4), 3.0f);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class LocalClusteringCoefficientPluginNGTest method testNormalisedLocalClusteringCoefficient.
@Test
public void testNormalisedLocalClusteringCoefficient() throws Exception {
final LocalClusteringCoefficientPlugin instance = new LocalClusteringCoefficientPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(LocalClusteringCoefficientPlugin.NORMALISE_AVAILABLE_PARAMETER_ID, true);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(vertexLocalClusteringCoefficientAttribute, vxId0), 0f / 1.0f);
assertEquals(graph.getFloatValue(vertexLocalClusteringCoefficientAttribute, vxId1), 0.33333334f / 1.0f);
assertEquals(graph.getFloatValue(vertexLocalClusteringCoefficientAttribute, vxId2), 1.0f / 1.0f);
assertEquals(graph.getFloatValue(vertexLocalClusteringCoefficientAttribute, vxId3), 0.33333334f / 1.0f);
assertEquals(graph.getFloatValue(vertexLocalClusteringCoefficientAttribute, vxId4), 0f / 1.0f);
}
Aggregations