minerl.env package provides an optimized python
software layer over MineRLEnv, a fork of the popular Minecraft
simulator Malmo which enables synchronous, stable, and
fast samples from the Minecraft environment.
- class minerl.env.malmo.CustomAsyncRemoteMethod(proxy, name, max_retries)¶
- class minerl.env.malmo.InstanceManager¶
The Minecraft instance manager library. The instance manager can be used to allocate and safely terminate existing Malmo instances for training agents.
Note: This object never needs to be explicitly invoked by the user of the MineRL library as the creation of one of the several MineRL environments will automatically query the InstanceManager to create a new instance.
Note: In future versions of MineRL the instance manager will become its own daemon process which provides instance allocation capability using remote procedure calls.
- DEFAULT_IP = 'localhost'¶
- KEEP_ALIVE_PYRO_FREQUENCY = 5¶
- MAXINSTANCES = None¶
- MINECRAFT_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/minerl/envs/stable/lib/python3.7/site-packages/minerl/env/../Malmo/Minecraft'¶
- REMOTE = False¶
- SCHEMAS_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/minerl/envs/stable/lib/python3.7/site-packages/minerl/env/../Malmo/Schemas'¶
- STATUS_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/minerl/envs/stable/lib/python3.7/site-packages/sphinx/performance'¶
- X11_DIR = '/tmp/.X11-unix'¶
- classmethod add_existing_instance(port)¶
- classmethod add_keep_alive(_pid, _callback)¶
- classmethod allocate_pool(num)¶
- classmethod configure_malmo_base_port(malmo_base_port)¶
Configure the lowest or base port for Malmo
- classmethod get_instance(pid, instance_id=None)¶
Gets an instance from the instance manager. This method is a context manager and therefore when the context is entered the method yields a InstanceManager.Instance object which contains the allocated port and host for the given instance that was created.
The allocated InstanceManager.Instance object.
RuntimeError – No available instances or the maximum number of allocated instances reached.
RuntimeError – No available instances and automatic allocation of instances is off.
- headless = False¶
- classmethod is_remote()¶
- managed = True¶
- ninstances = 0¶
- classmethod set_valid_jdwp_port_for_instance(instance) None ¶
Find a valid port for JDWP (Java Debug Wire Protocol), so that the instance can be debugged with an attached debugger. The port is set in the instance, so that other instances can check whether the port is reserved. :param instance: Instance to find and port for, and where we will set the jdwp port.
- classmethod shutdown()¶
- class minerl.env.malmo.MinecraftInstance(port=None, existing=False, status_dir=None, seed=None, instance_id=None)¶
A subprocess wrapper which maintains a reference to a minecraft subprocess and also allows for stable closing and launching of such subprocesses across different platforms.
The Minecraft instance class works by launching two subprocesses: the Malmo subprocess, and a watcher subprocess with access to the process IDs of both the parent process and the Malmo subprocess. If the parent process dies, it will kill the subprocess, and then itself.
This scheme has a single failure point of the process dying before the watcher process is launched.
- MAX_PIPE_LENGTH = 500¶
- property actor_name¶
- property client_socket¶
Closes the object.
- property had_to_clean¶
- property host¶
- property jdwp_port¶
JDWP (Java Debug Wire Protocol) port, if any, so the instance can be debugged with an attached debugger.
Kills the process (if it has been launched.)
- launch(daemonize=False, replaceable=True)¶
- property port¶
- property status_dir¶
- class minerl.env.malmo.SeedType(value)¶
The seed type for an instance manager.
0 - NONE: No seeding whatsoever. 1 - CONSTANT: All envrionments have the same seed (the one specified
to the instance manager) (or alist of seeds , separated)
- 2 - GENERATED: All environments have different seeds generated from a single
random generator with the seed specified to the InstanceManager.
- 3 - SPECIFIED: Each instance is given a list of seeds. Specify this like
1,2,3,4;848,432,643;888,888,888 Each instance’s seed list is separated by ; and each seed is separated by ,
- CONSTANT = 1¶
- GENERATED = 2¶
- NONE = 0¶
- SPECIFIED = 3¶
- classmethod get_index(type)¶
Defines the entry point for the remote procedure call server.
- minerl.env.malmo.launch_queue_logger_thread(output_producer, should_end)¶