Environment/LASROMEnv.py
def _move_to_excitor_location(self, observation):
        """
        find lights with maximum intensities and move the visitors to that location

        """
        light_color_start_index = self.prox_sensor_num

        light_intensity = np.zeros(self.lights_num)
        for i in range(self.lights_num):
            light_intensity[i] = observation[light_color_start_index + i * 3]

        # sort intensity by ascending order
        light_inten_order = np.argsort(light_intensity)

        num_visitors = len(self.visitorBodyHandles)
        visitor_idx = 0
        for light_idx in reversed(light_inten_order):
            if light_intensity[light_idx] > 0 and visitor_idx < num_visitors:
                position = self.behaviour.single_light_position(light_idx)
                position[2] = 0.9154
                self._set_single_visitor_position("Body_Visitor#"+str(visitor_idx), position)
                visitor_idx += 1
            else:
                break

        # Put the rest of the visitors at origin
        if visitor_idx < num_visitors:
            for i in range(visitor_idx,num_visitors):
                self._set_single_visitor_position("Body_Visitor#" + str(i), [0,0,0.9154])

        find lights with maximum intensities and move the visitors to that location

        
find lights with maximum intensities and move the visitors to that location
find lights with maximum intensities and move the visitors to that location
def _move_to_excitor_location(self, observation):
        light_color_start_index = self.prox_sensor_num
        light_intensity = np.zeros(self.lights_num)
        for i in range(self.lights_num):
            light_intensity[i] = observation[light_color_start_index + i * 3]
        light_inten_order = np.argsort(light_intensity)
        num_visitors = len(self.visitorBodyHandles)
        visitor_idx = 0
        for light_idx in reversed(light_inten_order):
            if light_intensity[light_idx] > 0 and visitor_idx < num_visitors:
                position = self.behaviour.single_light_position(light_idx)
                position[2] = 0.9154
                self._set_single_visitor_position("Body_Visitor#"+str(visitor_idx), position)
                visitor_idx += 1
            else:
                break
        if visitor_idx < num_visitors:
            for i in range(visitor_idx,num_visitors):
                self._set_single_visitor_position("Body_Visitor#" + str(i), [0,0,0.9154])
def _move_to_excitor_location ( self , observation ) : light_color_start_index = self . prox_sensor_num light_intensity = np . zeros ( self . lights_num ) for i in range ( self . lights_num ) : light_intensity [ i ] = observation [ light_color_start_index + i * 3 ] light_inten_order = np . argsort ( light_intensity ) num_visitors = len ( self . visitorBodyHandles ) visitor_idx = 0 for light_idx in reversed ( light_inten_order ) : if light_intensity [ light_idx ] > 0 and visitor_idx < num_visitors : position = self . behaviour . single_light_position ( light_idx ) position [ 2 ] = 0.9154 self . _set_single_visitor_position ( "Body_Visitor#" + str ( visitor_idx ) , position ) visitor_idx += 1 else : break if visitor_idx < num_visitors : for i in range ( visitor_idx , num_visitors ) : self . _set_single_visitor_position ( "Body_Visitor#" + str ( i ) , [ 0 , 0 , 0.9154 ] )
find lights with maximum intensities and move the visitors to that location
find lights with maximum intensities and move the visitors to that location
"""
        find lights with maximum intensities and move the visitors to that location

        """ # sort intensity by ascending order # Put the rest of the visitors at origin
self
observation