code: def stoch2array(self):
          
          a = np.empty(self.dim)
          for stochastic in self.stochastics:
              a[self._slices[stochastic]] = stochastic.value
          return a
docs: Return the stochastic objects as an array.