use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class WeightPlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<BooleanParameterValue> normaliseToScoresParameter = BooleanParameterType.build(NORMALISE_AVAILABLE_PARAMETER_ID);
normaliseToScoresParameter.setName("Normalise By Max Available Score");
normaliseToScoresParameter.setDescription("Normalise calculated scores by the maximum calculated score");
normaliseToScoresParameter.setBooleanValue(false);
parameters.addParameter(normaliseToScoresParameter);
return parameters;
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class CosineSimilarityPlugin 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;
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class DirectedShortestPathsPluginNGTest method testCreateParameters.
/**
* Test of createParameters method, of class DirectedShortestPathsPlugin.
*/
@Test
public void testCreateParameters() {
System.out.println("createParameters");
final DirectedShortestPathsPlugin instance = new DirectedShortestPathsPlugin();
final PluginParameters params = instance.createParameters();
assertEquals(params.getParameters().size(), 1);
assertTrue(params.getParameters().containsKey(SOURCE_NODE_PARAMETER_ID));
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class DirectedShortestPathsPluginNGTest method testUpdateParametersNullGraph.
/**
* Test of updateParameters method, of class DirectedShortestPathsPlugin. Null Graph
*/
@Test
public void testUpdateParametersNullGraph() {
System.out.println("updateParametersNullGraph");
final DirectedShortestPathsPlugin instance = new DirectedShortestPathsPlugin();
final PluginParameters params = instance.createParameters();
final PluginParameter<SingleChoiceParameterValue> sourceNode = (PluginParameter<SingleChoiceParameterValue>) params.getParameters().get(SOURCE_NODE_PARAMETER_ID);
assertTrue(SingleChoiceParameterType.getOptions(sourceNode).isEmpty());
instance.updateParameters(null, params);
assertTrue(SingleChoiceParameterType.getOptions(sourceNode).isEmpty());
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class BetweennessCentralityPluginNGTest method testDirectedBetweenness.
@Test
public void testDirectedBetweenness() throws Exception {
final BetweennessCentralityPlugin instance = new BetweennessCentralityPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(BetweennessCentralityPlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, false);
parameters.setBooleanValue(BetweennessCentralityPlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, true);
parameters.setBooleanValue(BetweennessCentralityPlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, true);
parameters.setBooleanValue(BetweennessCentralityPlugin.NORMALISE_AVAILABLE_PARAMETER_ID, false);
parameters.setBooleanValue(BetweennessCentralityPlugin.NORMALISE_POSSIBLE_PARAMETER_ID, false);
parameters.setBooleanValue(BetweennessCentralityPlugin.NORMALISE_CONNECTED_COMPONENTS_PARAMETER_ID, false);
parameters.setBooleanValue(BetweennessCentralityPlugin.SELECTED_ONLY_PARAMETER_ID, false);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(vertexOutBetweennessAttribute, vxId0), 0f);
assertEquals(graph.getFloatValue(vertexOutBetweennessAttribute, vxId1), 3f);
assertEquals(graph.getFloatValue(vertexOutBetweennessAttribute, vxId2), 0f);
assertEquals(graph.getFloatValue(vertexOutBetweennessAttribute, vxId3), 3f);
assertEquals(graph.getFloatValue(vertexOutBetweennessAttribute, vxId4), 0f);
}
Aggregations