本文整理汇总了Java中vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm类的典型用法代码示例。如果您正苦于以下问题:Java BasicVNAssignmentAlgorithm类的具体用法?Java BasicVNAssignmentAlgorithm怎么用?Java BasicVNAssignmentAlgorithm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BasicVNAssignmentAlgorithm类属于vnreal.algorithms.basicVN包,在下文中一共展示了BasicVNAssignmentAlgorithm类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SubstrateLinkStressTransformer
import vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm; //导入依赖的package包/类
public SubstrateLinkStressTransformer(BasicVNAssignmentAlgorithm algorithm,
SubstrateNetwork sNetwork, Collection<AbstractDemand> vldemands,
double biggestLinkStress, double delta_L) {
this.algorithm = algorithm;
this.sNetwork = sNetwork;
this.vldemands = vldemands;
this.biggestLinkStress = biggestLinkStress;
this.delta_L = delta_L;
}
示例2: SubstrateLinkStressTransformer
import vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm; //导入依赖的package包/类
public SubstrateLinkStressTransformer(
BasicVNAssignmentAlgorithm algorithm,
SubstrateNetwork sNetwork,
Collection<AbstractDemand> vldemands,
double biggestLinkStress, double delta_L) {
this.algorithm = algorithm;
this.sNetwork = sNetwork;
this.vldemands = vldemands;
this.biggestLinkStress = biggestLinkStress;
this.delta_L = delta_L;
}
示例3: runAlgorithm
import vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm; //导入依赖的package包/类
@Override
protected void runAlgorithm() {
IAlgorithm algo =
new BasicVNAssignmentAlgorithm(
ToolKit.getScenario().getNetworkStack(),
1.0, 1.0, true);
algo.performEvaluation();
}
示例4: algorithmTest
import vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm; //导入依赖的package包/类
@Test
public void algorithmTest() {
SubstrateNetwork subsNetwork = createSubstrate();
List<VirtualNetwork> vndemands = createVNDemands();
NetworkStack stack = new NetworkStack(subsNetwork, vndemands);
BasicVNAssignmentAlgorithm algo1 = new BasicVNAssignmentAlgorithm(
stack, 1, 1);
// Collection<List<SubstrateLink>> paths = algo1.distance(subsNetwork,
// subsNode5, subsNode2, null);
// assertTrue(!paths.isEmpty());
// assertTrue(paths.size() == 3);
// SubstrateNode biggestNodeStressNode = Utils
// .findSubstrateNodeWithBiggestStress(subsNetwork.getVertices());
// SubstrateLink biggestLinkStressLink = Utils
// .findSubstrateLinkWithBiggestStress(subsNetwork.getEdges());
// System.out.println("biggest node stress... "
// + biggestNodeStressNode.getId() + " / "
// + Utils.getStressLevel(biggestNodeStressNode));
// System.out.println("biggest link stress... "
// + biggestLinkStressLink.getId() + " / "
// + Utils.getStressLevel(biggestLinkStressLink));
// double distance = algo1.distance(paths.iterator().next(),
// biggestLinkStressLink.getStressLevel(), 1);
// System.out.println("distance of path 0: " + distance);
// assertTrue(distance == 3.0);
SubstrateNode nrNode = algo1.getNRNode(subsNetwork);
System.out.println("nrNode: " + nrNode);
algo1.performEvaluation();
assertNotNull(algo1);
// for (List<SubstrateLink> path : paths) {
// for (SubstrateLink l : path) {
// System.out.print(l.getId() + "->");
// }
// System.out.println();
// }
// Mapping computedMapping = algo1.getComputedMapping();
// System.out.println("mapping " + computedMapping.hashCode()
// + ": =====\n");
// System.out.println(computedMapping + "\n\n");
}
示例5: actionPerformed
import vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm; //导入依赖的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");
}
}
示例6: algorithmTest
import vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm; //导入依赖的package包/类
@Test
public void algorithmTest() {
SubstrateNetwork subsNetwork = createSubstrate();
List<VirtualNetwork> vndemands = createVNDemands();
NetworkStack stack = new NetworkStack(subsNetwork, vndemands);
BasicVNAssignmentAlgorithm algo1 = new BasicVNAssignmentAlgorithm(
stack, 1, 1, true);
// Collection<List<SubstrateLink>> paths = algo1.distance(subsNetwork,
// subsNode5, subsNode2, null);
// assertTrue(!paths.isEmpty());
// assertTrue(paths.size() == 3);
// SubstrateNode biggestNodeStressNode = Utils
// .findSubstrateNodeWithBiggestStress(subsNetwork.getVertices());
// SubstrateLink biggestLinkStressLink = Utils
// .findSubstrateLinkWithBiggestStress(subsNetwork.getEdges());
// System.out.println("biggest node stress... "
// + biggestNodeStressNode.getId() + " / "
// + Utils.getStressLevel(biggestNodeStressNode));
// System.out.println("biggest link stress... "
// + biggestLinkStressLink.getId() + " / "
// + Utils.getStressLevel(biggestLinkStressLink));
// double distance = algo1.distance(paths.iterator().next(),
// biggestLinkStressLink.getStressLevel(), 1);
// System.out.println("distance of path 0: " + distance);
// assertTrue(distance == 3.0);
SubstrateNode nrNode = algo1.getNRNode(subsNetwork);
System.out.println("nrNode: " + nrNode);
algo1.performEvaluation();
assertNotNull(algo1);
// for (List<SubstrateLink> path : paths) {
// for (SubstrateLink l : path) {
// System.out.print(l.getId() + "->");
// }
// System.out.println();
// }
// Mapping computedMapping = algo1.getComputedMapping();
// System.out.println("mapping " + computedMapping.hashCode()
// + ": =====\n");
// System.out.println(computedMapping + "\n\n");
}
示例7: getAlgorithm
import vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm; //导入依赖的package包/类
@Override
public AbstractAlgorithm getAlgorithm(NetworkStack nstack) {
return new BasicVNAssignmentAlgorithm(nstack, this.delta_N,
this.delta_L, this.useEnergyDemand);
}
示例8: algorithmTest
import vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm; //导入依赖的package包/类
@Test
public void algorithmTest() {
SubstrateNetwork subsNetwork = createSubstrate();
List<VirtualNetwork> vndemands = createVNDemands();
NetworkStack stack = new NetworkStack(subsNetwork, vndemands);
BasicVNAssignmentAlgorithm algo1 = new BasicVNAssignmentAlgorithm(
stack, 1, 1, true);
// Collection<List<SubstrateLink>> paths = algo1.distance(subsNetwork,
// subsNode5, subsNode2, null);
// assertTrue(!paths.isEmpty());
// assertTrue(paths.size() == 3);
// SubstrateNode biggestNodeStressNode = Utils
// .findSubstrateNodeWithBiggestStress(subsNetwork.getVertices());
// SubstrateLink biggestLinkStressLink = Utils
// .findSubstrateLinkWithBiggestStress(subsNetwork.getEdges());
// System.out.println("biggest node stress... "
// + biggestNodeStressNode.getId() + " / "
// + Utils.getStressLevel(biggestNodeStressNode));
// System.out.println("biggest link stress... "
// + biggestLinkStressLink.getId() + " / "
// + Utils.getStressLevel(biggestLinkStressLink));
// double distance = algo1.distance(paths.iterator().next(),
// biggestLinkStressLink.getStressLevel(), 1);
// System.out.println("distance of path 0: " + distance);
// assertTrue(distance == 3.0);
SubstrateNode nrNode = algo1.getNRNode(subsNetwork);
System.out.println("nrNode: " + nrNode);
algo1.performEvaluation();
assertNotNull(algo1);
// for (List<SubstrateLink> path : paths) {
// for (SubstrateLink l : path) {
// System.out.print(l.getId() + "->");
// }
// System.out.println();
// }
// Mapping computedMapping = algo1.getComputedMapping();
// System.out.println("mapping " + computedMapping.hashCode()
// + ": =====\n");
// System.out.println(computedMapping + "\n\n");
}
示例9: actionPerformed
import vnreal.algorithms.basicVN.BasicVNAssignmentAlgorithm; //导入依赖的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");
}
}