本文整理汇总了Java中vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm类的典型用法代码示例。如果您正苦于以下问题:Java SubgraphIsomorphismAlgorithm类的具体用法?Java SubgraphIsomorphismAlgorithm怎么用?Java SubgraphIsomorphismAlgorithm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SubgraphIsomorphismAlgorithm类属于vnreal.algorithms.isomorphism包,在下文中一共展示了SubgraphIsomorphismAlgorithm类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: map
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Override
public NetworkStack map(AlgorithmParameter param, SubstrateNetwork substrate, List<VirtualNetwork> virtuals) {
NetworkStack stack = new NetworkStack(substrate, virtuals);
IAlgorithm algo = new SubgraphIsomorphismStackAlgorithm(stack,
new SubgraphIsomorphismAlgorithm());
algo.performEvaluation();
return stack;
}
示例2: algorithmTest
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Test
public void algorithmTest() {
SubstrateNetwork sNetwork = createSubstrate();
List<VirtualNetwork> vNetworks = createVNDemands();
NetworkStack stack = new NetworkStack(sNetwork, vNetworks);
SubgraphIsomorphismStackAlgorithm algorithm = new SubgraphIsomorphismStackAlgorithm(
stack, new SubgraphIsomorphismAlgorithm());
algorithm.performEvaluation();
System.out.println(stack);
// Mapping m = algorithm.getComputedMapping();
// if (m == null) {
// System.out.println("mapping not found.");
// } else {
// System.out.println("mapping " + m.hashCode() + ": =====\n" +
// m.toString());
// System.out.println();
// System.out.println();
// for (SubstrateNode sn : stack.getSubstrate().getVertices()) {
// for (AbstractResource r : sn.get()) {
// System.out.println(r);
// }
// }
//
//
// EvaluationMetric metric = new CountRunningNodes();
// metric.setStack(stack);
// System.out.println(metric.getValue());
// EvaluationMetric metric2 = new CountHiddenHops();
// metric2.setStack(stack);
// System.out.println(metric2.getValue());
// }
}
示例3: runAlgorithm
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Override
protected void runAlgorithm() {
IAlgorithm algo =
new SubgraphIsomorphismStackAlgorithm(
ToolKit.getScenario().getNetworkStack(),
new SubgraphIsomorphismAlgorithm(true));
algo.performEvaluation();
}
示例4: algorithmTest
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Test
public void algorithmTest() {
SubstrateNetwork sNetwork = createSubstrate();
List<VirtualNetwork> vNetworks = createVNDemands();
NetworkStack stack = new NetworkStack(sNetwork, vNetworks);
SubgraphIsomorphismStackAlgorithm algorithm =
new SubgraphIsomorphismStackAlgorithm(
stack,
new SubgraphIsomorphismAlgorithm(true));
algorithm.performEvaluation();
System.out.println(stack);
// Mapping m = algorithm.getComputedMapping();
// if (m == null) {
// System.out.println("mapping not found.");
// } else {
// System.out.println("mapping " + m.hashCode() + ": =====\n" + m.toString());
// System.out.println();
// System.out.println();
// for (SubstrateNode sn : stack.getSubstrate().getVertices()) {
// for (AbstractResource r : sn.get()) {
// System.out.println(r);
// }
// }
//
//
// EvaluationMetric metric = new CountRunningNodes();
// metric.setStack(stack);
// System.out.println(metric.getValue());
// EvaluationMetric metric2 = new CountHiddenHops();
// metric2.setStack(stack);
// System.out.println(metric2.getValue());
// }
}
示例5: map
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Override
public void map(SubstrateNetwork substrateNetwork, VirtualNetwork virtualNetwork) throws Exception {
SubgraphIsomorphismAlgorithm algorithm = new SubgraphIsomorphismAlgorithm(false);
if (!algorithm.mapNetwork(substrateNetwork, virtualNetwork)) {
throw new Exception("failed");
}
}
示例6: doMap
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Override
protected void doMap(SubstrateNetwork substrateNetwork, VirtualNetwork virtualNetwork) throws Exception {
SubgraphIsomorphismAlgorithm algorithm = new SubgraphIsomorphismAlgorithm(false);
if (!algorithm.mapNetwork(substrateNetwork, virtualNetwork)) {
throw new Exception("failed");
}
}
示例7: runAlgorithm
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Override
protected void runAlgorithm(NetworkStack stack, ScenarioData data) {
IAlgorithm algo = new SubgraphIsomorphismStackAlgorithm(stack,
new SubgraphIsomorphismAlgorithm(true));
algo.performEvaluation();
}
示例8: algorithmTest
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Test
public void algorithmTest() {
SubstrateNetwork sNetwork = createSubstrate();
List<VirtualNetwork> vNetworks = createVNDemands();
NetworkStack stack = new NetworkStack(sNetwork, vNetworks);
SubgraphIsomorphismStackAlgorithm algorithm = new SubgraphIsomorphismStackAlgorithm(
stack, new SubgraphIsomorphismAlgorithm(true));
algorithm.performEvaluation();
System.out.println(stack);
// Mapping m = algorithm.getComputedMapping();
// if (m == null) {
// System.out.println("mapping not found.");
// } else {
// System.out.println("mapping " + m.hashCode() + ": =====\n" +
// m.toString());
// System.out.println();
// System.out.println();
// for (SubstrateNode sn : stack.getSubstrate().getVertices()) {
// for (AbstractResource r : sn.get()) {
// System.out.println(r);
// }
// }
//
//
// EvaluationMetric metric = new CountRunningNodes();
// metric.setStack(stack);
// System.out.println(metric.getValue());
// EvaluationMetric metric2 = new CountHiddenHops();
// metric2.setStack(stack);
// System.out.println(metric2.getValue());
// }
}
示例9: actionPerformed
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
NetworkStack ns = ToolKit.getScenario().getNetworkStack();
String input;
String cmd = e.getActionCommand();
if (ns == null) {
System.err.println("No network stack, no algorithm!");
return;
}
if (cmd.equals("remove mappings")) {
// remove all mappings
ns.clearMappings();
GUI.getInstance().update();
} else {
if (ns.hasMappings()) {
JOptionPane
.showMessageDialog(
GUI.getInstance(),
"This scenario already has mappings. An algorithm cannot be run.",
"Problem Running Algorithm",
JOptionPane.INFORMATION_MESSAGE);
} else if (cmd.equals("simple dijkstra")) {
IAlgorithm dijkstra = new SimpleDijkstraAlgorithm(ns);
new MyProgressBarDialog(dijkstra);
} else if (cmd.equals("greedy Available")) {
new AvailableResourcesWizard();
} else if (cmd.equals("path splitt")) {
new AvailableResourcesPathSplittingWizard();
} else if (cmd.equals("coordinatedPathSpplitting")) {
new CoordinatedMappingPathSplittingWizard();
} else if (cmd.equals("coordinatedKPaths")) {
new CoordinatedMappingkShortestPathWizard();
} else if (cmd.equals("coordinatedRoundStripping")) {
new CoordinatedMappingRoundingPathStrippingWizard();
} else if (cmd.equals("basicVN")) {
BasicVNAssignmentAlgorithm basicVN = new BasicVNAssignmentAlgorithm(
ns, 1.0, 1.0, false);
basicVN.performEvaluation();
// new MyProgressBarDialog(...);
} else if (cmd.equals("basicVNLinkStress")) {
BasicVNLinkStressAssignmentAlgorithm basicVNLS = new BasicVNLinkStressAssignmentAlgorithm(
ns, 1.0, 1.0, false);
basicVNLS.performEvaluation();
// new MyProgressBarDialog(...);
} else if (cmd.equals("subgraph isomorphism")) {
SubgraphIsomorphismStackAlgorithm subgraph =
new SubgraphIsomorphismStackAlgorithm(
ns, new SubgraphIsomorphismAlgorithm(false));
subgraph.performEvaluation();
// new MyProgressBarDialog(subgraph);
} else if (cmd.equals("advanced subgraph isomorphism")) {
SubgraphIsomorphismStackAlgorithm aSubgraph =
new SubgraphIsomorphismStackAlgorithm(
ns, new AdvancedSubgraphIsomorphismAlgorithm(false));
aSubgraph.performEvaluation();
// new MyProgressBarDialog(...);
} else if (cmd.equals("optimal")) {
input = JOptionPane.showInputDialog(GUI.getInstance(),
"epsilon");
int epsilon = Integer.parseInt(input);
OptimalMappingsAlgorithm optimal = new OptimalMappingsAlgorithm(
ns, true, epsilon, false);
optimal.performEvaluation();
// new MyProgressBarDialog(...);
} else
throw new AssertionError("Undefined menu action");
}
}
示例10: getAlgorithm
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Override
public AbstractAlgorithm getAlgorithm(NetworkStack nstack) {
SubgraphIsomorphismAlgorithm algo = new AdvancedSubgraphIsomorphismAlgorithm(
this.useEnergyResource);
return new SubgraphIsomorphismStackAlgorithm(nstack, algo);
}
示例11: actionPerformed
import vnreal.algorithms.isomorphism.SubgraphIsomorphismAlgorithm; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
NetworkStack ns = scenario.getNetworkStack();
String input;
String cmd = e.getActionCommand();
if (ns == null) {
System.err.println("No network stack, no algorithm!");
return;
}
if (cmd.equals("remove mappings")) {
// remove all mappings
ns.clearMappings();
GUI.getInstance().update();
} else {
if (ns.hasMappings()) {
JOptionPane
.showMessageDialog(
GUI.getInstance(),
"This scenario already has mappings. An algorithm cannot be run.",
"Problem Running Algorithm",
JOptionPane.INFORMATION_MESSAGE);
} else if (cmd.equals("simple dijkstra")) {
IAlgorithm dijkstra = new SimpleDijkstraAlgorithm(ns);
new MyProgressBarDialog(dijkstra, scenario);
} else if (cmd.equals("greedy Available")) {
new AvailableResourcesWizard(scenario);
} else if (cmd.equals("path splitt")) {
new AvailableResourcesPathSplittingWizard(scenario);
} else if (cmd.equals("coordinatedPathSpplitting")) {
new CoordinatedMappingPathSplittingWizard(scenario);
} else if (cmd.equals("coordinatedKPaths")) {
new CoordinatedMappingkShortestPathWizard(scenario);
} else if (cmd.equals("coordinatedRoundStripping")) {
new CoordinatedMappingRoundingPathStrippingWizard(scenario);
// } else if (cmd.equals("ExactMIPHiddenHop")) {
// new ExactMipHhWizard(scenario);
} else if (cmd.equals("NRkSP")) {
new NRkSPWizard(scenario);
} else if (cmd.equals("NRPS")) {
new NRPSWizard(scenario);
} else if (cmd.equals("BFSNR")) {
new BFSNRWizard(scenario);
} else if (cmd.equals("BFSNRPS")) {
new BFSNRPSWizard(scenario);
// } else if (cmd.equals("EnergyAwareHiddenHop")) {
// new EnergyWizardHiddenHop(scenario);
} else if (cmd.equals("basicVN")) {
BasicVNAssignmentAlgorithm basicVN = new BasicVNAssignmentAlgorithm(
ns, 1.0, 1.0, false);
basicVN.performEvaluation();
// new MyProgressBarDialog(...);
} else if (cmd.equals("basicVNLinkStress")) {
BasicVNLinkStressAssignmentAlgorithm basicVNLS = new BasicVNLinkStressAssignmentAlgorithm(
ns, 1.0, 1.0, false);
basicVNLS.performEvaluation();
// new MyProgressBarDialog(...);
} else if (cmd.equals("subgraph isomorphism")) {
SubgraphIsomorphismStackAlgorithm subgraph = new SubgraphIsomorphismStackAlgorithm(
ns, new SubgraphIsomorphismAlgorithm(false));
subgraph.performEvaluation();
// new MyProgressBarDialog(subgraph);
} else if (cmd.equals("advanced subgraph isomorphism")) {
SubgraphIsomorphismStackAlgorithm aSubgraph = new SubgraphIsomorphismStackAlgorithm(
ns, new AdvancedSubgraphIsomorphismAlgorithm(false));
aSubgraph.performEvaluation();
// new MyProgressBarDialog(...);
} else if (cmd.equals("optimal")) {
input = JOptionPane.showInputDialog(GUI.getInstance(),
"epsilon");
int epsilon = Integer.parseInt(input);
OptimalMappingsAlgorithm optimal = new OptimalMappingsAlgorithm(
ns, true, epsilon, false);
optimal.performEvaluation();
// new MyProgressBarDialog(...);
} else
throw new AssertionError("Undefined menu action");
}
}