From 93c99c051e965c93a1e01de7645abce36540e0a7 Mon Sep 17 00:00:00 2001
From: SP Mohanty <spmohanty91@gmail.com>
Date: Mon, 22 Jul 2019 15:11:56 +0300
Subject: [PATCH] Addresses #117 - Adds example param passing on env_create to
 reference custom obs-builder

---
 flatland/evaluators/client.py  | 6 +++---
 flatland/evaluators/service.py | 7 +++++++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/flatland/evaluators/client.py b/flatland/evaluators/client.py
index 0eaacb57..0853f498 100644
--- a/flatland/evaluators/client.py
+++ b/flatland/evaluators/client.py
@@ -133,10 +133,10 @@ class FlatlandRemoteClient(object):
         else:
             return True
 
-    def env_create(self):
+    def env_create(self, params={}):
         _request = {}
         _request['type'] = messages.FLATLAND_RL.ENV_CREATE
-        _request['payload'] = {}
+        _request['payload'] = params
         _response = self._blocking_request(_request)
         observation = _response['payload']['observation']
 
@@ -197,7 +197,7 @@ class FlatlandRemoteClient(object):
 
 if __name__ == "__main__":
     env_client = FlatlandRemoteClient()
-    
+
     def my_controller(obs, _env):
         _action = {}
         for _idx, _ in enumerate(_env.agents):
diff --git a/flatland/evaluators/service.py b/flatland/evaluators/service.py
index c6116552..1729196c 100644
--- a/flatland/evaluators/service.py
+++ b/flatland/evaluators/service.py
@@ -235,6 +235,8 @@ class FlatlandRemoteEvaluationService:
             Add a high level summary of everything thats 
             hapenning here.
         """
+        env_params = command["payload"]  # noqa F841
+        
         if self.simulation_count < len(self.env_file_paths):
             """
             There are still test envs left that are yet to be evaluated 
@@ -242,6 +244,11 @@ class FlatlandRemoteEvaluationService:
 
             test_env_file_path = self.env_file_paths[self.simulation_count]
             del self.env
+            # TODO : Use env_params dictionary to instantiate
+            # the RailEnv
+            # Maybe use a gin-like interface ?
+            # Needs discussion with Erik + Giacomo
+            # -Mohanty
             self.env = RailEnv(
                 width=1,
                 height=1,
-- 
GitLab