本文整理汇总了Java中vnreal.algorithms.AbstractAlgorithm.setStack方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractAlgorithm.setStack方法的具体用法?Java AbstractAlgorithm.setStack怎么用?Java AbstractAlgorithm.setStack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vnreal.algorithms.AbstractAlgorithm
的用法示例。
在下文中一共展示了AbstractAlgorithm.setStack方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doAction
import vnreal.algorithms.AbstractAlgorithm; //导入方法依赖的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", "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 NodeRanking(param);
algo.setStack(ns);
new MyProgressBarDialog(algo);
GUI.getInstance().getGraphPanel().autoZoomToFit();
}
示例2: doAction
import vnreal.algorithms.AbstractAlgorithm; //导入方法依赖的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 BFSCoordinated(param);
algo.setStack(ns);
new MyProgressBarDialog(algo);
GUI.getInstance().getGraphPanel().autoZoomToFit();
}
示例3: doAction
import vnreal.algorithms.AbstractAlgorithm; //导入方法依赖的package包/类
@Override
protected void doAction() {
if (!deterministicButton.isSelected() && !randomizedButton.isSelected()) {
JOptionPane
.showMessageDialog(
GUI.getInstance(),
"<html><p><b>'Type'</b> parameter must be Deterministic or Randomized</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");
param.put("rounding", "False");
param.put("distance", maxDistSpinner.getValue().toString());
param.put("weightCpu", cpuWSpinner.getValue().toString());
param.put("weightBw", bwWSpinner.getValue().toString());
String overload = yesNodeOverloadButton.isSelected() ? "True" : "False";
param.put("overload", overload);
String randomize = randomizedButton.isSelected() ? "True" : "False";
param.put("randomize", randomize);
// finally generate the algorithm
AbstractAlgorithm algo = new CoordinatedMapping(param);
algo.setStack(ns);
new MyProgressBarDialog(algo);
GUI.getInstance().getGraphPanel().autoZoomToFit();
}
示例4: doAction
import vnreal.algorithms.AbstractAlgorithm; //导入方法依赖的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();
}
示例5: doAction
import vnreal.algorithms.AbstractAlgorithm; //导入方法依赖的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 NodeRanking(param);
algo.setStack(ns);
new MyProgressBarDialog(algo);
GUI.getInstance().getGraphPanel().autoZoomToFit();
}
示例6: doAction
import vnreal.algorithms.AbstractAlgorithm; //导入方法依赖的package包/类
@Override
protected void doAction() {
if (!deterministicButton.isSelected() && !randomizedButton.isSelected()) {
JOptionPane
.showMessageDialog(
GUI.getInstance(),
"<html><p><b>'Type'</b> parameter must be Deterministic or Randomized</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");
param.put("distance", maxDistSpinner.getValue().toString());
param.put("weightCpu", cpuWSpinner.getValue().toString());
param.put("weightBw", bwWSpinner.getValue().toString());
param.put("kShortestPaths", kSpinner.getValue().toString());
String overload = yesNodeOverloadButton.isSelected() ? "True" : "False";
param.put("overload", overload);
String randomize = randomizedButton.isSelected() ? "True" : "False";
param.put("randomize", randomize);
// finally generate the algorithm
AbstractAlgorithm algo = new CoordinatedMapping(param);
algo.setStack(ns);
new MyProgressBarDialog(algo);
GUI.getInstance().getGraphPanel().autoZoomToFit();
}
示例7: doAction
import vnreal.algorithms.AbstractAlgorithm; //导入方法依赖的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();
}
示例8: doAction
import vnreal.algorithms.AbstractAlgorithm; //导入方法依赖的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", "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());
param.put("kShortestPaths", kSpinner.getValue().toString());
String overload = yesNodeOverloadButton.isSelected() ? "True" : "False";
param.put("overload", overload);
// finally generate the algorithm
AbstractAlgorithm algo = new BFSCoordinated(param);
algo.setStack(ns);
new MyProgressBarDialog(algo);
GUI.getInstance().getGraphPanel().autoZoomToFit();
}
示例9: doAction
import vnreal.algorithms.AbstractAlgorithm; //导入方法依赖的package包/类
@Override
protected void doAction() {
if (!deterministicButton.isSelected() && !randomizedButton.isSelected()) {
JOptionPane
.showMessageDialog(
GUI.getInstance(),
"<html><p><b>'Type'</b> parameter must be Deterministic or Randomized</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");
param.put("rounding", "True");
param.put("distance", maxDistSpinner.getValue().toString());
param.put("weightCpu", cpuWSpinner.getValue().toString());
param.put("weightBw", bwWSpinner.getValue().toString());
String overload = yesNodeOverloadButton.isSelected() ? "True" : "False";
param.put("overload", overload);
String randomize = randomizedButton.isSelected() ? "True" : "False";
param.put("randomize", randomize);
// finally generate the algorithm
AbstractAlgorithm algo = new CoordinatedMapping(param);
algo.setStack(ns);
new MyProgressBarDialog(algo);
GUI.getInstance().getGraphPanel().autoZoomToFit();
}