From 3474eebfdea6cb4d7601be2107f41c2cfe6a223a Mon Sep 17 00:00:00 2001
From: Dipam Chakraborty <dipam@aicrowd.com>
Date: Wed, 1 Sep 2021 18:20:56 +0530
Subject: [PATCH] add random agent

---
 Dockerfile                     |  0
 agents/deepracer_base_agent.py |  9 +++++++++
 agents/random_agent.py         | 14 ++++++++++++++
 aicrowd.json                   |  5 ++---
 submission_config.py           |  4 ++++
 5 files changed, 29 insertions(+), 3 deletions(-)
 delete mode 100644 Dockerfile
 create mode 100644 agents/deepracer_base_agent.py
 create mode 100644 agents/random_agent.py
 create mode 100644 submission_config.py

diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index e69de29..0000000
diff --git a/agents/deepracer_base_agent.py b/agents/deepracer_base_agent.py
new file mode 100644
index 0000000..fa4fa19
--- /dev/null
+++ b/agents/deepracer_base_agent.py
@@ -0,0 +1,9 @@
+class DeepracerAgent():
+    def __init__(self):
+        self.agent_type = None
+
+    def register_reset(self, observations):
+        raise NotImplementedError
+
+    def compute_action(self, observations, info):
+        raise NotImplementedError
\ No newline at end of file
diff --git a/agents/random_agent.py b/agents/random_agent.py
new file mode 100644
index 0000000..3e242f9
--- /dev/null
+++ b/agents/random_agent.py
@@ -0,0 +1,14 @@
+import numpy as np
+from deepracer_base_agent import DeepracerAgent
+
+class RandomDeepracerAgent(DeepracerAgent):
+    def __init__(self):
+        pass
+
+    def register_reset(self, observations):
+        action = np.random.randint(5)
+        return action
+
+    def compute_action(self, observations, info):
+        action = np.random.randint(5)
+        return action
diff --git a/aicrowd.json b/aicrowd.json
index 4b268b4..3e228a6 100644
--- a/aicrowd.json
+++ b/aicrowd.json
@@ -1,8 +1,7 @@
 {
-  "challenge_id": "evaluations-api-deepracer",
-  "grader_id": "evaluations-api-deepracer",
+  "challenge_id": "neurips-2021-aws-deepracer-ai-driving-olympics-challenge",
   "authors": ["aicrowd-bot"],
   "tags": "change-me",
-  "description": "Random agent for AWS Deep Racer",
+  "description": "Random agent for AWS Deep Racer"
 }
 
diff --git a/submission_config.py b/submission_config.py
new file mode 100644
index 0000000..7f3d761
--- /dev/null
+++ b/submission_config.py
@@ -0,0 +1,4 @@
+from agents.random_agent import RandomDeepracerAgent
+
+class LocalEvaluationConfig:
+    submission_agent = RandomDeepracerAgent
-- 
GitLab