当前位置: 首页>>代码示例>>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;未经允许,请勿转载。