c654fb044a9084fcd85606f18127c82dfd46182f,example.py,,editor_example,#,163

Before Change


    This editor example shows how to interact with holodeck worlds while they are being built
    in the Unreal Engine. Most people that use holodeck will not need this.
    
    sensors = [Sensors.RGB_CAMERA]
    agent_definitions = [
        AgentDefinition("turtle0", agents.TurtleAgent, sensors),
        AgentDefinition("turtle1", agents.TurtleAgent, sensors),
        AgentDefinition("turtle2", agents.TurtleAgent, sensors),
        AgentDefinition("turtle3", agents.TurtleAgent, sensors),
        AgentDefinition("turtle4", agents.TurtleAgent, sensors)
    ]
    env = HolodeckEnvironment(agent_definitions, start_world=False)
    command = [0, 10]

    for i in range(10):
        env.reset()
        _ = env.act("turtle0", command)
        _ = env.act("turtle1", command)
        _ = env.act("turtle2", command)
        _ = env.act("turtle3", command)
        _ = env.act("turtle4", command)
        for _ in range(10000):
            states = env.tick()
            print(states["turtle0"][Sensors.REWARD])
            // pixels = states["turtle0"][Sensors.RGB_CAMERA]
            // cv2.namedWindow("Image")
            // cv2.moveWindow("Image", 500, 500)

After Change


        env.reset()
        env.send_world_command("SetWeather", string_params=["rain"])
        for _ in range(1000):
            state, reward, terminal, _ = env.step(command)


def editor_multi_agent_example():
    This editor example shows how to interact with holodeck worlds that have multiple agents.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 3

Instances


Project Name: BYU-PCCL/holodeck
Commit Name: c654fb044a9084fcd85606f18127c82dfd46182f
Time: 2019-02-11
Author: maxdrob1@gmail.com
File Name: example.py
Class Name:
Method Name: editor_example


Project Name: dpressel/mead-baseline
Commit Name: 3d9e51d5034e89bcec3a04eff3e646c70b45edb2
Time: 2017-03-16
Author: dpressel@gmail.com
File Name: classify/python/tf/train.py
Class Name: Trainer
Method Name: train


Project Name: allenai/allennlp
Commit Name: 5ad7a33a04d8829ad3439b5f9390bd136105f986
Time: 2020-05-28
Author: tobiasr@allenai.org
File Name: allennlp/nn/beam_search.py
Class Name: BeamSearch
Method Name: search


Project Name: HyperGAN/HyperGAN
Commit Name: d78a6f10ce5360c49d25166c4acb1e4ccb32734d
Time: 2020-02-07
Author: martyn@255bits.com
File Name: hypergan/trainers/alternating_trainer.py
Class Name: AlternatingTrainer
Method Name: _step


Project Name: tensorflow/agents
Commit Name: 230503ac56636d91d53d728c247c6ea3d096eeb9
Time: 2018-11-30
Author: sguada@google.com
File Name: tf_agents/environments/tf_py_environment_test.py
Class Name: TFPYEnvironmentTest
Method Name: testOneStep