use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class BetweennessCentralityPluginNGTest method testNoDirectionBetweenness.
@Test
public void testNoDirectionBetweenness() 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, false);
parameters.setBooleanValue(BetweennessCentralityPlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, false);
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(vertexBetweennessAttribute, vxId0), 0F);
assertEquals(graph.getFloatValue(vertexBetweennessAttribute, vxId1), 0F);
assertEquals(graph.getFloatValue(vertexBetweennessAttribute, vxId2), 0F);
assertEquals(graph.getFloatValue(vertexBetweennessAttribute, vxId3), 0F);
assertEquals(graph.getFloatValue(vertexBetweennessAttribute, vxId4), 0F);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class BetweennessCentralityPluginNGTest method testUndirectedBetweenness.
@Test
public void testUndirectedBetweenness() throws Exception {
final BetweennessCentralityPlugin instance = new BetweennessCentralityPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(BetweennessCentralityPlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, true);
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(vertexBetweennessAttribute, vxId0), 0f);
assertEquals(graph.getFloatValue(vertexBetweennessAttribute, vxId1), 6f);
assertEquals(graph.getFloatValue(vertexBetweennessAttribute, vxId2), 0f);
assertEquals(graph.getFloatValue(vertexBetweennessAttribute, vxId3), 6f);
assertEquals(graph.getFloatValue(vertexBetweennessAttribute, vxId4), 0f);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class ClosenessCentralityPluginNGTest method testUndirectedCloseness.
@Test
public void testUndirectedCloseness() throws Exception {
final ClosenessCentralityPlugin instance = new ClosenessCentralityPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(ClosenessCentralityPlugin.HARMONIC_PARAMETER_ID, false);
parameters.setBooleanValue(ClosenessCentralityPlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.NORMALISE_AVAILABLE_PARAMETER_ID, false);
parameters.setBooleanValue(ClosenessCentralityPlugin.NORMALISE_POSSIBLE_PARAMETER_ID, false);
parameters.setBooleanValue(ClosenessCentralityPlugin.NORMALISE_CONNECTED_COMPONENTS_PARAMETER_ID, false);
parameters.setBooleanValue(ClosenessCentralityPlugin.SELECTED_ONLY_PARAMETER_ID, false);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId0), 0.125f);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId1), 0.2f);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId2), 0.16666667f);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId3), 0.2f);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId4), 0.125f);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class ClosenessCentralityPluginNGTest method testNormalisedUndirectedHarmonicCloseness.
@Test
public void testNormalisedUndirectedHarmonicCloseness() throws Exception {
final ClosenessCentralityPlugin instance = new ClosenessCentralityPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(ClosenessCentralityPlugin.HARMONIC_PARAMETER_ID, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.NORMALISE_AVAILABLE_PARAMETER_ID, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.NORMALISE_POSSIBLE_PARAMETER_ID, false);
parameters.setBooleanValue(ClosenessCentralityPlugin.NORMALISE_CONNECTED_COMPONENTS_PARAMETER_ID, false);
parameters.setBooleanValue(ClosenessCentralityPlugin.SELECTED_ONLY_PARAMETER_ID, false);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(vertexHarmonicClosenessAttribute, vxId0), 0.66666675f);
assertEquals(graph.getFloatValue(vertexHarmonicClosenessAttribute, vxId1), 1.2f / 1.2f);
assertEquals(graph.getFloatValue(vertexHarmonicClosenessAttribute, vxId2), 0.8571429f);
assertEquals(graph.getFloatValue(vertexHarmonicClosenessAttribute, vxId3), 1.2f / 1.2f);
assertEquals(graph.getFloatValue(vertexHarmonicClosenessAttribute, vxId4), 0.66666675f);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class ClosenessCentralityPluginNGTest method testNormalisedUndirectedCloseness.
@Test
public void testNormalisedUndirectedCloseness() throws Exception {
final ClosenessCentralityPlugin instance = new ClosenessCentralityPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setBooleanValue(ClosenessCentralityPlugin.HARMONIC_PARAMETER_ID, false);
parameters.setBooleanValue(ClosenessCentralityPlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.TREAT_UNDIRECTED_BIDIRECTIONAL, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.NORMALISE_AVAILABLE_PARAMETER_ID, true);
parameters.setBooleanValue(ClosenessCentralityPlugin.NORMALISE_POSSIBLE_PARAMETER_ID, false);
parameters.setBooleanValue(ClosenessCentralityPlugin.NORMALISE_CONNECTED_COMPONENTS_PARAMETER_ID, false);
parameters.setBooleanValue(ClosenessCentralityPlugin.SELECTED_ONLY_PARAMETER_ID, false);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId0), 0.125f / 0.2f);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId1), 0.2f / 0.2f);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId2), 0.16666667f / 0.2f);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId3), 0.2f / 0.2f);
assertEquals(graph.getFloatValue(vertexClosenessAttribute, vxId4), 0.125f / 0.2f);
}
Aggregations