python类raiseNotDefined()的实例源码

multiAgents.py 文件源码 项目:AI_MinMax_AlphaBetaPruning 作者: astraey 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def getAction(self, gameState):
        """
          Returns the minimax action from the current gameState using self.depth
          and self.evaluationFunction.

          Here are some method calls that might be useful when implementing minimax.

          gameState.getLegalActions(agentIndex):
            Returns a list of legal actions for an agent
            agentIndex=0 means Pacman, ghosts are >= 1

          gameState.generateSuccessor(agentIndex, action):
            Returns the successor game state after an agent takes an action

          gameState.getNumAgents():
            Returns the total number of agents in the game
        """
        "*** YOUR CODE HERE ***"
        util.raiseNotDefined()
search.py 文件源码 项目:AIclass 作者: mttk 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def backtrack(self):
        """
        Reconstruct a path to the initial state from the current node.
        Bear in mind that usually you will reconstruct the path from the 
        final node to the initial.
        """
        moves = []
        # make a deep copy to stop any referencing isues.
        node = copy.deepcopy(self)

        if node.isRootNode(): 
            # The initial state is the final state
            return moves        

        "**YOUR CODE HERE**"
        util.raiseNotDefined()
search.py 文件源码 项目:AIclass 作者: mttk 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def depthFirstSearch(problem):
    """
    Search the deepest nodes in the search tree first.

    Your search algorithm needs to return a list of actions that reaches the
    goal. Make sure to implement a graph search algorithm.

    To get started, you might want to try some of these simple commands to
    understand the search problem that is being passed in:

    print "Start:", problem.getStartState()
    print "Is the start a goal?", problem.isGoalState(problem.getStartState())
    print "Start's successors:", problem.getSuccessors(problem.getStartState())
    """
    "*** YOUR CODE HERE ***"
    util.raiseNotDefined()
search.py 文件源码 项目:AIclass 作者: mttk 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def backtrack(self):
        """
        Reconstruct a path to the initial state from the current node.
        Bear in mind that usually you will reconstruct the path from the 
        final node to the initial.
        """
        moves = []
        # make a deep copy to stop any referencing isues.
        node = copy.deepcopy(self)

        if node.isRootNode(): 
            # The initial state is the final state
            return moves        

        "**YOUR CODE HERE**"
        util.raiseNotDefined()
search.py 文件源码 项目:AIclass 作者: mttk 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def depthFirstSearch(problem):
    """
    Search the deepest nodes in the search tree first.

    Your search algorithm needs to return a list of actions that reaches the
    goal. Make sure to implement a graph search algorithm.

    To get started, you might want to try some of these simple commands to
    understand the search problem that is being passed in:

    print "Start:", problem.getStartState()
    print "Is the start a goal?", problem.isGoalState(problem.getStartState())
    print "Start's successors:", problem.getSuccessors(problem.getStartState())
    """
    "*** YOUR CODE HERE ***"
    util.raiseNotDefined()
captureAgents.py 文件源码 项目:AI-Pacman 作者: AUTBS 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def getAgent(self, index):
    "Returns the agent for the provided index."
    util.raiseNotDefined()
captureAgents.py 文件源码 项目:AI-Pacman 作者: AUTBS 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def chooseAction(self, gameState):
    """
    Override this method to make a good agent. It should return a legal action within
    the time limit (otherwise a random legal action will be chosen for you).
    """
    util.raiseNotDefined()

  #######################
  # Convenience Methods #
  #######################
ghostAgents.py 文件源码 项目:AI-Pacman 作者: AUTBS 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def getDistribution(self, state):
        "Returns a Counter encoding a distribution over actions from the provided state."
        util.raiseNotDefined()
pursuerAgents.py 文件源码 项目:xiao_multiagent 作者: namidairo777 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def getDistribution(self, state):
        "Returns a Counter encoding a distribution over actions from the provided state."
        util.raiseNotDefined()
search.py 文件源码 项目:Berkeley-AI-PacMan-Lab-1 作者: jrios6 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def getStartState(self):
     """
     Returns the start state for the search problem
     """
     util.raiseNotDefined()
search.py 文件源码 项目:Berkeley-AI-PacMan-Lab-1 作者: jrios6 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def isGoalState(self, state):
     """
       state: Search state

     Returns True if and only if the state is a valid goal state
     """
     util.raiseNotDefined()
search.py 文件源码 项目:Berkeley-AI-PacMan-Lab-1 作者: jrios6 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def getSuccessors(self, state):
     """
       state: Search state

     For a given state, this should return a list of triples,
     (successor, action, stepCost), where 'successor' is a
     successor to the current state, 'action' is the action
     required to get there, and 'stepCost' is the incremental
     cost of expanding to that successor
     """
     util.raiseNotDefined()
search.py 文件源码 项目:Berkeley-AI-PacMan-Lab-1 作者: jrios6 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def getCostOfActions(self, actions):
     """
      actions: A list of actions to take

     This method returns the total cost of a particular sequence of actions.  The sequence must
     be composed of legal moves
     """
     util.raiseNotDefined()
