use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class AverageDegreeNGTest method testNoDirectionAverageDegree.
@Test
public void testNoDirectionAverageDegree() throws Exception {
final AverageDegreePlugin instance = new AverageDegreePlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(AverageDegreePlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, false);
parameters.setBooleanValue(AverageDegreePlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, false);
parameters.setBooleanValue(AverageDegreePlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, false);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(graphAttribute, 0), 0 / 0F);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class GraphDensityNGTest method testAverageDegree.
@Test
public void testAverageDegree() throws Exception {
final GraphDensityPlugin instance = new GraphDensityPlugin();
final PluginParameters parameters = instance.createParameters();
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(graphAttribute, 0), 0.15f);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class ConnectivityDegreePluginNGTest method testConnectivityDegreeSingletons.
@Test
public void testConnectivityDegreeSingletons() throws Exception {
final ConnectivityDegreePlugin instance = new ConnectivityDegreePlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(ConnectivityDegreePlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, true);
parameters.setBooleanValue(ConnectivityDegreePlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, true);
parameters.setBooleanValue(ConnectivityDegreePlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, true);
parameters.setBooleanValue(ConnectivityDegreePlugin.IGNORE_SINGLETONS, false);
parameters.setBooleanValue(ConnectivityDegreePlugin.NORMALISE, false);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(connectivityDegreeAttribute, vxId13), 2.0f);
assertEquals(graph.getFloatValue(componentSizeAttribute, vxId13), 5.0f);
assertEquals(graph.getFloatValue(connectivityDegreeAttribute, vxId1), 0.0f);
assertEquals(graph.getFloatValue(componentSizeAttribute, vxId1), 1.0f);
assertEquals(graph.getFloatValue(connectivityDegreeAttribute, vxId5), 0.0f);
assertEquals(graph.getFloatValue(componentSizeAttribute, vxId5), 3.0f);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class ConnectivityDegreePluginNGTest method testConnectivityDegree.
@Test
public void testConnectivityDegree() throws Exception {
final ConnectivityDegreePlugin instance = new ConnectivityDegreePlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(ConnectivityDegreePlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, true);
parameters.setBooleanValue(ConnectivityDegreePlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, true);
parameters.setBooleanValue(ConnectivityDegreePlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, true);
parameters.setBooleanValue(ConnectivityDegreePlugin.IGNORE_SINGLETONS, true);
parameters.setBooleanValue(ConnectivityDegreePlugin.NORMALISE, false);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(connectivityDegreeAttribute, vxId13), 1.0f);
assertEquals(graph.getFloatValue(componentSizeAttribute, vxId13), 5.0f);
assertEquals(graph.getFloatValue(connectivityDegreeAttribute, vxId1), 0.0f);
assertEquals(graph.getFloatValue(componentSizeAttribute, vxId1), 1.0f);
assertEquals(graph.getFloatValue(connectivityDegreeAttribute, vxId5), 0.0f);
assertEquals(graph.getFloatValue(componentSizeAttribute, vxId5), 3.0f);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class JaccardIndexPlugin 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<IntegerParameterValue> minCommonFeatures = IntegerParameterType.build(MINIMUM_COMMON_FEATURES_PARAMETER_ID);
minCommonFeatures.setName("Minimum Common Features");
minCommonFeatures.setDescription("Only calculate similarity between nodes that share at least this many features");
minCommonFeatures.setIntegerValue(3);
IntegerParameterType.setMinimum(minCommonFeatures, 1);
parameters.addParameter(minCommonFeatures);
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;
}
Aggregations