ENH: added routines to convert ddp between full and SA formulations#318
ENH: added routines to convert ddp between full and SA formulations#318
Conversation
e3f713e to
9938ff0
Compare
| if self._sa_pair: | ||
| ns = self.num_states | ||
| na = self.a_indices.max() + 1 | ||
| R = np.zeros((ns, na)) |
There was a problem hiding this comment.
Maybe this should be np.full((ns, na), -np.inf)?
| if self._sa_pair: | ||
| return self | ||
| else: | ||
| s_ind, a_ind = np.where(np.isfinite(self.R)) |
There was a problem hiding this comment.
Better to write self.R > -np.inf instead of np.isfinite(self.R)?
(self.R may contain np.inf.)
|
A comment on terminology: (My view is that an SA formulation is already a "full" description of the model when the sets |
|
Thanks for the review. I 100% agree on all accounts and will make the changes in a few hours when I'm back at a computer |
|
In the test code, maybe better to assign |
|
Good call @oyamad -- I've added these tests. |
|
Thanks @sglyon. |
Sometimes I find it helpful to have convenient, even if not optimally efficient, routines for converting between the SA and full formulations.
This PR implements such routines.