ghostAgents.py 文件源码 项目:Berkeley-AI-PacMan-Lab-1 作者: jrios6 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def getDistribution(self, state):
    "Returns a Counter encoding a distribution over actions from the provided state."
    util.raiseNotDefined()
ghostAgents.py 文件源码 项目:AI_MinMax_AlphaBetaPruning 作者: astraey 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def getDistribution(self, state):
        "Returns a Counter encoding a distribution over actions from the provided state."
        util.raiseNotDefined()
multiAgents.py 文件源码 项目:AI_MinMax_AlphaBetaPruning 作者: astraey 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def getAction(self, gameState):
        """
          Returns the minimax action using self.depth and self.evaluationFunction
        """
        "*** YOUR CODE HERE ***"
        util.raiseNotDefined()
multiAgents.py 文件源码 项目:AI_MinMax_AlphaBetaPruning 作者: astraey 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def getAction(self, gameState):
        """
          Returns the expectimax action using self.depth and self.evaluationFunction

          All ghosts should be modeled as choosing uniformly at random from their
          legal moves.
        """
        "*** YOUR CODE HERE ***"
        util.raiseNotDefined()
multiAgents.py 文件源码 项目:AI_MinMax_AlphaBetaPruning 作者: astraey 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def betterEvaluationFunction(currentGameState):
    """
      Your extreme ghost-hunting, pellet-nabbing, food-gobbling, unstoppable
      evaluation function (question 5).

      DESCRIPTION: <write something here so we know what you did>
    """
    "*** YOUR CODE HERE ***"
    util.raiseNotDefined()

# Abbreviation
ghostAgents.py 文件源码 项目:2017-planning-with-simulators 作者: aig-upf 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def getDistribution(self, state):
        "Returns a Counter encoding a distribution over actions from the provided state."
        util.raiseNotDefined()
search.py 文件源码 项目:Pacman-AI 作者: ryanshrott 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def getStartState(self):
        """
        Returns the start state for the search problem
        """
        util.raiseNotDefined()
search.py 文件源码 项目:Pacman-AI 作者: ryanshrott 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def isGoalState(self, state):
        """
          state: Search state

        Returns True if and only if the state is a valid goal state
        """
        util.raiseNotDefined()
search.py 文件源码 项目:Pacman-AI 作者: ryanshrott 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def getSuccessors(self, state):
        """
          state: Search state

        For a given state, this should return a list of triples,
        (successor, action, stepCost), where 'successor' is a
        successor to the current state, 'action' is the action
        required to get there, and 'stepCost' is the incremental
        cost of expanding to that successor
        """
        util.raiseNotDefined()
search.py 文件源码 项目:Pacman-AI 作者: ryanshrott 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def getCostOfActions(self, actions):
        """
         actions: A list of actions to take

        This method returns the total cost of a particular sequence of actions.  The sequence must
        be composed of legal moves
        """
        util.raiseNotDefined()
ghostAgents.py 文件源码 项目:Pacman-AI 作者: ryanshrott 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def getDistribution(self, state):
        "Returns a Counter encoding a distribution over actions from the provided state."
        util.raiseNotDefined()
valueIterationAgents.py 文件源码 项目:Reinforcement-Learning 作者: victorgrego 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def getQValue(self, state, action):
    """
      The q-value of the state action pair
      (after the indicated number of value iteration
      passes).  Note that value iteration does not
      necessarily create this quantity and you may have
      to derive it on the fly.
    """
    "*** YOUR CODE HERE ***"
    util.raiseNotDefined()
valueIterationAgents.py 文件源码 项目:Reinforcement-Learning 作者: victorgrego 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def getPolicy(self, state):
    """
      The policy is the best action in the given state
      according to the values computed by value iteration.
      You may break ties any way you see fit.  Note that if
      there are no legal actions, which is the case at the
      terminal state, you should return None.
    """
    "*** YOUR CODE HERE ***"
    util.raiseNotDefined()
featureExtractors.py 文件源码 项目:Reinforcement-Learning 作者: victorgrego 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def getFeatures(self, state, action):    
    """
      Returns a dict from features to counts
      Usually, the count will just be 1.0 for
      indicator functions.  
    """
    util.raiseNotDefined()
learningAgents.py 文件源码 项目:Reinforcement-Learning 作者: victorgrego 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def getQValue(self, state, action):
    """
    Should return Q(state,action)
    """
    util.raiseNotDefined()
learningAgents.py 文件源码 项目:Reinforcement-Learning 作者: victorgrego 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def getValue(self, state):
    """
    What is the value of this state under the best action? 
    Concretely, this is given by

    V(s) = max_{a in actions} Q(s,a)
    """
    util.raiseNotDefined()
learningAgents.py 文件源码 项目:Reinforcement-Learning 作者: victorgrego 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def getAction(self, state):
    """
    state: can call state.getLegalActions()
    Choose an action and return it.   
    """
    util.raiseNotDefined()


问题


面经


文章

微信
公众号

扫码关注公众号