本文整理汇总了Java中vnreal.algorithms.AvailableResources类的典型用法代码示例。如果您正苦于以下问题:Java AvailableResources类的具体用法?Java AvailableResources怎么用?Java AvailableResources使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AvailableResources类属于vnreal.algorithms包,在下文中一共展示了AvailableResources类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: map
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
public NetworkStack map(AlgorithmParameter data, SubstrateNetwork substrate, List<VirtualNetwork> virtuals) {
NetworkStack stack = new NetworkStack(substrate, virtuals);
LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
double hiddenHopsFactor = 0;
hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));
AlgorithmParameter param = new AlgorithmParameter();
param.put("kShortestPath", "50");
param.put("distance", "35");
param.put("PathSplitting", "false");
param.put("eppstein", "false");
GenericMappingAlgorithm algo = new AvailableResources(param);
algo.setStack(stack);
if (algo instanceof GenericMappingAlgorithm)
((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);
algo.performEvaluation();
return stack;
}
示例2: map
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
public NetworkStack map(AlgorithmParameter data, SubstrateNetwork substrate, List<VirtualNetwork> virtuals) {
NetworkStack stack = new NetworkStack(substrate, virtuals);
LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
double hiddenHopsFactor = 0;
hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));
AlgorithmParameter param = new AlgorithmParameter();
param.put("weightCpu", "0");
param.put("weightBw", "0");
param.put("distance", "35");
param.put("PathSplitting", "true");
GenericMappingAlgorithm algo = new AvailableResources(param);
algo.setStack(stack);
if (algo instanceof GenericMappingAlgorithm)
((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);
algo.performEvaluation();
return stack;
}
示例3: map
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
public NetworkStack map(AlgorithmParameter data, SubstrateNetwork substrate, List<VirtualNetwork> virtuals) {
NetworkStack stack = new NetworkStack(substrate, virtuals);
LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
double hiddenHopsFactor = 0;
hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));
AlgorithmParameter param = new AlgorithmParameter();
param.put("weightCpu", "0");
param.put("weightBw", "0");
param.put("distance", "35");
param.put("PathSplitting", "true");
GenericMappingAlgorithm algo = new AvailableResources(param);
algo.setStack(stack);
if (algo instanceof GenericMappingAlgorithm)
((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);
algo.performEvaluation();
return stack;
}
示例4: map
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
public NetworkStack map(AlgorithmParameter data, SubstrateNetwork substrate, List<VirtualNetwork> virtuals) {
NetworkStack stack = new NetworkStack(substrate, virtuals);
LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
double hiddenHopsFactor = 0;
hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));
AlgorithmParameter param = new AlgorithmParameter();
param.put("kShortestPath", "50");
param.put("distance", "35");
param.put("PathSplitting", "false");
param.put("eppstein", "false");
GenericMappingAlgorithm algo = new AvailableResources(param);
algo.setStack(stack);
if (algo instanceof GenericMappingAlgorithm)
((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);
algo.performEvaluation();
return stack;
}
示例5: mapNetwork
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
public boolean mapNetwork(SubstrateNetwork network, VirtualNetwork vNetwork) {
List<VirtualNetwork> vns = new LinkedList<VirtualNetwork>();
vns.add(vNetwork);
NetworkStack stack = new NetworkStack(network, vns);
LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
double hiddenHopsFactor = 0;
hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));
AlgorithmParameter param = new AlgorithmParameter();
param.put("weightCpu", "0");
param.put("weightBw", "0");
param.put("distance", "35");
param.put("PathSplitting", "true");
GenericMappingAlgorithm algo = new AvailableResources(param);
algo.setStack(stack);
if (algo instanceof GenericMappingAlgorithm)
((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);
algo.performEvaluation();
return VnrUtils.isMapped(vNetwork);
}
示例6: mapNetwork
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
public boolean mapNetwork(SubstrateNetwork network, VirtualNetwork vNetwork) {
List<VirtualNetwork> vns = new LinkedList<VirtualNetwork>();
vns.add(vNetwork);
NetworkStack stack = new NetworkStack(network, vns);
LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
double hiddenHopsFactor = 0;
hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));
AlgorithmParameter param = new AlgorithmParameter();
param.put("kShortestPath", "50");
param.put("distance", "35");
param.put("PathSplitting", "false");
param.put("eppstein", "false");
GenericMappingAlgorithm algo = new AvailableResources(param);
algo.setStack(stack);
if (algo instanceof GenericMappingAlgorithm)
((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);
algo.performEvaluation();
return VnrUtils.isMapped(vNetwork);
}
示例7: mapNetwork
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
public boolean mapNetwork(SubstrateNetwork network, VirtualNetwork vNetwork) {
List<VirtualNetwork> vns = new LinkedList<VirtualNetwork>();
vns.add(vNetwork);
NetworkStack stack = new NetworkStack(network, vns);
LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
double hiddenHopsFactor = 0;
hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));
AlgorithmParameter param = new AlgorithmParameter();
param.put("weightCpu", "0");
param.put("weightBw", "0");
param.put("distance", "35");
param.put("PathSplitting", "true");
GenericMappingAlgorithm algo = new AvailableResources(param);
algo.setStack(stack);
if (algo instanceof GenericMappingAlgorithm)
((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);
algo.performEvaluation();
return VnrUtils.isMapped(vNetwork);
}
示例8: mapNetwork
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
public boolean mapNetwork(SubstrateNetwork network, VirtualNetwork vNetwork) {
List<VirtualNetwork> vns = new LinkedList<VirtualNetwork>();
vns.add(vNetwork);
NetworkStack stack = new NetworkStack(network, vns);
LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
double hiddenHopsFactor = 0;
hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));
IAlgorithm algo = new AvailableResources(stack, k, dist, false, false);
if (algo instanceof GenericMappingAlgorithm)
((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);
algo.performEvaluation();
return VnrUtils.isMapped(vNetwork);
}
示例9: doAction
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
protected void doAction() {
if (!yesIsDistanceButton.isSelected()
&& !noIsDistanceButton.isSelected()) {
JOptionPane
.showMessageDialog(GUI.getInstance(),
"<html><p><b>'Distance'</b> parameter must be specified</p><html>");
return;
} else if (!yesNodeOverloadButton.isSelected()
&& !noNodeOverloadButton.isSelected()) {
JOptionPane
.showMessageDialog(GUI.getInstance(),
"<html><p><b>'Node Overload'</b> parameter must be Yes or No</p><html>");
return;
}
// Algorithm parameters
Scenario scenario = GUI.getInstance().getScenario();
NetworkStack ns = scenario.getNetworkStack();
AlgorithmParameter param = new AlgorithmParameter();
param.put("PathSplitting", "False");
String distance = noIsDistanceButton.isSelected() ? "-1" : maxDistSpinner.getValue().toString();
param.put("distance", distance);
param.put("kShortestPaths", kSpinner.getValue().toString());
String overload = yesNodeOverloadButton.isSelected() ? "True" : "False";
param.put("overload", overload);
// finally generate the algorithm
AbstractAlgorithm algo = new AvailableResources(param);
algo.setStack(ns);
new MyProgressBarDialog(algo);
GUI.getInstance().getGraphPanel().autoZoomToFit();
}
示例10: doAction
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
protected void doAction() {
// This should actually never happen
if (!yesIsDistanceButton.isSelected()
&& !noIsDistanceButton.isSelected()) {
JOptionPane
.showMessageDialog(GUI.getInstance(),
"<html><p><b>'Distance'</b> parameter must be specified</p><html>");
return;
} else if (!yesNodeOverloadButton.isSelected()
&& !noNodeOverloadButton.isSelected()) {
JOptionPane
.showMessageDialog(GUI.getInstance(),
"<html><p><b>'Node Overload'</b> parameter must be Yes or No</p><html>");
return;
}
// Algorithm parameters
Scenario scenario = GUI.getInstance().getScenario();
NetworkStack ns = scenario.getNetworkStack();
AlgorithmParameter param = new AlgorithmParameter();
param.put("PathSplitting", "True");
String distance = noIsDistanceButton.isSelected() ? "-1" : maxDistSpinner.getValue().toString();
param.put("distance", distance);
param.put("weightCpu", cpuWSpinner.getValue().toString());
param.put("weightBw", bwWSpinner.getValue().toString());
String overload = yesNodeOverloadButton.isSelected() ? "True" : "False";
param.put("overload", overload);
// finally generate the algorithm
AbstractAlgorithm algo = new AvailableResources(param);
algo.setStack(ns);
new MyProgressBarDialog(algo);
GUI.getInstance().getGraphPanel().autoZoomToFit();
}
示例11: runAlgorithm
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
public void runAlgorithm() {
/*
* Coordinated node and link mapping with K-shortestPaths
* Important Parameters
* Rounding Type: Deterministic rounding
* Maximum number of shortest path to calculate: 20
* Hidden Hops Considered: False
* Distance Value : 40
*/
String path = System.getProperty("user.home") + File.separator + "GARSP" + File.separator + "Evaluation-results_" + scenario_suffix + "-GARSP.csv";
List<EvaluationMetric> metrics = new LinkedList<EvaluationMetric>();
IAlgorithm algo = new AvailableResources(ToolKit
.getScenario().getNetworkStack(), 20, 35, false, false);
algo.performEvaluation();
metrics.add(new CostRevenue(false));
metrics.add(new Cost());
metrics.add(new MappedRevenue(false));
metrics.add(new LinkUtilization());
metrics.add(new NodeUtilization());
metrics.add(new MaxLinkStress());
metrics.add(new MaxNodeStress());
metrics.add(new AcceptedVnrRatio());
metrics.add(new RatioMappedRevenue(false));
GenericMappingAlgorithm mappingAlgo = (GenericMappingAlgorithm) algo;
metrics.add(new RunningTime(mappingAlgo.getRunningTime()));
for (Iterator<EvaluationMetric> tmpMetric = metrics.iterator(); tmpMetric
.hasNext(); ) {
EvaluationMetric currMetric = tmpMetric.next();
currMetric.setStack(ToolKit
.getScenario().getNetworkStack());
}
EvaluationFileGeneration outputFile = new EvaluationFileGeneration(path);
outputFile.createEvaluationFile(metrics);
}
示例12: EvaluationTests
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Test
public void EvaluationTests() {
SubstrateNetwork subsNetwork = createSubstrate();
List<VirtualNetwork> vndemands = createVNDemands();
NetworkStack stack = new NetworkStack(subsNetwork, vndemands);
IAlgorithm algo1 = new AvailableResources(stack, 3, 30, false, false);
algo1.performEvaluation(); // performEvaluation() implemented in
// AbstractAlgorithm.java
assertNotNull(algo1);
// Printing the lines of evaluation parameters resulting of algorithm
// execution with the second calculation method.
String path = "ILP-LP-Models/testFile.cvs";
List<EvaluationMetric> metrics = new LinkedList<EvaluationMetric>();
metrics.add(new CostRevenue(false));
metrics.add(new Cost());
metrics.add(new MappedRevenue(false));
metrics.add(new RejectedNetworksNumber());
metrics.add(new TotalRevenue(false));
for (Iterator<EvaluationMetric> tmpMetric = metrics.iterator(); tmpMetric.hasNext(); ) {
EvaluationMetric currMetric = tmpMetric.next();
currMetric.setStack(stack);
}
EvaluationFileGeneration outputFile = new EvaluationFileGeneration(path);
outputFile.createEvaluationFile(metrics);
}
示例13: runAlgorithm
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Override
protected void runAlgorithm(NetworkStack stack, ScenarioData data) {
LinkedList<IHiddenHopMapping> hhMappings = new LinkedList<IHiddenHopMapping>();
double hiddenHopsFactor = 0;
hhMappings.add(new BandwidthCpuHiddenHopMapping(hiddenHopsFactor));
IAlgorithm algo = new AvailableResources(stack, k, dist, false, false);
if (algo instanceof GenericMappingAlgorithm)
((GenericMappingAlgorithm) algo).setHhMappings(hhMappings);
algo.performEvaluation();
}
示例14: EvaluationTests
import vnreal.algorithms.AvailableResources; //导入依赖的package包/类
@Test
public void EvaluationTests() {
SubstrateNetwork subsNetwork = createSubstrate();
List<VirtualNetwork> vndemands = createVNDemands();
NetworkStack stack = new NetworkStack(subsNetwork, vndemands);
IAlgorithm algo1 = new AvailableResources(stack, 3, 30, false, false);
algo1.performEvaluation(); // performEvaluation() implemented in
// AbstractAlgorithm.java
assertNotNull(algo1);
// Printing the lines of evaluation parameters resulting of algorithm
// execution with the second calculation method.
String path = "ILP-LP-Models/testFile.cvs";
List<EvaluationMetric> metrics = new LinkedList<EvaluationMetric>();
metrics.add(new CostRevenue(false));
metrics.add(new Cost());
metrics.add(new MappedRevenue(false));
metrics.add(new RejectedNetworksNumber());
metrics.add(new TotalRevenue(false));
for (Iterator<EvaluationMetric> tmpMetric = metrics.iterator(); tmpMetric
.hasNext();) {
EvaluationMetric currMetric = tmpMetric.next();
currMetric.setStack(stack);
}
EvaluationFileGeneration outputFile = new EvaluationFileGeneration(path);
outputFile.createEvaluationFile(metrics);
}