class_docstr: Implementation of the random-dot motion environment 
class_docstr_tok: ["Implementation","of","the","random-dot","motion","environment"]
docstr: Initialize the RDM task using a desired number of directions, the precision (aka coherence) of the motion, 
  a "true dot direction" that generates the observations, and a sampling_state corresponding to how the agent starts (by sampling or not sampling the dot motion)
code: def __init__(
      self, precision=1.0, dot_direction=None, sampling_state=None
  ):
      """Initialize the RDM task using a desired number of directions, the precision (aka coherence) of the motion,
      a "true dot direction" that generates the observations, and a sampling_state corresponding to how the agent starts (by sampling or not sampling the dot motion)
      """
  
      if dot_direction is None:
          self._dot_dir = np.random.choice(motion_dir)
      else:
          assert (
              dot_direction in motion_dir
          ), f"{dot_direction} is not a valid motion direction\n"
          self._dot_dir = dot_direction
  
      if sampling_state is None:
          self._action = np.random.choice(sampling_states)
      else:
          self._set_sampling_state(sampling_state)
  
      self._p = precision
      self.direction_names = motion_dir
      self.sampling_names = sampling_states
      self.n_states = n_states
      self._generate_dot_dist()
      print(
          f"True motion direction is {self._dot_dir}, motion coherence is {100.0*self.coherence}\n"
      )
  
imports: from pymdp.envs import Env
  from pymdp import utils, maths
  import numpy
  from itertools import permutations, product
label_desc: Use image node_id 1 to create a new RandomDotMotion object from inherited base classes: Env with example: obj = RandomDotMotion(precision, dot_direction, sampling_state)