Exemple #1
0
    def encode_percept(self, observation, reward):
        """ Returns the given percept (an observation, reward part) as a list of symbols.

            - `observation`: the observation part of the percept to encode.
            - `reward`: the reward part of the percept to encode.
        """

        # Add first the encoded reward, then the encoded observation to the list of output symbols.
        symbol_list = util.encode(reward, self.environment.reward_bits())
        symbol_list += util.encode(observation,
                                   self.environment.observation_bits())

        # Return the generated list.
        return symbol_list
Exemple #2
0
    def encode_percept(self, observation, reward):
        """ Returns the given percept (an observation, reward part) as a list of symbols.

            - `observation`: the observation part of the percept to encode.
            - `reward`: the reward part of the percept to encode.
    
            (Called `encode_percept` in the C++ version.)
        """

        # Add first the encoded reward, then the encoded observation to the list of output symbols.
        symbol_list  = util.encode(reward, self.environment.reward_bits())
        symbol_list += util.encode(observation, self.environment.observation_bits())

        # Return the generated list.
        return symbol_list
Exemple #3
0
    def encode_action(self, action):
        """ Returns the given action encoded as a list of symbols.

            - `action`: the action to encode.
        """

        return util.encode(action, self.environment.action_bits())
Exemple #4
0
    def encode_action(self, action):
        """ Returns the given action encoded as a list of symbols.

            - `action`: the action to encode.

            (Called `encodeAction` in the C++ version.)
        """

        return util.encode(action, self.environment.action_bits())
Exemple #5
0
    def encode_action(self, action):
        """ Returns the given action encoded as a list of symbols.

            - `action`: the action to encode.

            (Called `encodeAction` in the C++ version.)
        """

        return util.encode(action, self.environment.action_bits())