Fix parity solver if edgevector is not contiguous
Validity of strategies was tested relying on num_edges() which might be smaller than the edge_number * spot/twaalgos/game.cc: Fix here * tests/python/game.py: Test here
This commit is contained in:
parent
0c34152a33
commit
d152b3a316
2 changed files with 143 additions and 2 deletions
|
|
@ -272,12 +272,16 @@ namespace spot
|
|||
// Only the states owned by the winner need a strategy
|
||||
assert([&]()
|
||||
{
|
||||
std::unordered_set<unsigned> valid_strat;
|
||||
for (const auto& e : arena_->edges())
|
||||
valid_strat.insert(arena_->edge_number(e));
|
||||
|
||||
for (unsigned v = 0; v < arena_->num_states(); ++v)
|
||||
{
|
||||
if (!solve_globally && (info_->scc_of(v) == -1u))
|
||||
continue;
|
||||
if (((*owner_ptr_)[v] == w_.winner(v))
|
||||
&& ((s_[v] <= 0) || (s_[v] > arena_->num_edges())))
|
||||
&& (valid_strat.count(s_.at(v)) == 0))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue