當前位置: 首頁>>代碼示例>>Java>>正文


Java AbstractAlgorithm類代碼示例

本文整理匯總了Java中vnreal.algorithms.AbstractAlgorithm的典型用法代碼示例。如果您正苦於以下問題:Java AbstractAlgorithm類的具體用法?Java AbstractAlgorithm怎麽用?Java AbstractAlgorithm使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AbstractAlgorithm類屬於vnreal.algorithms包,在下文中一共展示了AbstractAlgorithm類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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();
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:37,代碼來源:NRPSWizard.java

示例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();
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:37,代碼來源:BFSNRWizard.java

示例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();
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:39,代碼來源:CoordinatedMappingPathSplittingWizard.java

示例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();
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:36,代碼來源:AvailableResourcesWizard.java

示例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();
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:36,代碼來源:NRkSPWizard.java

示例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();
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:39,代碼來源:CoordinatedMappingkShortestPathWizard.java

示例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();
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:38,代碼來源:AvailableResourcesPathSplittingWizard.java

示例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();
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:39,代碼來源:BFSNRPSWizard.java

示例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();
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:39,代碼來源:CoordinatedMappingRoundingPathStrippingWizard.java

示例10: getAlgo

import vnreal.algorithms.AbstractAlgorithm; //導入依賴的package包/類
public AbstractAlgorithm getAlgo() {
	return algo;
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:4,代碼來源:TestRun.java

示例11: setAlgo

import vnreal.algorithms.AbstractAlgorithm; //導入依賴的package包/類
public void setAlgo(AbstractAlgorithm algo) {
	this.algo = algo;
	if (this.scenario != null)
		this.algo.setStack(this.scenario.getNetworkStack());
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:6,代碼來源:TestRun.java

示例12: getAlgorithm

import vnreal.algorithms.AbstractAlgorithm; //導入依賴的package包/類
public AbstractAlgorithm getAlgorithm() {
	return this.algo;
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:4,代碼來源:Run.java

示例13: setAlgorithm

import vnreal.algorithms.AbstractAlgorithm; //導入依賴的package包/類
public void setAlgorithm(AbstractAlgorithm algo) {
	this.algo = algo;
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:4,代碼來源:Run.java

示例14: getAlgorithm

import vnreal.algorithms.AbstractAlgorithm; //導入依賴的package包/類
@Override
public AbstractAlgorithm getAlgorithm(NetworkStack nstack) {
	return new NodeRankingPathSplitting(nstack, weightCpu, weightBw,
			distance, isDistance, nodeOverload);
}
 
開發者ID:fabe85,項目名稱:Alevin,代碼行數:6,代碼來源:Pathsplitting.java

示例15: getAlgorithm

import vnreal.algorithms.AbstractAlgorithm; //導入依賴的package包/類
@Override
public AbstractAlgorithm getAlgorithm(NetworkStack nstack) {
	SubgraphIsomorphismAlgorithm algo = new AdvancedSubgraphIsomorphismAlgorithm(
			this.useEnergyResource);
	return new SubgraphIsomorphismStackAlgorithm(nstack, algo);
}
 
開發者ID:fabe85,項目名稱:Alevin,代碼行數:7,代碼來源:Isomorphism.java


注:本文中的vnreal.algorithms.AbstractAlgorithm類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。