MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_all_promising

Function test_all_promising

tests/search/test_SearchSpace.py:126–142  ·  view source on GitHub ↗

Tests marking and unmarking all clients as promising.

(ok_small)

Source from the content-addressed store, hash-verified

124
125
126def test_all_promising(ok_small):
127 """
128 Tests marking and unmarking all clients as promising.
129 """
130 clients = range(ok_small.num_depots, ok_small.num_locations)
131
132 # Initially no clients start off promising.
133 search_space = SearchSpace(ok_small, compute_neighbours(ok_small))
134 assert_(not any(search_space.is_promising(client) for client in clients))
135
136 # But after marking all as promising, they should all indeed be promising.
137 search_space.mark_all_promising()
138 assert_(all(search_space.is_promising(client) for client in clients))
139
140 # After unmarking all, no client should be promising.
141 search_space.unmark_all_promising()
142 assert_(not any(search_space.is_promising(client) for client in clients))
143
144
145@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

compute_neighboursFunction · 0.90
SearchSpaceClass · 0.85

Tested by

no test coverage detected