本文整理匯總了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)));
}