资源简介
阿尔法贝塔剪枝算法五子棋,人工智能课程,Java代码,可直接运行
代码片段和文件信息
“““Implement Agents and Environments (Chapters 1-2).
The class hierarchies are as follows:
Thing ## A physical object that can exist in an environment
Agent
Wumpus
Dirt
Wall
...
Environment ## An environment holds objects runs simulations
XYEnvironment
VacuumEnvironment
WumpusEnvironment
An agent program is a callable instance taking percepts and choosing actions
SimpleReflexAgentProgram
...
EnvGUI ## A window with a graphical representation of the Environment
EnvToolbar ## contains buttons for controlling EnvGUI
EnvCanvas ## Canvas to display the environment of an EnvGUI
“““
# TO DO:
# Implement grabbing correctly.
# When an object is grabbed does it still have a location?
# What if it is released?
# What if the grabbed or the grabber is deleted?
# What if the grabber moves?
#
# Speed control in GUI does not have any effect -- fix it.
from utils import distance_squared turn_heading
from statistics import mean
import random
import copy
import collections
# ______________________________________________________________________________
class Thing:
“““This represents any physical object that can appear in an Environment.
You subclass Thing to get the things you want. Each thing can have a
.__name__ slot (used for output only).“““
def __repr__(self):
return ‘<{}>‘.format(getattr(self ‘__name__‘ self.__class__.__name__))
def is_alive(self):
“““Things that are ‘alive‘ should return true.“““
return hasattr(self ‘alive‘) and self.alive
def show_state(self):
“““Display the agent‘s internal state. Subclasses should override.“““
print(“I don‘t know how to show_state.“)
def display(self canvas x y width height):
“““Display an image of this Thing on the canvas.“““
# Do we need this?
pass
class Agent(Thing):
“““An Agent is a subclass of Thing with one required slot
.program which should hold a function that takes one argument the
percept and returns an action. (What counts as a percept or action
will depend on the specific environment in which the agent exists.)
Note that ‘program‘ is a slot not a method. If it were a method
then the program could ‘cheat‘ and look at aspects of the agent.
It‘s not supposed to do that: the program can only look at the
percepts. An agent program that needs a model of the world (and of
the agent itself) will have to build and maintain its own model.
There is an optional slot .performance which is a number giving
the performance measure of the agent in its environment.“““
def __init__(self program=None):
self.alive = True
self.bump = False
self.holding = []
self.performance = 0
if program is None or not isinstance(program collections.Callable):
print(“Can‘t find a valid program for {} falling back to default.“.format(
self.__clas
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-10-21 17:42 aima-python-master\
文件 131 2018-10-21 17:42 aima-python-master\.flake8
文件 899 2018-10-21 17:42 aima-python-master\.gitignore
文件 91 2018-10-21 17:42 aima-python-master\.gitmodules
文件 477 2018-10-21 17:42 aima-python-master\.travis.yml
文件 10320 2018-10-21 17:42 aima-python-master\CONTRIBUTING.md
文件 1091 2018-10-21 17:42 aima-python-master\LICENSE
文件 17718 2018-10-21 17:42 aima-python-master\README.md
文件 599 2018-10-21 17:42 aima-python-master\SUBMODULE.md
文件 128289 2018-10-21 17:42 aima-python-master\agents.ipynb
文件 35990 2018-10-21 17:42 aima-python-master\agents.py
目录 0 2018-10-21 17:42 aima-python-master\aima-data\
文件 231531 2018-10-21 17:42 aima-python-master\csp.ipynb
文件 27298 2018-10-21 17:42 aima-python-master\csp.py
文件 49294 2018-10-21 17:42 aima-python-master\games.ipynb
文件 20923 2018-10-21 17:42 aima-python-master\games.py
目录 0 2018-10-21 17:42 aima-python-master\gui\
文件 4618 2018-10-21 17:42 aima-python-master\gui\eight_puzzle.py
文件 6944 2018-10-21 17:42 aima-python-master\gui\genetic_algorithm_example.py
文件 23295 2018-10-21 17:42 aima-python-master\gui\grid_mdp.py
文件 21513 2018-10-21 17:42 aima-python-master\gui\romania_problem.py
文件 6810 2018-10-21 17:42 aima-python-master\gui\tic-tac-toe.py
文件 14806 2018-10-21 17:42 aima-python-master\gui\tsp.py
文件 6034 2018-10-21 17:42 aima-python-master\gui\vacuum_agent.py
文件 7210 2018-10-21 17:42 aima-python-master\gui\xy_vacuum_environment.py
目录 0 2018-10-21 17:42 aima-python-master\images\
文件 16933 2018-10-21 17:42 aima-python-master\images\-0.04.jpg
文件 20027 2018-10-21 17:42 aima-python-master\images\-0.4.jpg
文件 19579 2018-10-21 17:42 aima-python-master\images\-4.jpg
文件 21550 2018-10-21 17:42 aima-python-master\images\4.jpg
文件 377 2018-10-21 17:42 aima-python-master\images\IMAGE-CREDITS
............此处省略115个文件信息
相关资源
- java 五子棋游戏
- 五子棋源码加论文
- 基于Java的网络五子棋游戏源代码
- 领航JAVA入门课程——IBM Robocode 人工智
- java版网络五子棋
- Android五子棋代码报告完整
- 五子棋小游戏JAVA
- 基于java的五子棋程序设计毕业论文
- Java 网络版五子棋含源代码
- Java开发的Socket五子棋
- Android游戏源码简单双人对战五子棋源
- Java网络编程 五子棋 课程设计
- 基于Java的五子棋游戏的设计(源代码
- java五子棋
- Java联网五子棋
- Android五子棋论文
- 基于Android五子棋游戏设计与实现
- 《Android》五子棋APP
- 人工智能AI麻将,麻将AlphaGo,可直接
- Andriod studio 3.5项目源码之五子棋
- Android小游戏-五子棋Android studio 含ap
- Android五子棋274277
- Android 简单的人机对战五子棋游戏
- android五子棋源码,默课网hyman的视频
- 安卓五子棋人机游戏
- 安卓五子棋源代码
- java五子棋项目源代码
- 简易五子棋177061
- javaP2P五子棋沙滩版
- Java开发人工智能客服机器人
评论
共有 条评论