def _move(self, feature, randomLocation = False, useNoise = True):
    """
    Move the sensor to the center of the specified feature. If the sensor is
    currently at another location, send the displacement into the cortical
    column so that it can perform path integration.
    """

    if randomLocation:
      locationOnObject = {
        "top": feature["top"] + np.random.rand()*feature["height"],
        "left": feature["left"] + np.random.rand()*feature["width"],
      }
    else:
      locationOnObject = {
        "top": feature["top"] + feature["height"]/2.,
        "left": feature["left"] + feature["width"]/2.
      }

    if self.locationOnObject is not None:
      displacement = {"top": locationOnObject["top"] -
                             self.locationOnObject["top"],
                      "left": locationOnObject["left"] -
                              self.locationOnObject["left"]}
      if useNoise:
        params = self.column.movementCompute(displacement,
                                             self.noiseFactor,
                                             self.moduleNoiseFactor)
      else:
        params = self.column.movementCompute(displacement, 0, 0)

      for monitor in self.monitors.values():
        monitor.afterLocationShift(**params)
    else:
      for monitor in self.monitors.values():
        monitor.afterLocationInitialize()

    self.locationOnObject = locationOnObject
    for monitor in self.monitors.values():
      monitor.afterLocationChanged(locationOnObject)
def _move ( self , feature , randomLocation = False , useNoise = True ) : if randomLocation : locationOnObject = { "top" : feature [ "top" ] + np . random . rand ( ) * feature [ "height" ] , "left" : feature [ "left" ] + np . random . rand ( ) * feature [ "width" ] , } else : locationOnObject = { "top" : feature [ "top" ] + feature [ "height" ] / 2. , "left" : feature [ "left" ] + feature [ "width" ] / 2. } if self . locationOnObject is not None : displacement = { "top" : locationOnObject [ "top" ] - self . locationOnObject [ "top" ] , "left" : locationOnObject [ "left" ] - self . locationOnObject [ "left" ] } if useNoise : params = self . column . movementCompute ( displacement , self . noiseFactor , self . moduleNoiseFactor ) else : params = self . column . movementCompute ( displacement , 0 , 0 ) for monitor in self . monitors . values ( ) : monitor . afterLocationShift ( ** params ) else : for monitor in self . monitors . values ( ) : monitor . afterLocationInitialize ( ) self . locationOnObject = locationOnObject for monitor in self . monitors . values ( ) : monitor . afterLocationChanged ( locationOnObject )
Move the sensor to the center of the specified feature. If the sensor is
    currently at another location, send the displacement into the cortical
    column so that it can perform path integration.