|
|
@ -39,7 +39,7 @@ TEST(KSPTest, singleTarget) { |
|
|
|
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState); |
|
|
|
|
|
|
|
double dist = spg.getDistance(100); |
|
|
|
EXPECT_DOUBLE_EQ(1.5231305000339649e-06, dist); |
|
|
|
EXPECT_NEAR(1.5231305000339662e-06, dist, 1e-12); |
|
|
|
} |
|
|
|
|
|
|
|
TEST(KSPTest, reentry) { |
|
|
@ -47,11 +47,11 @@ TEST(KSPTest, reentry) { |
|
|
|
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState); |
|
|
|
|
|
|
|
double dist = spg.getDistance(100); |
|
|
|
EXPECT_DOUBLE_EQ(1.5231305000339649e-06, dist); |
|
|
|
EXPECT_NEAR(1.5231305000339662e-06, dist, 1e-12); |
|
|
|
|
|
|
|
// get another distance to ensure re-entry is no problem
|
|
|
|
double dist2 = spg.getDistance(500); |
|
|
|
EXPECT_DOUBLE_EQ(3.0462610000679282e-08, dist2); |
|
|
|
EXPECT_NEAR(3.0462610000679315e-08, dist2, 1e-12); |
|
|
|
} |
|
|
|
|
|
|
|
TEST(KSPTest, groupTarget) { |
|
|
@ -60,13 +60,13 @@ TEST(KSPTest, groupTarget) { |
|
|
|
auto spg = storm::utility::ksp::ShortestPathsGenerator<double>(*model, groupTarget); |
|
|
|
|
|
|
|
double dist1 = spg.getDistance(8); |
|
|
|
EXPECT_DOUBLE_EQ(0.00018449245583999996, dist1); |
|
|
|
EXPECT_NEAR(0.00018449245583999996, dist1, 1e-12); |
|
|
|
|
|
|
|
double dist2 = spg.getDistance(9); |
|
|
|
EXPECT_DOUBLE_EQ(0.00018449245583999996, dist2); |
|
|
|
EXPECT_NEAR(0.00018449245583999996, dist2, 1e-12); |
|
|
|
|
|
|
|
double dist3 = spg.getDistance(12); |
|
|
|
EXPECT_DOUBLE_EQ(7.5303043199999984e-06, dist3); |
|
|
|
EXPECT_NEAR(7.5303043199999984e-06, dist3, 1e-12); |
|
|
|
} |
|
|
|
|
|
|
|
TEST(KSPTest, kTooLargeException) { |
|
|
@ -81,7 +81,7 @@ TEST(KSPTest, kspStateSet) { |
|
|
|
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState); |
|
|
|
|
|
|
|
storm::storage::BitVector referenceBV(model->getNumberOfStates(), false); |
|
|
|
for (auto s : std::vector<storm::utility::ksp::state_t>{0, 1, 3, 5, 7, 10, 14, 19, 25, 29, 33, 36, 40, 44, 50, 56, 62, 70, 77, 85, 92, 98, 104, 112, 119, 127, 134, 140, 146, 154, 161, 169, 176, 182, 188, 196, 203, 211, 218, 224, 230, 238, 245, 253, 260, 266, 272, 281, 288, 296}) { |
|
|
|
for (auto s : std::vector<storm::utility::ksp::state_t>{0, 1, 2, 4, 6, 9, 12, 17, 22, 30, 37, 45, 52, 58, 65, 70, 74, 77, 81, 85, 92, 98, 104, 112, 119, 127, 134, 140, 146, 154, 161, 169, 176, 182, 188, 196, 203, 211, 218, 224, 230, 238, 245, 253, 260, 266, 272, 281, 288, 296}) { |
|
|
|
referenceBV.set(s, true); |
|
|
|
} |
|
|
|
|
|
|
@ -95,7 +95,7 @@ TEST(KSPTest, kspPathAsList) { |
|
|
|
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState); |
|
|
|
|
|
|
|
// TODO: use path that actually has a loop or something to make this more interesting
|
|
|
|
auto reference = storm::utility::ksp::OrderedStateList{296, 288, 281, 272, 266, 260, 253, 245, 238, 230, 224, 218, 211, 203, 196, 188, 182, 176, 169, 161, 154, 146, 140, 134, 127, 119, 112, 104, 98, 92, 85, 77, 70, 62, 56, 50, 44, 36, 29, 40, 33, 25, 19, 14, 10, 7, 5, 3, 1, 0}; |
|
|
|
auto reference = storm::utility::ksp::OrderedStateList{296, 288, 281, 272, 266, 260, 253, 245, 238, 230, 224, 218, 211, 203, 196, 188, 182, 176, 169, 161, 154, 146, 140, 134, 127, 119, 112, 104, 98, 92, 85, 77, 70, 81, 74, 65, 58, 52, 45, 37, 30, 22, 17, 12, 9, 6, 4, 2, 1, 0}; |
|
|
|
auto list = spg.getPathAsList(7); |
|
|
|
|
|
|
|
EXPECT_EQ(reference, list); |
|
|
|