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


Java KspTestScenarios類代碼示例

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


KspTestScenarios類屬於tests.shortestpaths.utils包,在下文中一共展示了KspTestScenarios類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: eppsteinExample

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void eppsteinExample() {
	KspTestScenario<String, MyLink> scenario = KspTestScenarios
			.getEppsteinScenario();
	Graph<String, MyLink> graph = scenario.getGraph();
	List<List<MyLink>> solutions = scenario.getSolutions();
	String s = scenario.getSource();
	String t = scenario.getTarget();

	Eppstein<String, MyLink> kspAlgo = new Eppstein<String, MyLink>(graph,
			weightTrans);
	int k = solutions.size();
	List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

	for (int i = 0; i < k; i++)
		assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:18,代碼來源:KShortestPathTest.java

示例2: suurballeTarjanExample

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void suurballeTarjanExample() {
	KspTestScenario<String, MyLink> scenario = KspTestScenarios
			.getSuurballeTarjanScenario();
	Graph<String, MyLink> graph = scenario.getGraph();
	List<List<MyLink>> solutions = scenario.getSolutions();
	String s = scenario.getSource();
	String t = scenario.getTarget();

	KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
			weightTrans);
	int k = solutions.size();
	List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

	for (int i = 0; i < k; i++)
		assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:18,代碼來源:KShortestPathTest.java

示例3: decisionOnLastHop

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void decisionOnLastHop() {
	KspTestScenario<String, MyLink> scenario = KspTestScenarios
			.getLoopScenario();
	Graph<String, MyLink> graph = scenario.getGraph();
	List<List<MyLink>> solutions = scenario.getSolutions();
	String s = scenario.getSource();
	String t = scenario.getTarget();

	KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
			weightTrans);
	int k = solutions.size();
	List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

	for (int i = 0; i < k; i++)
		assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:18,代碼來源:KShortestPathTest.java

示例4: loopPrevention

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void loopPrevention() {
	KspTestScenario<String, MyLink> scenario = KspTestScenarios
			.getLoopScenario();
	Graph<String, MyLink> graph = scenario.getGraph();
	List<List<MyLink>> solutions = scenario.getSolutions();
	String s = scenario.getSource();
	String t = scenario.getTarget();

	KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
			weightTrans);
	int k = solutions.size();
	List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

	for (int i = 0; i < k; i++)
		assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:18,代碼來源:KShortestPathTest.java

示例5: unreachability

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void unreachability() {
	KspTestScenario<String, MyLink> scenario = KspTestScenarios
			.getUnreachabilitiyScenario();
	Graph<String, MyLink> graph = scenario.getGraph();
	List<List<MyLink>> solutions = scenario.getSolutions();
	String s = scenario.getSource();
	String t = scenario.getTarget();

	KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
			weightTrans);
	int k = solutions.size();
	List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

	for (int i = 1; i < k; i++)
		assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:18,代碼來源:KShortestPathTest.java

示例6: increasingHops

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void increasingHops() {
	KspTestScenario<String, MyLink> scenario = KspTestScenarios
			.getIncreasingHopScenario();
	Graph<String, MyLink> graph = scenario.getGraph();
	List<List<MyLink>> solutions = scenario.getSolutions();
	String s = scenario.getSource();
	String t = scenario.getTarget();

	KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
			weightTrans);
	int k = solutions.size();
	List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

	for (int i = 0; i < k; i++)
		assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:18,代碼來源:KShortestPathTest.java

示例7: increasingHopLength

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void increasingHopLength() {
	KspTestScenario<String, MyLink> scenario = KspTestScenarios
			.getIncreasingHopLengthScenario();
	Graph<String, MyLink> graph = scenario.getGraph();
	List<List<MyLink>> solutions = scenario.getSolutions();
	String s = scenario.getSource();
	String t = scenario.getTarget();

	KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
			weightTrans);
	int k = solutions.size();
	List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

	for (int i = 0; i < k; i++)
		assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:18,代碼來源:KShortestPathTest.java

示例8: zigZag

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void zigZag() {
	KspTestScenario<String, MyLink> scenario = KspTestScenarios
			.getZigZagScenario();
	Graph<String, MyLink> graph = scenario.getGraph();
	List<List<MyLink>> solutions = scenario.getSolutions();
	String s = scenario.getSource();
	String t = scenario.getTarget();

	KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
			weightTrans);

	int k = solutions.size();
	List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

	for (int i = 0; i < k; i++)
		assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:19,代碼來源:KShortestPathTest.java

示例9: eppsteinExample

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void eppsteinExample() {
    KspTestScenario<String, MyLink> scenario = KspTestScenarios
            .getEppsteinScenario();
    Graph<String, MyLink> graph = scenario.getGraph();
    List<List<MyLink>> solutions = scenario.getSolutions();
    String s = scenario.getSource();
    String t = scenario.getTarget();

    Eppstein<String, MyLink> kspAlgo = new Eppstein<String, MyLink>(graph,
            weightTrans);
    int k = solutions.size();
    List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

    for (int i = 0; i < k; i++)
        assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:liruixpc11,項目名稱:crucian,代碼行數:18,代碼來源:KShortestPathTest.java

示例10: suurballeTarjanExample

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void suurballeTarjanExample() {
    KspTestScenario<String, MyLink> scenario = KspTestScenarios
            .getSuurballeTarjanScenario();
    Graph<String, MyLink> graph = scenario.getGraph();
    List<List<MyLink>> solutions = scenario.getSolutions();
    String s = scenario.getSource();
    String t = scenario.getTarget();

    KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
            weightTrans);
    int k = solutions.size();
    List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

    for (int i = 0; i < k; i++)
        assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:liruixpc11,項目名稱:crucian,代碼行數:18,代碼來源:KShortestPathTest.java

示例11: decisionOnLastHop

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void decisionOnLastHop() {
    KspTestScenario<String, MyLink> scenario = KspTestScenarios
            .getLoopScenario();
    Graph<String, MyLink> graph = scenario.getGraph();
    List<List<MyLink>> solutions = scenario.getSolutions();
    String s = scenario.getSource();
    String t = scenario.getTarget();

    KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
            weightTrans);
    int k = solutions.size();
    List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

    for (int i = 0; i < k; i++)
        assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:liruixpc11,項目名稱:crucian,代碼行數:18,代碼來源:KShortestPathTest.java

示例12: loopPrevention

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void loopPrevention() {
    KspTestScenario<String, MyLink> scenario = KspTestScenarios
            .getLoopScenario();
    Graph<String, MyLink> graph = scenario.getGraph();
    List<List<MyLink>> solutions = scenario.getSolutions();
    String s = scenario.getSource();
    String t = scenario.getTarget();

    KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
            weightTrans);
    int k = solutions.size();
    List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

    for (int i = 0; i < k; i++)
        assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:liruixpc11,項目名稱:crucian,代碼行數:18,代碼來源:KShortestPathTest.java

示例13: unreachability

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void unreachability() {
    KspTestScenario<String, MyLink> scenario = KspTestScenarios
            .getUnreachabilitiyScenario();
    Graph<String, MyLink> graph = scenario.getGraph();
    List<List<MyLink>> solutions = scenario.getSolutions();
    String s = scenario.getSource();
    String t = scenario.getTarget();

    KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
            weightTrans);
    int k = solutions.size();
    List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

    for (int i = 1; i < k; i++)
        assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:liruixpc11,項目名稱:crucian,代碼行數:18,代碼來源:KShortestPathTest.java

示例14: increasingHops

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void increasingHops() {
    KspTestScenario<String, MyLink> scenario = KspTestScenarios
            .getIncreasingHopScenario();
    Graph<String, MyLink> graph = scenario.getGraph();
    List<List<MyLink>> solutions = scenario.getSolutions();
    String s = scenario.getSource();
    String t = scenario.getTarget();

    KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
            weightTrans);
    int k = solutions.size();
    List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

    for (int i = 0; i < k; i++)
        assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:liruixpc11,項目名稱:crucian,代碼行數:18,代碼來源:KShortestPathTest.java

示例15: increasingHopLength

import tests.shortestpaths.utils.KspTestScenarios; //導入依賴的package包/類
@Test
public void increasingHopLength() {
    KspTestScenario<String, MyLink> scenario = KspTestScenarios
            .getIncreasingHopLengthScenario();
    Graph<String, MyLink> graph = scenario.getGraph();
    List<List<MyLink>> solutions = scenario.getSolutions();
    String s = scenario.getSource();
    String t = scenario.getTarget();

    KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
            weightTrans);
    int k = solutions.size();
    List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);

    for (int i = 0; i < k; i++)
        assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
 
開發者ID:liruixpc11,項目名稱:crucian,代碼行數:18,代碼來源:KShortestPathTest.java


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