Closed shaesaert closed 5 years ago
I added a method to add a node to the firm graph https://github.com/pettni/pdf-abstraction/blob/b6545f9a30b61ceed8733e7913410750fb81689d/best/hVI_fsrm.py#L600 This automatically updates the firm graph nodes and edges and also the product structure. There is a unit test that uses it: https://github.com/pettni/pdf-abstraction/blob/b6545f9a30b61ceed8733e7913410750fb81689d/tests/test_det_roadmap.py#L197
I have also added a method to prune nodes in the product graph. Thus nodes are not pruned in Firm, since they are quite complicated to remove there. Instead, they are pruned from the product graph, this implies that they are no longer considered in the backups and for the value function
nodes, edges, visited = plot_optimizers(prod_,ax)
prod_.prune(keep_list=visited).
See commit March 2nd, 2019 Pruning:
Resampling
The result is as follows: The original roadmap (Spath)
The transitions that belong to the set of optimizers after 20 back-ups
The pruned and resampled (3 additional nodes) roadmap (SPath) with:
The transitions that belong to the set of optimizers after 5 additional back-ups The backups start with the values of the initial specs_Spath in which the new nodes get value zero. Already after a couple of backups this means that a shorter path is found in case the first sample region is not sufficient. This reduces the needed path length from 20 to 12. Ofcourse this also implies that the overall risk discreases.
Currently, the algorithm does not prune or resample the nodes for the roadmap of the rover. That is the algorithm operates as follows:
The objective is to add a pruning and resampling step after the 3rd and to recompute the value function. Thus, 1->3 then resample and prune, iterate value function.
Suppose the result after step 2 is as follows:
Then based on the active choices of actions we can prune the transitions and nodes in this graph as follows: In this case we found the following:
See https://github.com/pettni/pdf-abstraction/blob/ScalableBest_class_change/Demo_file/Rocksample.ipynb in commit b232d56ee88793c1233568f9a2196240bfdc54a1 .