本文整理汇总了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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}