In Vasicek model, we have the following relation to get Discount factors given the value of short rate: $$P(t\,,T)={{e}^{A(t,T)\,-\,B(t,T){{r}_{t}}\,}}$$
So, Discount factors are known as soon as we know the short rate. But then in some references like Glasserman (pg. 115) there is a whole subsection on "Joint Simulation [of short rate] with the Discount Factor" where he talks about simulating the pair $$({r}_{t},\int_{0}^t{r(u)}du)$$.
Piterbarg's book has something similar too. So my question is - why do we need to simulate Discount factor if we have an exact analytical result.