Malmo——微软人工智能项目

来源:互联网 发布:网络播放器哪个平台好 编辑:程序博客网 时间:2024/06/06 02:40

Malmo——微软人工智能项目



Malmo是一个基于Minecraft(我的世界)的人工智能实验和研究平台。我们致力于启发在这个游戏环境下挑战新人工智能问题的新一代研究。


开始这个项目

1.下载最新版本,windows版本,Linux版本或者是MacOSX版本

注意:这和直接在GitHub上下载压缩包不一样。像这样做是无法进行的除非你打算编译这些源代码(这是一个很长的过程)如果你得到这样的错误“ImportError”

2.为你的系统安装依赖项(见下面的补充)。

3.启动安装了malmo mod的我的世界。请遵循下面的命令。(见下面的补充)

4.启动其中一个我们的代理编程平台,python,lua,C#,C++,java.

5.跟随这个指导。(见于附录)

6.探索我们提供的文档。在安装包中有readme.htm可以跳转到我们提供的文档。



补充1:2.安装依赖项

预备任务:

1.第一下载windows当前的安装包

2.设置环境变量

安装步骤:

1.打开window Powershell然后运行“Set-ExecutionPolicy -Scope CurrentUser Unrestricted"

2.进入环境变量“cd $env:HOMEPATH\Malmo-0.30.0-Windows-64bit\scripts

3.“.\malmo_install.ps1"

在运行的途中系统会提示要使用管理员模式。


补充2:3.启动安装了malmo mod的我的世界

我的世界需要创造窗口带有OpenGL的支持,所以你安装的机器需要有一个桌面环境。

进入解压后的文件夹。

cd Minecraft

launchClient(on Windows)

./launchClient.sh (On Linux or MacOSX)

注意:如果你要在启动器上运行这个,下面会有一行字显示“创建95%”忽视这句话,不要等到“100%”。只要当我的世界游戏窗口已经开始了显示了主菜单,就可以开始了。



Project Malmö is a platform for Artificial Intelligence experimentation and research built on top of Minecraft. We aim to inspire a new generation of research into challenging new problems presented by this unique environment.

Getting Star

1.Download the latestpre-built version, for Windows, Linux or MacOSX.
NOTE: This is not the same as downloading a zip of the source from Github.Doing thiswill not work unless you are planning to build the source code yourself (which is a lengthier process). If you get errors along the lines of "ImportError:No module named MalmoPython" it will probably be because you have made this mistake.

2.Install the dependencies for your OS: Windows, Linux, MacOSX.

3.Launch Minecraft with our Mod installed. Instructions below.

4.Launch one of our sample agents, as Python, Lua, C#, C++ or Java. Instructions below.

5.Follow the Tutorial

6.Explore the Documentation. This is also available in the readme.html in the release zip.

7.Read the Blog for more information.

8.If you want to build from source then see the build instructions for your OS: Windows, Linux, MacOSX.


Launching Minecraft with our Mod:

Minecraft needs to create windows and render to them with OpenGL, so the machine you do this from must have a desktop environment.

Go to the folder where you unzipped the release, then:

cd Minecraft
launchClient (On Windows)
./launchClient.sh (On Linux or MacOSX)

or, e.g. launchClient -port 10001 to launch Minecraft on a specific port.

on Linux or MacOSX: ./launchClient.sh -port 10001

NB: If you run this from a terminal, the bottom line will say something like "Building 95%" - ignore this - don't wait for 100%! As long as a Minecraft game window has opened and is displaying the main menu, you are good to go.

By default the Mod chooses port 10000 if available, and will search upwards for a free port if not, up to 11000. The port chosen is shown in the Mod config page.

To change the port while the Mod is running, use the portOverride setting in the Mod config page.

The Mod and the agents use other ports internally, and will find free ones in the range 10000-11000 so if administering a machine for network use these TCP ports should be open.


Launch an agent:

Running a Python agent:

cd Python_Examplespython run_mission.py

On MacOSX we currently only support the system python, so please use /usr/bin/python run_mission.py if not the default.

Running a Lua agent: (Linux only)

cd Lua_Exampleslua run_mission.lua

Running a Torch agent: (Linux only)

cd Torch_Examplesth run_mission.lua

Running a C++ agent:

cd Cpp_Examples

To run the pre-built sample:

run_mission (on Windows)
./run_mission (on Linux or MacOSX)

To build the sample yourself:

cmake .
cmake --build .
./run_mission (on Linux or MacOSX)
Debug\run_mission.exe (on Windows)

Running a C# agent:

To run the pre-built sample:

cd CSharp_Examples
CSharpExamples_RunMission.exe (on Windows)
mono CSharpExamples_RunMission.exe (on Linux or MacOSX)

To build the sample yourself, open CSharp_Examples/RunMission.csproj in Visual Studio or MonoDevelop.

Or from the command-line:

cd CSharp_Examples

Then, on Windows:

msbuild RunMission.csproj /p:Platform=x64bin\x64\Debug\CSharpExamples_RunMission.exe

On Linux or MacOSX:

xbuild RunMission.csproj /p:Platform=x64mono bin/x64/Debug/CSharpExamples_RunMission.exe

Running a Java agent:

cd Java_Examples
java -cp MalmoJavaJar.jar:JavaExamples_run_mission.jar -Djava.library.path=. JavaExamples_run_mission (on Linux or MacOSX)
java -cp MalmoJavaJar.jar;JavaExamples_run_mission.jar -Djava.library.path=. JavaExamples_run_mission (on Windows)

Running an Atari agent: (Linux only)

cd Python_Examplespython ALE_HAC.py


附录

1.原文地址:https://github.com/Microsoft/malmo

2.安装后的编程指引:https://github.com/Microsoft/malmo/blob/master/Malmo/samples/Python_examples/Tutorial.pdf