From b95090ffb0191f38da1f0f563afdaf1e67e820e4 Mon Sep 17 00:00:00 2001 From: OsanaiTakuya Date: Thu, 28 Sep 2017 15:32:34 +0900 Subject: [PATCH 01/15] Fix to work with python 3 and chainer 2 --- agent/cognitive/interpreter.py | 2 +- agent/cognitive/module.py | 4 ++-- agent/cognitive/service.py | 2 +- agent/ml/cnn_feature_extractor.py | 7 ++++--- agent/ml/experience.py | 3 ++- agent/ml/q_net.py | 17 ++++++++++------- agent/requirements.txt | 2 +- agent/server.py | 31 ++++++++++++++++--------------- 8 files changed, 37 insertions(+), 31 deletions(-) diff --git a/agent/cognitive/interpreter.py b/agent/cognitive/interpreter.py index 45dd4be..90e4ecf 100644 --- a/agent/cognitive/interpreter.py +++ b/agent/cognitive/interpreter.py @@ -330,7 +330,7 @@ def check_grounding(self): mod_name = v[0] class_name = v[1] try: - mod = __import__(mod_name, globals(), locals(), [class_name], -1) + mod = __import__(mod_name, globals(), locals(), [class_name], 0) Klass = getattr(mod, class_name) component_instance = Klass() except: diff --git a/agent/cognitive/module.py b/agent/cognitive/module.py index d4c33ac..a983c78 100644 --- a/agent/cognitive/module.py +++ b/agent/cognitive/module.py @@ -41,12 +41,12 @@ def set_model(self, feature_extractor): def load_model(self, cnn_feature_extractor): if os.path.exists(cnn_feature_extractor): app_logger.info("loading... {}".format(cnn_feature_extractor)) - self.feature_extractor = pickle.load(open(cnn_feature_extractor)) + self.feature_extractor = pickle.load(open(cnn_feature_extractor, 'rb')) app_logger.info("done") else: self.feature_extractor = CnnFeatureExtractor(self.use_gpu, self.model, self.model_type, self.image_feature_dim) - pickle.dump(self.feature_extractor, open(cnn_feature_extractor, 'w')) + pickle.dump(self.feature_extractor, open(cnn_feature_extractor, 'wb')) app_logger.info("pickle.dump finished") def fire(self): diff --git a/agent/cognitive/service.py b/agent/cognitive/service.py index 825f0ac..0c50873 100644 --- a/agent/cognitive/service.py +++ b/agent/cognitive/service.py @@ -1,6 +1,6 @@ # coding: utf-8 -import interpreter +from cognitive import interpreter import brica1 import numpy as np diff --git a/agent/ml/cnn_feature_extractor.py b/agent/ml/cnn_feature_extractor.py index ae6f442..9be0c86 100644 --- a/agent/ml/cnn_feature_extractor.py +++ b/agent/ml/cnn_feature_extractor.py @@ -47,8 +47,9 @@ def __init__(self, gpu, model, model_type, out_dim): self.mean_image = mean_image[:, start:stop, start:stop].copy() def predict(self, x): - y, = self.func(inputs={'data': x}, outputs=[self.outname], train=False) - return y + with chainer.using_config('train', False), chainer.no_backprop_mode(): + y, = self.func(inputs={'data': x}, outputs=[self.outname]) + return y def __image_feature(self, camera_image): x_batch = np.ndarray((self.batchsize, 3, self.in_size, self.in_size), dtype=np.float32) @@ -62,7 +63,7 @@ def __image_feature(self, camera_image): if self.gpu >= 0: x_data = cuda.to_gpu(x_data) - x = chainer.Variable(x_data, volatile=True) + x = chainer.Variable(x_data) feature = self.predict(x) if self.gpu >= 0: diff --git a/agent/ml/experience.py b/agent/ml/experience.py index 162ebfc..a1239b6 100644 --- a/agent/ml/experience.py +++ b/agent/ml/experience.py @@ -2,6 +2,7 @@ import numpy as np from chainer import cuda +from builtins import range class Experience: @@ -50,7 +51,7 @@ def replay(self, time): r_replay = np.ndarray(shape=(self.replay_size, 1), dtype=np.float32) s_dash_replay = np.ndarray(shape=(self.replay_size, self.hist_size, self.dim), dtype=np.float32) episode_end_replay = np.ndarray(shape=(self.replay_size, 1), dtype=np.bool) - for i in xrange(self.replay_size): + for i in range(self.replay_size): s_replay[i] = np.asarray(self.d[0][replay_index[i]], dtype=np.float32) a_replay[i] = self.d[1][replay_index[i]] r_replay[i] = self.d[2][replay_index[i]] diff --git a/agent/ml/q_net.py b/agent/ml/q_net.py index c358523..4aa96dd 100644 --- a/agent/ml/q_net.py +++ b/agent/ml/q_net.py @@ -2,8 +2,11 @@ import copy import numpy as np -from chainer import cuda, FunctionSet, Variable, optimizers +from chainer import cuda, Chain, Variable, optimizers import chainer.functions as F +from chainer import links as L +from chainer import initializers as I +from builtins import range from config.log import APP_KEY import logging @@ -32,9 +35,9 @@ def __init__(self, use_gpu, enable_controller, dim, epsilon, epsilon_delta, min_ app_logger.info("Initializing Q-Network...") hidden_dim = 256 - self.model = FunctionSet( - l4=F.Linear(self.dim*self.hist_size, hidden_dim, wscale=np.sqrt(2)), - q_value=F.Linear(hidden_dim, self.num_of_actions, + self.model = Chain( + l4=L.Linear(self.dim*self.hist_size, hidden_dim, initialW=I.HeNormal()), + q_value=L.Linear(hidden_dim, self.num_of_actions, initialW=np.zeros((self.num_of_actions, hidden_dim), dtype=np.float32)) ) @@ -44,7 +47,7 @@ def __init__(self, use_gpu, enable_controller, dim, epsilon, epsilon_delta, min_ self.model_target = copy.deepcopy(self.model) self.optimizer = optimizers.RMSpropGraves(lr=0.00025, alpha=0.95, momentum=0.95, eps=0.0001) - self.optimizer.setup(self.model.collect_parameters()) + self.optimizer.setup(self.model) # History Data : D=[s, a, r, s_dash, end_episode_flag] self.d = [np.zeros((self.data_size, self.hist_size, self.dim), dtype=np.uint8), @@ -74,7 +77,7 @@ def forward(self, state, action, reward, state_dash, episode_end): # make new array target = np.array(q.data, dtype=np.float32) - for i in xrange(num_of_batch): + for i in range(num_of_batch): if not episode_end[i][0]: tmp_ = reward[i] + self.gamma * max_q_dash[i] else: @@ -148,7 +151,7 @@ def start(self, feature): def update_model(self, replayed_experience): if replayed_experience[0]: - self.optimizer.zero_grads() + self.optimizer.target.cleargrads() loss, _ = self.forward(replayed_experience[1], replayed_experience[2], replayed_experience[3], replayed_experience[4], replayed_experience[5]) loss.backward() diff --git a/agent/requirements.txt b/agent/requirements.txt index a5b0956..612d4ca 100644 --- a/agent/requirements.txt +++ b/agent/requirements.txt @@ -1,4 +1,4 @@ -chainer==1.14 +chainer==2.1.0 ws4py cherrypy msgpack-python diff --git a/agent/server.py b/agent/server.py index 1d2ddec..a79a90b 100644 --- a/agent/server.py +++ b/agent/server.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import argparse -import cPickle as pickle +import six.moves.cPickle as pickle import io import os @@ -10,6 +10,7 @@ import numpy as np from PIL import Image from PIL import ImageOps +from builtins import range from cognitive import interpreter from ml.cnn_feature_extractor import CnnFeatureExtractor @@ -34,29 +35,29 @@ def unpack(payload, depth_image_count=1, depth_image_dim=32*32): dat = msgpack.unpackb(payload) image = [] - for i in xrange(depth_image_count): - image.append(Image.open(io.BytesIO(bytearray(dat['image'][i])))) + for i in range(depth_image_count): + image.append(Image.open(io.BytesIO(bytearray(dat[b'image'][i])))) depth = [] - for i in xrange(depth_image_count): - d = (Image.open(io.BytesIO(bytearray(dat['depth'][i])))) + for i in range(depth_image_count): + d = (Image.open(io.BytesIO(bytearray(dat[b'depth'][i])))) depth.append(np.array(ImageOps.grayscale(d)).reshape(depth_image_dim)) - reward = dat['reward'] + reward = dat[b'reward'] observation = {"image": image, "depth": depth} - rotation = dat['rotation'] - movement = dat['movement'] + rotation = dat[b'rotation'] + movement = dat[b'movement'] return reward, observation, rotation, movement def unpack_reset(payload): dat = msgpack.unpackb(payload) - reward = dat['reward'] - success = dat['success'] - failure = dat['failure'] - elapsed = dat['elapsed'] - finished = dat['finished'] + reward = dat[b'reward'] + success = dat[b'success'] + failure = dat[b'failure'] + elapsed = dat[b'elapsed'] + finished = dat[b'finished'] return reward, success, failure, elapsed, finished @@ -72,11 +73,11 @@ class Root(object): def __init__(self, **kwargs): if os.path.exists(CNN_FEATURE_EXTRACTOR): app_logger.info("loading... {}".format(CNN_FEATURE_EXTRACTOR)) - self.feature_extractor = pickle.load(open(CNN_FEATURE_EXTRACTOR)) + self.feature_extractor = pickle.load(open(CNN_FEATURE_EXTRACTOR, 'rb')) app_logger.info("done") else: self.feature_extractor = CnnFeatureExtractor(use_gpu, CAFFE_MODEL, MODEL_TYPE, image_feature_dim) - pickle.dump(self.feature_extractor, open(CNN_FEATURE_EXTRACTOR, 'w')) + pickle.dump(self.feature_extractor, open(CNN_FEATURE_EXTRACTOR, 'wb')) app_logger.info("pickle.dump finished") self.agent_service = AgentService(BRICA_CONFIG_FILE, self.feature_extractor) From f6ae3c152daf584dfbe96b37b32088f799560b66 Mon Sep 17 00:00:00 2001 From: ktnyt Date: Thu, 2 Nov 2017 14:34:31 +0900 Subject: [PATCH 02/15] Add feature to count success/failure of recent 100 trials --- environment/Assets/Scripts/Environment.cs | 26 ++++++----- environment/Assets/Scripts/Trials.cs | 57 +++++++++++++++++++++++ environment/Assets/Scripts/Trials.cs.meta | 12 +++++ 3 files changed, 83 insertions(+), 12 deletions(-) create mode 100644 environment/Assets/Scripts/Trials.cs create mode 100644 environment/Assets/Scripts/Trials.cs.meta diff --git a/environment/Assets/Scripts/Environment.cs b/environment/Assets/Scripts/Environment.cs index 91442b3..b8f1c1d 100755 --- a/environment/Assets/Scripts/Environment.cs +++ b/environment/Assets/Scripts/Environment.cs @@ -1,6 +1,7 @@ using UnityEngine; using UnityEngine.UI; using UnityEditor.SceneManagement; +using System.Collections.Generic; [RequireComponent(typeof (Task))] public class Environment : MonoBehaviour { @@ -18,9 +19,6 @@ public class Environment : MonoBehaviour { Task task; - int successCount; - int failureCount; - int elapsed = 0; void Start() { @@ -30,20 +28,18 @@ void Start() { if(!PlayerPrefs.HasKey("Task Name")) { PlayerPrefs.SetString("Task Name", task.Name()); - PlayerPrefs.SetInt("Success Count", 0); - PlayerPrefs.SetInt("Failure Count", 0); + Trials.Reset(); } if(PlayerPrefs.GetString("Task Name") != task.Name()) { PlayerPrefs.SetString("Task Name", task.Name()); - PlayerPrefs.SetInt("Success Count", 0); - PlayerPrefs.SetInt("Failure Count", 0); + Trials.Reset(); } PlayerPrefs.SetInt("Elapsed Time", elapsed); - successCount = PlayerPrefs.GetInt("Success Count"); - failureCount = PlayerPrefs.GetInt("Failure Count"); + int successCount = Trials.GetSuccess(); + int failureCount = Trials.GetFailure(); task.Initialize(successCount, failureCount); @@ -59,7 +55,7 @@ void Update() { if(task.Success()) { task.Reset(); - if(task.Done(successCount, failureCount)) { + if(task.Done(Trials.GetSuccess(), Trials.GetFailure())) { task.Finish(); PlayerPrefs.SetInt("Success Count", 0); @@ -68,7 +64,10 @@ void Update() { return; } - PlayerPrefs.SetInt("Success Count", successCount + 1); + Trials.AddSuccess(); + + PlayerPrefs.SetInt("Success Count", Trials.GetSuccess()); + PlayerPrefs.SetInt("Failure Count", Trials.GetFailure()); EditorSceneManager.LoadScene(EditorSceneManager.GetActiveScene().name); return; } @@ -76,7 +75,10 @@ void Update() { if(task.Failure()) { task.Reset(); - PlayerPrefs.SetInt("Failure Count", failureCount + 1); + Trials.AddFailure(); + + PlayerPrefs.SetInt("Success Count", Trials.GetSuccess()); + PlayerPrefs.SetInt("Failure Count", Trials.GetFailure()); EditorSceneManager.LoadScene(EditorSceneManager.GetActiveScene().name); return; } diff --git a/environment/Assets/Scripts/Trials.cs b/environment/Assets/Scripts/Trials.cs new file mode 100644 index 0000000..e49ad4a --- /dev/null +++ b/environment/Assets/Scripts/Trials.cs @@ -0,0 +1,57 @@ +using UnityEngine; + +public class Trials { + public static void Reset() { + Debug.Log("Reset trials"); + } + + public static void AddSuccess() { + string trials = PlayerPrefs.GetString("Trials"); + + trials += "S"; + + while(trials.Length > 100) { + trials = trials.Substring(1); + } + + PlayerPrefs.SetString("Trials", trials); + } + + public static void AddFailure() { + string trials = PlayerPrefs.GetString("Trials"); + + trials += "F"; + + while(trials.Length > 100) { + trials = trials.Substring(1); + } + + PlayerPrefs.SetString("Trials", trials); + } + + public static int GetSuccess() { + int count = 0; + string trials = PlayerPrefs.GetString("Trials"); + + foreach(char trial in trials) { + if(trial == 'S') { + count += 1; + } + } + + return count; + } + + public static int GetFailure() { + int count = 0; + string trials = PlayerPrefs.GetString("Trials"); + + foreach(char trial in trials) { + if(trial == 'F') { + count += 1; + } + } + + return count; + } +} diff --git a/environment/Assets/Scripts/Trials.cs.meta b/environment/Assets/Scripts/Trials.cs.meta new file mode 100644 index 0000000..ccaacd6 --- /dev/null +++ b/environment/Assets/Scripts/Trials.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3ed1e98bdd8c74d11862103ec0092b56 +timeCreated: 1509599387 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From de54837390ed94aace46803c2aa0f07d62993ca9 Mon Sep 17 00:00:00 2001 From: ktnyt Date: Thu, 2 Nov 2017 15:08:25 +0900 Subject: [PATCH 03/15] Fix bug in reset code --- environment/Assets/Scripts/Trials.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment/Assets/Scripts/Trials.cs b/environment/Assets/Scripts/Trials.cs index e49ad4a..2152d54 100644 --- a/environment/Assets/Scripts/Trials.cs +++ b/environment/Assets/Scripts/Trials.cs @@ -2,7 +2,7 @@ public class Trials { public static void Reset() { - Debug.Log("Reset trials"); + PlayerPrefs.SetString("Trials", ""); } public static void AddSuccess() { From e3981cad4ad2587e72e342c4854ad4fe349c33dc Mon Sep 17 00:00:00 2001 From: ktnyt Date: Thu, 2 Nov 2017 15:10:53 +0900 Subject: [PATCH 04/15] Fix code to discount reward value over time --- environment/Assets/Scripts/CrossMazeTask1.cs | 110 +++++++++++-------- 1 file changed, 63 insertions(+), 47 deletions(-) diff --git a/environment/Assets/Scripts/CrossMazeTask1.cs b/environment/Assets/Scripts/CrossMazeTask1.cs index d7acc9d..7f39b88 100644 --- a/environment/Assets/Scripts/CrossMazeTask1.cs +++ b/environment/Assets/Scripts/CrossMazeTask1.cs @@ -1,55 +1,71 @@ using UnityEngine; public class CrossMazeTask1 : Task { - public override string Name() { return "Cross Maze Task 1"; } + float rewardValue = 2.0F; - public override void Initialize(int success, int failure) { - // 仕様「S地点は3ヶ所あり、ランダムにスタート地点が決定する」を実現する + public override string Name() { return "Cross Maze Task 1"; } - int phase = (int)(Random.value * 3); - float x = 0.0f; - float y = 1.12f; - float z = 0.5f; + public override void Initialize(int success, int failure) { + // 仕様「S地点は3ヶ所あり、ランダムにスタート地点が決定する」を実現する - float rx = 0.0f; - float ry = 0.0f; - float rz = 0.0f; - Quaternion rotation = Quaternion.identity; + int phase = (int)(Random.value * 3); + float x = 0.0f; + float y = 1.12f; + float z = 0.5f; + + float rx = 0.0f; + float ry = 0.0f; + float rz = 0.0f; + Quaternion rotation = Quaternion.identity; - switch(phase) { - case 0: - // 南端からスタート {0, 0, 0} - break; - case 1: - // 東端からスタート {0, 0, 0} - x = 12.0f; - z = 12.5f; - ry = -90.0f; - break; - case 2: - // 西端からスタート {0, 0, 0} - x = -12.0f; - z = 12.5f; - ry = 90.0f; - break; - default: - break; - } - - agent.transform.position = new Vector3(x, y, z); - rotation.eulerAngles = new Vector3 (rx, ry, rz); - agent.transform.rotation = rotation; - } - - public override bool Success() { - return rewardCount > 0; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } + switch(phase) { + case 0: + // 南端からスタート {0, 0, 0} + break; + case 1: + // 東端からスタート {0, 0, 0} + x = 12.0f; + z = 12.5f; + ry = -90.0f; + break; + case 2: + // 西端からスタート {0, 0, 0} + x = -12.0f; + z = 12.5f; + ry = 90.0f; + break; + default: + break; + } + + agent.transform.position = new Vector3(x, y, z); + rotation.eulerAngles = new Vector3 (rx, ry, rz); + agent.transform.rotation = rotation; + } + + public override bool Success() { + return rewardCount > 0; + } + + public override bool Failure() { + return Reward.Get() < -1.8F; + } + + public override bool Done(int success, int failure) { + return (success - failure) > 21; + } + + protected override void OnRewardCollision() { + rewardCount += 1; + Debug.Log(rewardValue); + Reward.Add(rewardValue); + } + + void FixedUpdate() { + Punishment(); + rewardValue -= 0.002F; + if(rewardValue < 0.0F) { + rewardValue = 0.0F; + } + } } From 651c55fbd6349e3b4712f3c5a0476d7fe2baef59 Mon Sep 17 00:00:00 2001 From: ktnyt Date: Wed, 8 Nov 2017 17:29:47 +0900 Subject: [PATCH 05/15] Add common base task classes --- environment/Assets/Scripts/ArrowMazeTask1.cs | 17 ++--------------- environment/Assets/Scripts/ArrowMazeTask2.cs | 17 ++--------------- environment/Assets/Scripts/ArrowMazeTask3.cs | 17 ++--------------- environment/Assets/Scripts/ArrowMazeTaskBase.cs | 13 +++++++++++++ .../Assets/Scripts/ArrowMazeTaskBase.cs.meta | 12 ++++++++++++ environment/Assets/Scripts/CrossMazeTask1.cs | 16 +--------------- environment/Assets/Scripts/CrossMazeTask2.cs | 10 +--------- environment/Assets/Scripts/CrossMazeTaskBase.cs | 13 +++++++++++++ .../Assets/Scripts/CrossMazeTaskBase.cs.meta | 12 ++++++++++++ environment/Assets/Scripts/OneDimTask1.cs | 14 +------------- environment/Assets/Scripts/OneDimTask2.cs | 14 +------------- environment/Assets/Scripts/OneDimTask3.cs | 14 +------------- environment/Assets/Scripts/OneDimTask4.cs | 14 +------------- environment/Assets/Scripts/OneDimTask5.cs | 14 +------------- environment/Assets/Scripts/OneDimTask6.cs | 14 +------------- environment/Assets/Scripts/OneDimTask7.cs | 14 +------------- environment/Assets/Scripts/OneDimTask8a.cs | 14 +------------- environment/Assets/Scripts/OneDimTask8b.cs | 14 +------------- environment/Assets/Scripts/OneDimTask8c.cs | 14 +------------- environment/Assets/Scripts/OneDimTask8d.cs | 14 +------------- environment/Assets/Scripts/OneDimTaskBase.cs | 13 +++++++++++++ .../Assets/Scripts/OneDimTaskBase.cs.meta | 12 ++++++++++++ 22 files changed, 94 insertions(+), 212 deletions(-) create mode 100644 environment/Assets/Scripts/ArrowMazeTaskBase.cs create mode 100644 environment/Assets/Scripts/ArrowMazeTaskBase.cs.meta create mode 100644 environment/Assets/Scripts/CrossMazeTaskBase.cs create mode 100644 environment/Assets/Scripts/CrossMazeTaskBase.cs.meta create mode 100644 environment/Assets/Scripts/OneDimTaskBase.cs create mode 100644 environment/Assets/Scripts/OneDimTaskBase.cs.meta diff --git a/environment/Assets/Scripts/ArrowMazeTask1.cs b/environment/Assets/Scripts/ArrowMazeTask1.cs index 6c08b75..de86a58 100644 --- a/environment/Assets/Scripts/ArrowMazeTask1.cs +++ b/environment/Assets/Scripts/ArrowMazeTask1.cs @@ -1,25 +1,12 @@ using UnityEngine; -public class ArrowMazeTask1 : Task { +public class ArrowMazeTask1 : ArrowMazeTaskBase { int waitedTime = 0; bool waited = false; public override string Name() { return "Arrow Maze Task 1"; } - public override void Initialize(int success, int failure) { - } - - public override bool Success() { - return rewardCount > 0; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } + public override void Initialize(int success, int failure) {} void Update() { float x = agent.transform.position.x; diff --git a/environment/Assets/Scripts/ArrowMazeTask2.cs b/environment/Assets/Scripts/ArrowMazeTask2.cs index 45afbc7..75d2bc4 100644 --- a/environment/Assets/Scripts/ArrowMazeTask2.cs +++ b/environment/Assets/Scripts/ArrowMazeTask2.cs @@ -1,25 +1,12 @@ using UnityEngine; -public class ArrowMazeTask2 : Task { +public class ArrowMazeTask2 : ArroMazeTaskBase { int waitedTime = 0; bool waited = false; public override string Name() { return "Arrow Maze Task 2"; } - public override void Initialize(int success, int failure) { - } - - public override bool Success() { - return rewardCount > 0; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } + public override void Initialize(int success, int failure) {} void Update() { float x = agent.transform.position.x; diff --git a/environment/Assets/Scripts/ArrowMazeTask3.cs b/environment/Assets/Scripts/ArrowMazeTask3.cs index 8c8440b..fb6c577 100644 --- a/environment/Assets/Scripts/ArrowMazeTask3.cs +++ b/environment/Assets/Scripts/ArrowMazeTask3.cs @@ -1,25 +1,12 @@ using UnityEngine; -public class ArrowMazeTask3 : Task { +public class ArrowMazeTask3 : ArrowMazeTaskBase { int waitedTime = 0; bool waited = false; public override string Name() { return "Arrow Maze Task 3"; } - public override void Initialize(int success, int failure) { - } - - public override bool Success() { - return rewardCount > 0; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } + public override void Initialize(int success, int failure) {} void Update() { float x = agent.transform.position.x; diff --git a/environment/Assets/Scripts/ArrowMazeTaskBase.cs b/environment/Assets/Scripts/ArrowMazeTaskBase.cs new file mode 100644 index 0000000..72b7b8c --- /dev/null +++ b/environment/Assets/Scripts/ArrowMazeTaskBase.cs @@ -0,0 +1,13 @@ +public class ArrowMazeTaskBase : Task { + public override bool Success() { + return rewardCount > 0; + } + + public override bool Failure() { + return Reward.Get() < -1.8F; + } + + public override bool Done(int success, int failure) { + return (success - failure) > 21; + } +} diff --git a/environment/Assets/Scripts/ArrowMazeTaskBase.cs.meta b/environment/Assets/Scripts/ArrowMazeTaskBase.cs.meta new file mode 100644 index 0000000..c060553 --- /dev/null +++ b/environment/Assets/Scripts/ArrowMazeTaskBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 576af4e36df924ffcb0b21848111add1 +timeCreated: 1510125734 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/environment/Assets/Scripts/CrossMazeTask1.cs b/environment/Assets/Scripts/CrossMazeTask1.cs index 7f39b88..eeeb2af 100644 --- a/environment/Assets/Scripts/CrossMazeTask1.cs +++ b/environment/Assets/Scripts/CrossMazeTask1.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class CrossMazeTask1 : Task { +public class CrossMazeTask1 : CrossMazeTaskBase { float rewardValue = 2.0F; public override string Name() { return "Cross Maze Task 1"; } @@ -47,20 +47,6 @@ public override bool Success() { return rewardCount > 0; } - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - - protected override void OnRewardCollision() { - rewardCount += 1; - Debug.Log(rewardValue); - Reward.Add(rewardValue); - } - void FixedUpdate() { Punishment(); rewardValue -= 0.002F; diff --git a/environment/Assets/Scripts/CrossMazeTask2.cs b/environment/Assets/Scripts/CrossMazeTask2.cs index 06f0adf..2b09931 100644 --- a/environment/Assets/Scripts/CrossMazeTask2.cs +++ b/environment/Assets/Scripts/CrossMazeTask2.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class CrossMazeTask2 : Task { +public class CrossMazeTask2 : CrossMazeTaskBase { public override string Name() { return "Cross Maze Task 2"; } public override void Initialize(int success, int failure) { @@ -40,12 +40,4 @@ public override void Initialize(int success, int failure) { public override bool Success() { return rewardCount > 2; } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } } diff --git a/environment/Assets/Scripts/CrossMazeTaskBase.cs b/environment/Assets/Scripts/CrossMazeTaskBase.cs new file mode 100644 index 0000000..6ab9e7b --- /dev/null +++ b/environment/Assets/Scripts/CrossMazeTaskBase.cs @@ -0,0 +1,13 @@ +public abstract class CrossMazeTaskBase : Task { + public override bool Success() { + return rewardCount > 0; + } + + public override bool Failure() { + return Reward.Get() < -1.8F; + } + + public override bool Done(int success, int failure) { + return (success - failure) > 21; + } +} diff --git a/environment/Assets/Scripts/CrossMazeTaskBase.cs.meta b/environment/Assets/Scripts/CrossMazeTaskBase.cs.meta new file mode 100644 index 0000000..fecf24b --- /dev/null +++ b/environment/Assets/Scripts/CrossMazeTaskBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ccfe39bcf304e40e0a9ab557213c5806 +timeCreated: 1510125415 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/environment/Assets/Scripts/OneDimTask1.cs b/environment/Assets/Scripts/OneDimTask1.cs index 4617c11..3c8ebca 100755 --- a/environment/Assets/Scripts/OneDimTask1.cs +++ b/environment/Assets/Scripts/OneDimTask1.cs @@ -1,22 +1,10 @@ using UnityEngine; -public class OneDimTask1 : Task { +public class OneDimTask1 : OneDimTaskBase { public override string Name() { return "One Dimensional Task 1"; } public override void Initialize(int success, int failure) { float z = (float)(22 - (success - failure)); agent.transform.position = new Vector3(0.0F, 1.12F, z); } - - public override bool Success() { - return rewardCount > 0; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } } diff --git a/environment/Assets/Scripts/OneDimTask2.cs b/environment/Assets/Scripts/OneDimTask2.cs index 9c6f66c..fa0cc5b 100755 --- a/environment/Assets/Scripts/OneDimTask2.cs +++ b/environment/Assets/Scripts/OneDimTask2.cs @@ -1,24 +1,12 @@ using UnityEngine; -public class OneDimTask2 : Task { +public class OneDimTask2 : OneDimTaskBase { public GameObject reward; bool rewardShown = false; public override string Name() { return "One Dimensional Task 2"; } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTask3.cs b/environment/Assets/Scripts/OneDimTask3.cs index 53d67f7..b3fd7e6 100755 --- a/environment/Assets/Scripts/OneDimTask3.cs +++ b/environment/Assets/Scripts/OneDimTask3.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class OneDimTask3 : Task { +public class OneDimTask3 : OneDimTaskBase { public GameObject reward; bool rewardShown = false; @@ -10,18 +10,6 @@ public class OneDimTask3 : Task { public override string Name() { return "One Dimensional Task 3"; } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTask4.cs b/environment/Assets/Scripts/OneDimTask4.cs index c2ecb39..5f27ae6 100755 --- a/environment/Assets/Scripts/OneDimTask4.cs +++ b/environment/Assets/Scripts/OneDimTask4.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class OneDimTask4 : Task { +public class OneDimTask4 : OneDimTaskBase { public GameObject reward; bool rewardShown = false; @@ -10,18 +10,6 @@ public class OneDimTask4 : Task { public override string Name() { return "One Dimensional Task 4"; } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTask5.cs b/environment/Assets/Scripts/OneDimTask5.cs index 47c7ee7..3936f07 100755 --- a/environment/Assets/Scripts/OneDimTask5.cs +++ b/environment/Assets/Scripts/OneDimTask5.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class OneDimTask5 : Task { +public class OneDimTask5 : OneDimTaskBase { public GameObject reward; bool rewardShown = false; @@ -10,18 +10,6 @@ public class OneDimTask5 : Task { public override string Name() { return "One Dimensional Task 5"; } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTask6.cs b/environment/Assets/Scripts/OneDimTask6.cs index 421d837..6e009da 100755 --- a/environment/Assets/Scripts/OneDimTask6.cs +++ b/environment/Assets/Scripts/OneDimTask6.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class OneDimTask6 : Task { +public class OneDimTask6 : OneDimTaskBase { public GameObject reward; bool rewardShown = false; @@ -26,18 +26,6 @@ public override void Initialize(int success, int failure) { } } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTask7.cs b/environment/Assets/Scripts/OneDimTask7.cs index 976c100..79a8332 100755 --- a/environment/Assets/Scripts/OneDimTask7.cs +++ b/environment/Assets/Scripts/OneDimTask7.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class OneDimTask7 : Task { +public class OneDimTask7 : OneDimTaskBase { public GameObject reward; public ShapeSelector selector; @@ -32,18 +32,6 @@ public override void Initialize(int success, int failure) { } } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTask8a.cs b/environment/Assets/Scripts/OneDimTask8a.cs index 9ee8949..963f84e 100755 --- a/environment/Assets/Scripts/OneDimTask8a.cs +++ b/environment/Assets/Scripts/OneDimTask8a.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class OneDimTask8a : Task { +public class OneDimTask8a : OneDimTaskBase { public GameObject reward; bool rewardShown = false; @@ -10,18 +10,6 @@ public class OneDimTask8a : Task { public override string Name() { return "One Dimensional Task 8-a"; } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTask8b.cs b/environment/Assets/Scripts/OneDimTask8b.cs index ab768fd..b1185a3 100755 --- a/environment/Assets/Scripts/OneDimTask8b.cs +++ b/environment/Assets/Scripts/OneDimTask8b.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class OneDimTask8b : Task { +public class OneDimTask8b : OneDimTaskBase { public GameObject reward; bool rewardShown = false; @@ -10,18 +10,6 @@ public class OneDimTask8b : Task { public override string Name() { return "One Dimensional Task 8-b"; } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTask8c.cs b/environment/Assets/Scripts/OneDimTask8c.cs index 83756e6..1d0a237 100755 --- a/environment/Assets/Scripts/OneDimTask8c.cs +++ b/environment/Assets/Scripts/OneDimTask8c.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class OneDimTask8c : Task { +public class OneDimTask8c : OneDimTaskBase { public GameObject reward; bool rewardShown = false; @@ -26,18 +26,6 @@ public override void Initialize(int success, int failure) { } } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTask8d.cs b/environment/Assets/Scripts/OneDimTask8d.cs index d4c2615..ac0546d 100755 --- a/environment/Assets/Scripts/OneDimTask8d.cs +++ b/environment/Assets/Scripts/OneDimTask8d.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class OneDimTask8d : Task { +public class OneDimTask8d : OneDimTaskBase { public GameObject reward; public ShapeSelector selector; @@ -32,18 +32,6 @@ public override void Initialize(int success, int failure) { } } - public override bool Success() { - return rewardCount > 1; - } - - public override bool Failure() { - return Reward.Get() < -1.8F; - } - - public override bool Done(int success, int failure) { - return (success - failure) > 21; - } - void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTaskBase.cs b/environment/Assets/Scripts/OneDimTaskBase.cs new file mode 100644 index 0000000..c1720b0 --- /dev/null +++ b/environment/Assets/Scripts/OneDimTaskBase.cs @@ -0,0 +1,13 @@ +public abstract class OneDimTaskBase : Task { + public override bool Success() { + return rewardCount > 0; + } + + public override bool Failure() { + return Reward.Get() < -1.8F; + } + + public override bool Done(int success, int failure) { + return (success - failure) > 21; + } +} diff --git a/environment/Assets/Scripts/OneDimTaskBase.cs.meta b/environment/Assets/Scripts/OneDimTaskBase.cs.meta new file mode 100644 index 0000000..20c1073 --- /dev/null +++ b/environment/Assets/Scripts/OneDimTaskBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c830cab99b6484680856103da232e630 +timeCreated: 1510124869 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 5e109841baa9d44d5309bf0c2421692fad4b6fd2 Mon Sep 17 00:00:00 2001 From: ktnyt Date: Thu, 9 Nov 2017 13:04:10 +0900 Subject: [PATCH 06/15] Fix naming errors and success functions --- environment/Assets/Scripts/ArrowMazeTask2.cs | 2 +- environment/Assets/Scripts/ArrowMazeTaskBase.cs | 2 +- environment/Assets/Scripts/OneDimTask1.cs | 4 ++++ environment/Assets/Scripts/OneDimTask2.cs | 4 ++++ environment/Assets/Scripts/OneDimTaskBase.cs | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/environment/Assets/Scripts/ArrowMazeTask2.cs b/environment/Assets/Scripts/ArrowMazeTask2.cs index 75d2bc4..a3bb06a 100644 --- a/environment/Assets/Scripts/ArrowMazeTask2.cs +++ b/environment/Assets/Scripts/ArrowMazeTask2.cs @@ -1,6 +1,6 @@ using UnityEngine; -public class ArrowMazeTask2 : ArroMazeTaskBase { +public class ArrowMazeTask2 : ArrowMazeTaskBase { int waitedTime = 0; bool waited = false; diff --git a/environment/Assets/Scripts/ArrowMazeTaskBase.cs b/environment/Assets/Scripts/ArrowMazeTaskBase.cs index 72b7b8c..c7ee347 100644 --- a/environment/Assets/Scripts/ArrowMazeTaskBase.cs +++ b/environment/Assets/Scripts/ArrowMazeTaskBase.cs @@ -1,4 +1,4 @@ -public class ArrowMazeTaskBase : Task { +public abstract class ArrowMazeTaskBase : Task { public override bool Success() { return rewardCount > 0; } diff --git a/environment/Assets/Scripts/OneDimTask1.cs b/environment/Assets/Scripts/OneDimTask1.cs index 3c8ebca..da55ab9 100755 --- a/environment/Assets/Scripts/OneDimTask1.cs +++ b/environment/Assets/Scripts/OneDimTask1.cs @@ -7,4 +7,8 @@ public override void Initialize(int success, int failure) { float z = (float)(22 - (success - failure)); agent.transform.position = new Vector3(0.0F, 1.12F, z); } + + public override bool Success() { + return rewardCount > 0; + } } diff --git a/environment/Assets/Scripts/OneDimTask2.cs b/environment/Assets/Scripts/OneDimTask2.cs index fa0cc5b..ef002cb 100755 --- a/environment/Assets/Scripts/OneDimTask2.cs +++ b/environment/Assets/Scripts/OneDimTask2.cs @@ -7,6 +7,10 @@ public class OneDimTask2 : OneDimTaskBase { public override string Name() { return "One Dimensional Task 2"; } + public override bool Success() { + return rewardCount > 1; + } + void Update() { float z = agent.transform.position.z; diff --git a/environment/Assets/Scripts/OneDimTaskBase.cs b/environment/Assets/Scripts/OneDimTaskBase.cs index c1720b0..1236869 100644 --- a/environment/Assets/Scripts/OneDimTaskBase.cs +++ b/environment/Assets/Scripts/OneDimTaskBase.cs @@ -1,6 +1,6 @@ public abstract class OneDimTaskBase : Task { public override bool Success() { - return rewardCount > 0; + return rewardCount > 1; } public override bool Failure() { From 80fc10e23efa7e3eba4450291b1555179e2002f1 Mon Sep 17 00:00:00 2001 From: ktnyt Date: Thu, 9 Nov 2017 17:13:24 +0900 Subject: [PATCH 07/15] Remove excess code --- environment/Assets/Scripts/OneDimTask2.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/environment/Assets/Scripts/OneDimTask2.cs b/environment/Assets/Scripts/OneDimTask2.cs index ef002cb..fa0cc5b 100755 --- a/environment/Assets/Scripts/OneDimTask2.cs +++ b/environment/Assets/Scripts/OneDimTask2.cs @@ -7,10 +7,6 @@ public class OneDimTask2 : OneDimTaskBase { public override string Name() { return "One Dimensional Task 2"; } - public override bool Success() { - return rewardCount > 1; - } - void Update() { float z = agent.transform.position.z; From c64bc0fde43f5a3fab74208666e8ca7536138c1f Mon Sep 17 00:00:00 2001 From: ktnyt Date: Fri, 10 Nov 2017 14:12:08 +0900 Subject: [PATCH 08/15] Add interface for automated running --- environment/Assets/Scripts/AgentBehaviour.cs | 6 +++++ environment/Assets/Scripts/Automator.cs | 24 ++++++++++++++++++++ environment/Assets/Scripts/Automator.cs.meta | 12 ++++++++++ environment/Assets/Scripts/Environment.cs | 12 ++++++++++ environment/Assets/Scripts/OneDimTask1.cs | 5 ++++ environment/Assets/Scripts/OneDimTask2.cs | 5 ++++ environment/Assets/Scripts/OneDimTask3.cs | 13 ++++++++++- environment/Assets/Scripts/Startup.cs | 12 ++++++---- environment/Assets/Scripts/Task.cs | 4 ++++ 9 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 environment/Assets/Scripts/Automator.cs create mode 100644 environment/Assets/Scripts/Automator.cs.meta diff --git a/environment/Assets/Scripts/AgentBehaviour.cs b/environment/Assets/Scripts/AgentBehaviour.cs index 107bd47..bd633e9 100755 --- a/environment/Assets/Scripts/AgentBehaviour.cs +++ b/environment/Assets/Scripts/AgentBehaviour.cs @@ -71,6 +71,12 @@ void Start () { } void LateUpdate () { + if(Automator.Enabled()) { + string action = Automator.Step(); + controller.PerformAction(action); + return; + } + if(!created) { if(!client.Calling) { client.Create(GenerateMessage()); diff --git a/environment/Assets/Scripts/Automator.cs b/environment/Assets/Scripts/Automator.cs new file mode 100644 index 0000000..2ca185f --- /dev/null +++ b/environment/Assets/Scripts/Automator.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +public class Automator : MonoBehaviour { + public static void Setup(string sequence) { + PlayerPrefs.SetString("Automation Sequence", sequence); + } + + public static string Step() { + string sequence = PlayerPrefs.GetString("Automation Sequence"); + + if(sequence.Length > 0) { + string head = sequence.Substring(0, 1); + string tail = sequence.Substring(1); + PlayerPrefs.SetString("Automation Sequence", tail); + return head; + } + + return ""; + } + + public static bool Enabled() { + return PlayerPrefs.GetInt("Autorun") != 0; + } +} diff --git a/environment/Assets/Scripts/Automator.cs.meta b/environment/Assets/Scripts/Automator.cs.meta new file mode 100644 index 0000000..d97905d --- /dev/null +++ b/environment/Assets/Scripts/Automator.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a23b5964bad564b79841b785061f663c +timeCreated: 1510288428 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/environment/Assets/Scripts/Environment.cs b/environment/Assets/Scripts/Environment.cs index b8f1c1d..7d54a95 100755 --- a/environment/Assets/Scripts/Environment.cs +++ b/environment/Assets/Scripts/Environment.cs @@ -24,6 +24,10 @@ public class Environment : MonoBehaviour { void Start() { task = GetComponent(); + if(Automator.Enabled()) { + Automator.Setup(task.AutomationSequence()); + } + Reward.Set(0.0F); if(!PlayerPrefs.HasKey("Task Name")) { @@ -43,6 +47,10 @@ void Start() { task.Initialize(successCount, failureCount); + if(Automator.Enabled()) { + Automator.Setup(task.AutomationSequence()); + } + taskText.text = PlayerPrefs.GetString("Task Name"); successText.text = "Success: " + successCount; failureText.text = "Failure: " + failureCount; @@ -73,6 +81,10 @@ void Update() { } if(task.Failure()) { + if(Automator.Enabled()) { + Debug.LogError("You have enabled autorun but task has failed: check your automation sequence for task '" + PlayerPrefs.GetString("Task Name") + "'"); + } + task.Reset(); Trials.AddFailure(); diff --git a/environment/Assets/Scripts/OneDimTask1.cs b/environment/Assets/Scripts/OneDimTask1.cs index da55ab9..742ecea 100755 --- a/environment/Assets/Scripts/OneDimTask1.cs +++ b/environment/Assets/Scripts/OneDimTask1.cs @@ -1,6 +1,11 @@ using UnityEngine; +using System; public class OneDimTask1 : OneDimTaskBase { + public override string AutomationSequence() { + return new String('2', 11); + } + public override string Name() { return "One Dimensional Task 1"; } public override void Initialize(int success, int failure) { diff --git a/environment/Assets/Scripts/OneDimTask2.cs b/environment/Assets/Scripts/OneDimTask2.cs index fa0cc5b..e71f779 100755 --- a/environment/Assets/Scripts/OneDimTask2.cs +++ b/environment/Assets/Scripts/OneDimTask2.cs @@ -1,10 +1,15 @@ using UnityEngine; +using System; public class OneDimTask2 : OneDimTaskBase { public GameObject reward; bool rewardShown = false; + public override string AutomationSequence() { + return new String('2', 11); + } + public override string Name() { return "One Dimensional Task 2"; } void Update() { diff --git a/environment/Assets/Scripts/OneDimTask3.cs b/environment/Assets/Scripts/OneDimTask3.cs index b3fd7e6..06802fa 100755 --- a/environment/Assets/Scripts/OneDimTask3.cs +++ b/environment/Assets/Scripts/OneDimTask3.cs @@ -1,4 +1,5 @@ using UnityEngine; +using System; public class OneDimTask3 : OneDimTaskBase { public GameObject reward; @@ -8,9 +9,19 @@ public class OneDimTask3 : OneDimTaskBase { Range range = Range.Green; + public override string AutomationSequence() { + string[] sequences = new string[] { + new String('2', 7), + new String('3', 120), + new String('2', 4) + }; + + return String.Join("", sequences); + } + public override string Name() { return "One Dimensional Task 3"; } - void Update() { + void FixedUpdate() { float z = agent.transform.position.z; if(range.start <= z && z <= range.end) { diff --git a/environment/Assets/Scripts/Startup.cs b/environment/Assets/Scripts/Startup.cs index 72e7ed2..0a8ec18 100644 --- a/environment/Assets/Scripts/Startup.cs +++ b/environment/Assets/Scripts/Startup.cs @@ -25,10 +25,10 @@ public class Startup : MonoBehaviour { "ArrowMazeTask2", "ArrowMazeTask3", - "OneDimTask8a", - "OneDimTask8b", - "OneDimTask8c", - "OneDimTask8d", + "OneDimTask8a", + "OneDimTask8b", + "OneDimTask8c", + "OneDimTask8d", }; @@ -36,11 +36,15 @@ public class Startup : MonoBehaviour { [SerializeField] bool ManualOverride = false; + [SerializeField] + bool Autorun = false; + void Start () { PlayerPrefs.DeleteAll(); PlayerPrefs.SetFloat("Rotation Speed", RotationSpeed); PlayerPrefs.SetFloat("Movement Speed", MovementSpeed); PlayerPrefs.SetInt("Manual Override", ManualOverride ? 1 : 0); + PlayerPrefs.SetInt("Autorun", Autorun ? 1 : 0); for(int i = 0; i < SceneNames.Length; ++i) { Scenes.Set(i, SceneNames[i]); diff --git a/environment/Assets/Scripts/Task.cs b/environment/Assets/Scripts/Task.cs index a59668c..4bb01e4 100755 --- a/environment/Assets/Scripts/Task.cs +++ b/environment/Assets/Scripts/Task.cs @@ -5,6 +5,10 @@ public abstract class Task : MonoBehaviour { protected int rewardCount = 0; + public virtual string AutomationSequence() { + return ""; + } + public abstract string Name(); public virtual void Initialize(int success, int failure) { From 941e4fe184f9c71343f7bfbfc4e38fe200e644a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=82=E4=BA=95=E5=B0=9A=E8=A1=8C?= Date: Fri, 10 Nov 2017 11:17:57 +0900 Subject: [PATCH 09/15] Fix task name. --- environment/Assets/Scripts/OneDimTask7.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment/Assets/Scripts/OneDimTask7.cs b/environment/Assets/Scripts/OneDimTask7.cs index 79a8332..97aa3a2 100755 --- a/environment/Assets/Scripts/OneDimTask7.cs +++ b/environment/Assets/Scripts/OneDimTask7.cs @@ -10,7 +10,7 @@ public class OneDimTask7 : OneDimTaskBase { Range range; - public override string Name() { return "One Dimensional Task 6"; } + public override string Name() { return "One Dimensional Task 7"; } public override void Initialize(int success, int failure) { int phase = (int)(Random.value * 3); From 03722c1dc7ad210f4ff2161d1bf35cc34c1af6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=82=E4=BA=95=E5=B0=9A=E8=A1=8C?= Date: Fri, 10 Nov 2017 11:30:46 +0900 Subject: [PATCH 10/15] add one dim task 8a-d. --- environment/Assets/Scenes/Startup.unity | 4 ++++ environment/Assets/Scripts/Startup.cs | 11 ++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/environment/Assets/Scenes/Startup.unity b/environment/Assets/Scenes/Startup.unity index 9ffb722..1a0dea0 100644 --- a/environment/Assets/Scenes/Startup.unity +++ b/environment/Assets/Scenes/Startup.unity @@ -145,6 +145,10 @@ MonoBehaviour: - OneDimTask5 - OneDimTask6 - OneDimTask7 + - OneDimTask8a + - OneDimTask8b + - OneDimTask8c + - OneDimTask8d - CrossMazeTask1 - CrossMazeTask2 - ArrowMazeTask1 diff --git a/environment/Assets/Scripts/Startup.cs b/environment/Assets/Scripts/Startup.cs index 72e7ed2..47674e0 100644 --- a/environment/Assets/Scripts/Startup.cs +++ b/environment/Assets/Scripts/Startup.cs @@ -17,6 +17,10 @@ public class Startup : MonoBehaviour { "OneDimTask5", "OneDimTask6", "OneDimTask7", + "OneDimTask8a", + "OneDimTask8b", + "OneDimTask8c", + "OneDimTask8d", "CrossMazeTask1", "CrossMazeTask2", @@ -24,13 +28,6 @@ public class Startup : MonoBehaviour { "ArrowMazeTask1", "ArrowMazeTask2", "ArrowMazeTask3", - - "OneDimTask8a", - "OneDimTask8b", - "OneDimTask8c", - "OneDimTask8d", - - }; [SerializeField] From d00464587e8044f282675b773ed361602d415760 Mon Sep 17 00:00:00 2001 From: ktnyt Date: Fri, 10 Nov 2017 14:12:08 +0900 Subject: [PATCH 11/15] Add interface for automated running --- environment/Assets/Scripts/AgentBehaviour.cs | 6 +++++ environment/Assets/Scripts/Automator.cs | 24 ++++++++++++++++++++ environment/Assets/Scripts/Automator.cs.meta | 12 ++++++++++ environment/Assets/Scripts/Environment.cs | 12 ++++++++++ environment/Assets/Scripts/OneDimTask1.cs | 5 ++++ environment/Assets/Scripts/OneDimTask2.cs | 5 ++++ environment/Assets/Scripts/OneDimTask3.cs | 13 ++++++++++- environment/Assets/Scripts/Startup.cs | 14 ++++++++---- environment/Assets/Scripts/Task.cs | 4 ++++ 9 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 environment/Assets/Scripts/Automator.cs create mode 100644 environment/Assets/Scripts/Automator.cs.meta diff --git a/environment/Assets/Scripts/AgentBehaviour.cs b/environment/Assets/Scripts/AgentBehaviour.cs index 107bd47..bd633e9 100755 --- a/environment/Assets/Scripts/AgentBehaviour.cs +++ b/environment/Assets/Scripts/AgentBehaviour.cs @@ -71,6 +71,12 @@ void Start () { } void LateUpdate () { + if(Automator.Enabled()) { + string action = Automator.Step(); + controller.PerformAction(action); + return; + } + if(!created) { if(!client.Calling) { client.Create(GenerateMessage()); diff --git a/environment/Assets/Scripts/Automator.cs b/environment/Assets/Scripts/Automator.cs new file mode 100644 index 0000000..2ca185f --- /dev/null +++ b/environment/Assets/Scripts/Automator.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +public class Automator : MonoBehaviour { + public static void Setup(string sequence) { + PlayerPrefs.SetString("Automation Sequence", sequence); + } + + public static string Step() { + string sequence = PlayerPrefs.GetString("Automation Sequence"); + + if(sequence.Length > 0) { + string head = sequence.Substring(0, 1); + string tail = sequence.Substring(1); + PlayerPrefs.SetString("Automation Sequence", tail); + return head; + } + + return ""; + } + + public static bool Enabled() { + return PlayerPrefs.GetInt("Autorun") != 0; + } +} diff --git a/environment/Assets/Scripts/Automator.cs.meta b/environment/Assets/Scripts/Automator.cs.meta new file mode 100644 index 0000000..d97905d --- /dev/null +++ b/environment/Assets/Scripts/Automator.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a23b5964bad564b79841b785061f663c +timeCreated: 1510288428 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/environment/Assets/Scripts/Environment.cs b/environment/Assets/Scripts/Environment.cs index b8f1c1d..7d54a95 100755 --- a/environment/Assets/Scripts/Environment.cs +++ b/environment/Assets/Scripts/Environment.cs @@ -24,6 +24,10 @@ public class Environment : MonoBehaviour { void Start() { task = GetComponent(); + if(Automator.Enabled()) { + Automator.Setup(task.AutomationSequence()); + } + Reward.Set(0.0F); if(!PlayerPrefs.HasKey("Task Name")) { @@ -43,6 +47,10 @@ void Start() { task.Initialize(successCount, failureCount); + if(Automator.Enabled()) { + Automator.Setup(task.AutomationSequence()); + } + taskText.text = PlayerPrefs.GetString("Task Name"); successText.text = "Success: " + successCount; failureText.text = "Failure: " + failureCount; @@ -73,6 +81,10 @@ void Update() { } if(task.Failure()) { + if(Automator.Enabled()) { + Debug.LogError("You have enabled autorun but task has failed: check your automation sequence for task '" + PlayerPrefs.GetString("Task Name") + "'"); + } + task.Reset(); Trials.AddFailure(); diff --git a/environment/Assets/Scripts/OneDimTask1.cs b/environment/Assets/Scripts/OneDimTask1.cs index da55ab9..742ecea 100755 --- a/environment/Assets/Scripts/OneDimTask1.cs +++ b/environment/Assets/Scripts/OneDimTask1.cs @@ -1,6 +1,11 @@ using UnityEngine; +using System; public class OneDimTask1 : OneDimTaskBase { + public override string AutomationSequence() { + return new String('2', 11); + } + public override string Name() { return "One Dimensional Task 1"; } public override void Initialize(int success, int failure) { diff --git a/environment/Assets/Scripts/OneDimTask2.cs b/environment/Assets/Scripts/OneDimTask2.cs index fa0cc5b..e71f779 100755 --- a/environment/Assets/Scripts/OneDimTask2.cs +++ b/environment/Assets/Scripts/OneDimTask2.cs @@ -1,10 +1,15 @@ using UnityEngine; +using System; public class OneDimTask2 : OneDimTaskBase { public GameObject reward; bool rewardShown = false; + public override string AutomationSequence() { + return new String('2', 11); + } + public override string Name() { return "One Dimensional Task 2"; } void Update() { diff --git a/environment/Assets/Scripts/OneDimTask3.cs b/environment/Assets/Scripts/OneDimTask3.cs index b3fd7e6..06802fa 100755 --- a/environment/Assets/Scripts/OneDimTask3.cs +++ b/environment/Assets/Scripts/OneDimTask3.cs @@ -1,4 +1,5 @@ using UnityEngine; +using System; public class OneDimTask3 : OneDimTaskBase { public GameObject reward; @@ -8,9 +9,19 @@ public class OneDimTask3 : OneDimTaskBase { Range range = Range.Green; + public override string AutomationSequence() { + string[] sequences = new string[] { + new String('2', 7), + new String('3', 120), + new String('2', 4) + }; + + return String.Join("", sequences); + } + public override string Name() { return "One Dimensional Task 3"; } - void Update() { + void FixedUpdate() { float z = agent.transform.position.z; if(range.start <= z && z <= range.end) { diff --git a/environment/Assets/Scripts/Startup.cs b/environment/Assets/Scripts/Startup.cs index 47674e0..ddebfda 100644 --- a/environment/Assets/Scripts/Startup.cs +++ b/environment/Assets/Scripts/Startup.cs @@ -17,10 +17,10 @@ public class Startup : MonoBehaviour { "OneDimTask5", "OneDimTask6", "OneDimTask7", - "OneDimTask8a", - "OneDimTask8b", - "OneDimTask8c", - "OneDimTask8d", + "OneDimTask8a", + "OneDimTask8b", + "OneDimTask8c", + "OneDimTask8d", "CrossMazeTask1", "CrossMazeTask2", @@ -28,16 +28,20 @@ public class Startup : MonoBehaviour { "ArrowMazeTask1", "ArrowMazeTask2", "ArrowMazeTask3", - }; + }; [SerializeField] bool ManualOverride = false; + [SerializeField] + bool Autorun = false; + void Start () { PlayerPrefs.DeleteAll(); PlayerPrefs.SetFloat("Rotation Speed", RotationSpeed); PlayerPrefs.SetFloat("Movement Speed", MovementSpeed); PlayerPrefs.SetInt("Manual Override", ManualOverride ? 1 : 0); + PlayerPrefs.SetInt("Autorun", Autorun ? 1 : 0); for(int i = 0; i < SceneNames.Length; ++i) { Scenes.Set(i, SceneNames[i]); diff --git a/environment/Assets/Scripts/Task.cs b/environment/Assets/Scripts/Task.cs index a59668c..4bb01e4 100755 --- a/environment/Assets/Scripts/Task.cs +++ b/environment/Assets/Scripts/Task.cs @@ -5,6 +5,10 @@ public abstract class Task : MonoBehaviour { protected int rewardCount = 0; + public virtual string AutomationSequence() { + return ""; + } + public abstract string Name(); public virtual void Initialize(int success, int failure) { From 46544a10e2bbc411673a914fee3e701015dd47d5 Mon Sep 17 00:00:00 2001 From: ktnyt Date: Fri, 10 Nov 2017 17:50:45 +0900 Subject: [PATCH 12/15] Add automation for one dim maze tasks --- environment/Assets/Scripts/AgentBehaviour.cs | 6 +- environment/Assets/Scripts/OneDimTask2.cs | 4 +- environment/Assets/Scripts/OneDimTask3.cs | 8 +- environment/Assets/Scripts/OneDimTask4.cs | 13 +- environment/Assets/Scripts/OneDimTask5.cs | 13 +- environment/Assets/Scripts/OneDimTask6.cs | 30 +++- environment/Assets/Scripts/OneDimTask7.cs | 32 +++- environment/Assets/Scripts/OneDimTask8a.cs | 15 +- environment/Assets/Scripts/OneDimTask8b.cs | 51 ++++--- environment/Assets/Scripts/OneDimTask8c.cs | 118 +++++++++------ environment/Assets/Scripts/OneDimTask8d.cs | 146 +++++++++++-------- environment/Assets/Scripts/Task.cs | 2 +- 12 files changed, 295 insertions(+), 143 deletions(-) diff --git a/environment/Assets/Scripts/AgentBehaviour.cs b/environment/Assets/Scripts/AgentBehaviour.cs index bd633e9..b6580b9 100755 --- a/environment/Assets/Scripts/AgentBehaviour.cs +++ b/environment/Assets/Scripts/AgentBehaviour.cs @@ -72,8 +72,10 @@ void Start () { void LateUpdate () { if(Automator.Enabled()) { - string action = Automator.Step(); - controller.PerformAction(action); + if(!controller.Paralyzed) { + string action = Automator.Step(); + controller.PerformAction(action); + } return; } diff --git a/environment/Assets/Scripts/OneDimTask2.cs b/environment/Assets/Scripts/OneDimTask2.cs index e71f779..91d359a 100755 --- a/environment/Assets/Scripts/OneDimTask2.cs +++ b/environment/Assets/Scripts/OneDimTask2.cs @@ -12,7 +12,9 @@ public override string AutomationSequence() { public override string Name() { return "One Dimensional Task 2"; } - void Update() { + void FixedUpdate() { + base.FixedUpdate(); + float z = agent.transform.position.z; if(11.5F <= z && z <= 15.5F) { diff --git a/environment/Assets/Scripts/OneDimTask3.cs b/environment/Assets/Scripts/OneDimTask3.cs index 06802fa..831bf36 100755 --- a/environment/Assets/Scripts/OneDimTask3.cs +++ b/environment/Assets/Scripts/OneDimTask3.cs @@ -10,18 +10,18 @@ public class OneDimTask3 : OneDimTaskBase { Range range = Range.Green; public override string AutomationSequence() { - string[] sequences = new string[] { + return String.Join("", new string[] { new String('2', 7), new String('3', 120), new String('2', 4) - }; - - return String.Join("", sequences); + }); } public override string Name() { return "One Dimensional Task 3"; } void FixedUpdate() { + base.FixedUpdate(); + float z = agent.transform.position.z; if(range.start <= z && z <= range.end) { diff --git a/environment/Assets/Scripts/OneDimTask4.cs b/environment/Assets/Scripts/OneDimTask4.cs index 5f27ae6..ab786cc 100755 --- a/environment/Assets/Scripts/OneDimTask4.cs +++ b/environment/Assets/Scripts/OneDimTask4.cs @@ -1,4 +1,5 @@ using UnityEngine; +using System; public class OneDimTask4 : OneDimTaskBase { public GameObject reward; @@ -8,9 +9,19 @@ public class OneDimTask4 : OneDimTaskBase { Range range = Range.Red; + public override string AutomationSequence() { + return String.Join("", new string[] { + new String('2', 10), + new String('3', 120), + new String('2', 1) + }); + } + public override string Name() { return "One Dimensional Task 4"; } - void Update() { + void FixedUpdate() { + base.FixedUpdate(); + float z = agent.transform.position.z; if(range.start <= z && z <= range.end) { diff --git a/environment/Assets/Scripts/OneDimTask5.cs b/environment/Assets/Scripts/OneDimTask5.cs index 3936f07..31ec0a7 100755 --- a/environment/Assets/Scripts/OneDimTask5.cs +++ b/environment/Assets/Scripts/OneDimTask5.cs @@ -1,4 +1,5 @@ using UnityEngine; +using System; public class OneDimTask5 : OneDimTaskBase { public GameObject reward; @@ -8,9 +9,19 @@ public class OneDimTask5 : OneDimTaskBase { Range range = Range.Blue; + public override string AutomationSequence() { + return String.Join("", new string[] { + new String('2', 4), + new String('3', 120), + new String('2', 7) + }); + } + public override string Name() { return "One Dimensional Task 5"; } - void Update() { + void FixedUpdate() { + base.FixedUpdate(); + float z = agent.transform.position.z; if(range.start <= z && z <= range.end) { diff --git a/environment/Assets/Scripts/OneDimTask6.cs b/environment/Assets/Scripts/OneDimTask6.cs index 6e009da..e989886 100755 --- a/environment/Assets/Scripts/OneDimTask6.cs +++ b/environment/Assets/Scripts/OneDimTask6.cs @@ -1,4 +1,5 @@ using UnityEngine; +using System; public class OneDimTask6 : OneDimTaskBase { public GameObject reward; @@ -8,25 +9,52 @@ public class OneDimTask6 : OneDimTaskBase { Range range; + string automation; + + public override string AutomationSequence() { return automation; } + public override string Name() { return "One Dimensional Task 6"; } public override void Initialize(int success, int failure) { switch((success + failure) % 3) { case 0: range = Range.Red; + + automation = String.Join("", new string[] { + new String('2', 10), + new String('3', 120), + new String('2', 1) + }); + break; case 1: range = Range.Green; + + automation = String.Join("", new string[] { + new String('2', 7), + new String('3', 120), + new String('2', 4) + }); + break; case 2: range = Range.Blue; + + automation = String.Join("", new string[] { + new String('2', 4), + new String('3', 120), + new String('2', 7) + }); + break; default: break; } } - void Update() { + void FixedUpdate() { + base.FixedUpdate(); + float z = agent.transform.position.z; if(range.start <= z && z <= range.end) { diff --git a/environment/Assets/Scripts/OneDimTask7.cs b/environment/Assets/Scripts/OneDimTask7.cs index 97aa3a2..5e903cb 100755 --- a/environment/Assets/Scripts/OneDimTask7.cs +++ b/environment/Assets/Scripts/OneDimTask7.cs @@ -1,4 +1,5 @@ using UnityEngine; +using System; public class OneDimTask7 : OneDimTaskBase { public GameObject reward; @@ -10,29 +11,56 @@ public class OneDimTask7 : OneDimTaskBase { Range range; + string automation; + + public override string AutomationSequence() { return automation; } + public override string Name() { return "One Dimensional Task 7"; } public override void Initialize(int success, int failure) { - int phase = (int)(Random.value * 3); + int phase = (int)(UnityEngine.Random.value * 3); selector.Selection = phase; switch(phase) { case 0: range = Range.Red; + + automation = String.Join("", new string[] { + new String('2', 10), + new String('3', 120), + new String('2', 1) + }); + break; case 1: range = Range.Green; + + automation = String.Join("", new string[] { + new String('2', 7), + new String('3', 120), + new String('2', 4) + }); + break; case 2: range = Range.Blue; + + automation = String.Join("", new string[] { + new String('2', 4), + new String('3', 120), + new String('2', 7) + }); + break; default: break; } } - void Update() { + void FixedUpdate() { + base.FixedUpdate(); + float z = agent.transform.position.z; if(elapsed < 120) { diff --git a/environment/Assets/Scripts/OneDimTask8a.cs b/environment/Assets/Scripts/OneDimTask8a.cs index 963f84e..5d711c5 100755 --- a/environment/Assets/Scripts/OneDimTask8a.cs +++ b/environment/Assets/Scripts/OneDimTask8a.cs @@ -1,4 +1,5 @@ using UnityEngine; +using System; public class OneDimTask8a : OneDimTaskBase { public GameObject reward; @@ -6,11 +7,21 @@ public class OneDimTask8a : OneDimTaskBase { bool rewardShown = false; int waited = 0; - Range range = Range.Red; + Range range = Range.Green; + + public override string AutomationSequence() { + return String.Join("", new string[] { + new String('2', 7), + new String('3', 120), + new String('2', 4) + }); + } public override string Name() { return "One Dimensional Task 8-a"; } - void Update() { + void FixedUpdate() { + base.FixedUpdate(); + float z = agent.transform.position.z; if(range.start <= z && z <= range.end) { diff --git a/environment/Assets/Scripts/OneDimTask8b.cs b/environment/Assets/Scripts/OneDimTask8b.cs index b1185a3..fbd629b 100755 --- a/environment/Assets/Scripts/OneDimTask8b.cs +++ b/environment/Assets/Scripts/OneDimTask8b.cs @@ -1,34 +1,43 @@ using UnityEngine; +using System; public class OneDimTask8b : OneDimTaskBase { - public GameObject reward; + public GameObject reward; - bool rewardShown = false; - int waited = 0; + bool rewardShown = false; + int waited = 0; - Range range = Range.Blue; + Range range = Range.Red; - public override string Name() { return "One Dimensional Task 8-b"; } + public override string AutomationSequence() { + return String.Join("", new string[] { + new String('2', 10), + new String('3', 120), + new String('2', 1) + }); + } - void Update() { - float z = agent.transform.position.z; + public override string Name() { return "One Dimensional Task 8-b"; } - if(range.start <= z && z <= range.end) { - if(!rewardShown && waited >= 2 * 60) { - rewardCount += 1; - Reward.Add(2.0F); + void Update() { + float z = agent.transform.position.z; - GameObject rewardObj = (GameObject)GameObject.Instantiate( - reward, new Vector3(0.0F, 0.5F, 23.0F), Quaternion.identity - ); + if(range.start <= z && z <= range.end) { + if(!rewardShown && waited >= 2 * 60) { + rewardCount += 1; + Reward.Add(2.0F); - rewardObj.transform.parent = transform; - rewardShown = true; - } + GameObject rewardObj = (GameObject)GameObject.Instantiate( + reward, new Vector3(0.0F, 0.5F, 23.0F), Quaternion.identity + ); - waited += 1; - } else { - waited = 0; - } + rewardObj.transform.parent = transform; + rewardShown = true; + } + + waited += 1; + } else { + waited = 0; } } +} diff --git a/environment/Assets/Scripts/OneDimTask8c.cs b/environment/Assets/Scripts/OneDimTask8c.cs index 1d0a237..6848031 100755 --- a/environment/Assets/Scripts/OneDimTask8c.cs +++ b/environment/Assets/Scripts/OneDimTask8c.cs @@ -1,50 +1,76 @@ using UnityEngine; +using System; public class OneDimTask8c : OneDimTaskBase { - public GameObject reward; - - bool rewardShown = false; - int waited = 0; - - Range range; - - public override string Name() { return "One Dimensional Task 8-c"; } - - public override void Initialize(int success, int failure) { - switch((success + failure) % 3) { - case 0: - range = Range.Red; - break; - case 1: - range = Range.Green; - break; - case 2: - range = Range.Blue; - break; - default: - break; - } - } - - void Update() { - float z = agent.transform.position.z; - - if(range.start <= z && z <= range.end) { - if(!rewardShown && waited >= 2 * 60) { - rewardCount += 1; - Reward.Add(2.0F); - - GameObject rewardObj = (GameObject)GameObject.Instantiate( - reward, new Vector3(0.0F, 0.5F, 23.0F), Quaternion.identity - ); - - rewardObj.transform.parent = transform; - rewardShown = true; - } - - waited += 1; - } else { - waited = 0; - } - } + public GameObject reward; + + bool rewardShown = false; + int waited = 0; + + Range range; + + string automation; + + public override string AutomationSequence() { return automation; } + + public override string Name() { return "One Dimensional Task 8-c"; } + + public override void Initialize(int success, int failure) { + switch((success + failure) % 3) { + case 0: + range = Range.Red; + + automation = String.Join("", new string[] { + new String('2', 10), + new String('3', 120), + new String('2', 1) + }); + + break; + case 1: + range = Range.Green; + + automation = String.Join("", new string[] { + new String('2', 7), + new String('3', 120), + new String('2', 4) + }); + + break; + case 2: + range = Range.Blue; + + automation = String.Join("", new string[] { + new String('2', 4), + new String('3', 120), + new String('2', 7) + }); + + break; + default: + break; + } + } + + void Update() { + float z = agent.transform.position.z; + + if(range.start <= z && z <= range.end) { + if(!rewardShown && waited >= 2 * 60) { + rewardCount += 1; + Reward.Add(2.0F); + + GameObject rewardObj = (GameObject)GameObject.Instantiate( + reward, new Vector3(0.0F, 0.5F, 23.0F), Quaternion.identity + ); + + rewardObj.transform.parent = transform; + rewardShown = true; + } + + waited += 1; + } else { + waited = 0; + } + } } diff --git a/environment/Assets/Scripts/OneDimTask8d.cs b/environment/Assets/Scripts/OneDimTask8d.cs index ac0546d..a5fce29 100755 --- a/environment/Assets/Scripts/OneDimTask8d.cs +++ b/environment/Assets/Scripts/OneDimTask8d.cs @@ -1,65 +1,89 @@ using UnityEngine; +using System; public class OneDimTask8d : OneDimTaskBase { - public GameObject reward; - public ShapeSelector selector; - - bool rewardShown = false; - int waited = 0; - int elapsed = 0; - - Range range; - - public override string Name() { return "One Dimensional Task 8-d"; } - - public override void Initialize(int success, int failure) { - int phase = (int)(Random.value * 3); - - selector.Selection = phase; - - switch(phase) { - case 0: - range = Range.Red; - break; - case 1: - range = Range.Green; - break; - case 2: - range = Range.Blue; - break; - default: - break; - } - } - - void Update() { - float z = agent.transform.position.z; - - if(elapsed < 120) { - agent.controller.Paralyzed = true; - selector.Visible = true; - elapsed += 1; - } else { - agent.controller.Paralyzed = false; - selector.Visible = false; - } - - if(range.start <= z && z <= range.end) { - if(!rewardShown && waited >= 2 * 60) { - rewardCount += 1; - Reward.Add(2.0F); - - GameObject rewardObj = (GameObject)GameObject.Instantiate( - reward, new Vector3(0.0F, 0.5F, 23.0F), Quaternion.identity - ); - - rewardObj.transform.parent = transform; - rewardShown = true; - } - - waited += 1; - } else { - waited = 0; - } - } + public GameObject reward; + public ShapeSelector selector; + + bool rewardShown = false; + int waited = 0; + int elapsed = 0; + + Range range; + + string automation; + + public override string AutomationSequence() { return automation; } + + public override string Name() { return "One Dimensional Task 8-d"; } + + public override void Initialize(int success, int failure) { + int phase = (int)(UnityEngine.Random.value * 3); + + selector.Selection = phase; + + switch(phase) { + case 0: + range = Range.Red; + + automation = String.Join("", new string[] { + new String('2', 10), + new String('3', 120), + new String('2', 1) + }); + + break; + case 1: + range = Range.Green; + + automation = String.Join("", new string[] { + new String('2', 7), + new String('3', 120), + new String('2', 4) + }); + + break; + case 2: + range = Range.Blue; + + automation = String.Join("", new string[] { + new String('2', 4), + new String('3', 120), + new String('2', 7) + }); + + break; + } + } + + void Update() { + float z = agent.transform.position.z; + + if(elapsed < 120) { + agent.controller.Paralyzed = true; + selector.Visible = true; + elapsed += 1; + } else { + agent.controller.Paralyzed = false; + selector.Visible = false; + } + + if(range.start <= z && z <= range.end) { + if(!rewardShown && waited >= 2 * 60) { + rewardCount += 1; + Reward.Add(2.0F); + + GameObject rewardObj = (GameObject)GameObject.Instantiate( + reward, new Vector3(0.0F, 0.5F, 23.0F), Quaternion.identity + ); + + rewardObj.transform.parent = transform; + rewardShown = true; + } + + waited += 1; + } else { + waited = 0; + } + } } diff --git a/environment/Assets/Scripts/Task.cs b/environment/Assets/Scripts/Task.cs index 4bb01e4..aa2a77c 100755 --- a/environment/Assets/Scripts/Task.cs +++ b/environment/Assets/Scripts/Task.cs @@ -40,7 +40,7 @@ void Start() { NotificationCenter.DefaultCenter.AddObserver(this, "OnRewardCollision"); } - void FixedUpdate() { + protected void FixedUpdate() { Punishment(); } } From d454cb61b61e3e6d042a63fd7e04226d87940713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=82=E4=BA=95=E5=B0=9A=E8=A1=8C?= Date: Wed, 6 Dec 2017 16:13:58 +0900 Subject: [PATCH 13/15] Modify camera clipping distance, and background color of rgb camera and of depth camera --- .../Assets/Scenes/ArrowMazeTask1.unity | 49 +++++++++++++++ .../Assets/Scenes/ArrowMazeTask2.unity | 49 +++++++++++++++ .../Assets/Scenes/ArrowMazeTask3.unity | 49 +++++++++++++++ .../Assets/Scenes/CrossMazeTask1.unity | 49 +++++++++++++++ .../Assets/Scenes/CrossMazeTask2.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask1.unity | 61 +++++++++++++++++++ environment/Assets/Scenes/OneDimTask2.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask3.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask4.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask5.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask6.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask7.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask8a.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask8b.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask8c.unity | 49 +++++++++++++++ environment/Assets/Scenes/OneDimTask8d.unity | 49 +++++++++++++++ 16 files changed, 796 insertions(+) diff --git a/environment/Assets/Scenes/ArrowMazeTask1.unity b/environment/Assets/Scenes/ArrowMazeTask1.unity index a161de4..44dac56 100644 --- a/environment/Assets/Scenes/ArrowMazeTask1.unity +++ b/environment/Assets/Scenes/ArrowMazeTask1.unity @@ -609,6 +609,55 @@ Prefab: propertyPath: ManualOverride value: 0 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/ArrowMazeTask2.unity b/environment/Assets/Scenes/ArrowMazeTask2.unity index 2d66ec5..ebb66ff 100644 --- a/environment/Assets/Scenes/ArrowMazeTask2.unity +++ b/environment/Assets/Scenes/ArrowMazeTask2.unity @@ -484,6 +484,55 @@ Prefab: propertyPath: ManualOverride value: 0 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/ArrowMazeTask3.unity b/environment/Assets/Scenes/ArrowMazeTask3.unity index 0e8082e..5f3b4cb 100644 --- a/environment/Assets/Scenes/ArrowMazeTask3.unity +++ b/environment/Assets/Scenes/ArrowMazeTask3.unity @@ -444,6 +444,55 @@ Prefab: propertyPath: ManualOverride value: 0 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/CrossMazeTask1.unity b/environment/Assets/Scenes/CrossMazeTask1.unity index a20eb94..278c5cf 100644 --- a/environment/Assets/Scenes/CrossMazeTask1.unity +++ b/environment/Assets/Scenes/CrossMazeTask1.unity @@ -352,6 +352,55 @@ Prefab: propertyPath: ManualOverride value: 0 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/CrossMazeTask2.unity b/environment/Assets/Scenes/CrossMazeTask2.unity index 2e47cec..6964931 100644 --- a/environment/Assets/Scenes/CrossMazeTask2.unity +++ b/environment/Assets/Scenes/CrossMazeTask2.unity @@ -310,6 +310,55 @@ Prefab: propertyPath: ManualOverride value: 0 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask1.unity b/environment/Assets/Scenes/OneDimTask1.unity index d6f454e..0e8ced9 100644 --- a/environment/Assets/Scenes/OneDimTask1.unity +++ b/environment/Assets/Scenes/OneDimTask1.unity @@ -423,6 +423,67 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2015576, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.17254902 + objectReference: {fileID: 0} + - target: {fileID: 2015576, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.2901961 + objectReference: {fileID: 0} + - target: {fileID: 2015576, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.5686275 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask2.unity b/environment/Assets/Scenes/OneDimTask2.unity index 31311c5..e15e644 100644 --- a/environment/Assets/Scenes/OneDimTask2.unity +++ b/environment/Assets/Scenes/OneDimTask2.unity @@ -571,6 +571,55 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask3.unity b/environment/Assets/Scenes/OneDimTask3.unity index 7ad5d25..92945e2 100644 --- a/environment/Assets/Scenes/OneDimTask3.unity +++ b/environment/Assets/Scenes/OneDimTask3.unity @@ -147,6 +147,55 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask4.unity b/environment/Assets/Scenes/OneDimTask4.unity index 4b712f2..c242e87 100644 --- a/environment/Assets/Scenes/OneDimTask4.unity +++ b/environment/Assets/Scenes/OneDimTask4.unity @@ -147,6 +147,55 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask5.unity b/environment/Assets/Scenes/OneDimTask5.unity index 35997c2..be8ba5d 100644 --- a/environment/Assets/Scenes/OneDimTask5.unity +++ b/environment/Assets/Scenes/OneDimTask5.unity @@ -423,6 +423,55 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask6.unity b/environment/Assets/Scenes/OneDimTask6.unity index 26f565b..1152499 100644 --- a/environment/Assets/Scenes/OneDimTask6.unity +++ b/environment/Assets/Scenes/OneDimTask6.unity @@ -147,6 +147,55 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask7.unity b/environment/Assets/Scenes/OneDimTask7.unity index 056c9a5..2984247 100644 --- a/environment/Assets/Scenes/OneDimTask7.unity +++ b/environment/Assets/Scenes/OneDimTask7.unity @@ -205,6 +205,55 @@ Prefab: propertyPath: ManualOverride value: 0 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask8a.unity b/environment/Assets/Scenes/OneDimTask8a.unity index 03b468b..8f3140d 100644 --- a/environment/Assets/Scenes/OneDimTask8a.unity +++ b/environment/Assets/Scenes/OneDimTask8a.unity @@ -163,6 +163,55 @@ Prefab: propertyPath: ManualOverride value: 0 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask8b.unity b/environment/Assets/Scenes/OneDimTask8b.unity index 2122621..8c250ae 100644 --- a/environment/Assets/Scenes/OneDimTask8b.unity +++ b/environment/Assets/Scenes/OneDimTask8b.unity @@ -152,6 +152,55 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask8c.unity b/environment/Assets/Scenes/OneDimTask8c.unity index 391f625..205beaf 100644 --- a/environment/Assets/Scenes/OneDimTask8c.unity +++ b/environment/Assets/Scenes/OneDimTask8c.unity @@ -152,6 +152,55 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 diff --git a/environment/Assets/Scenes/OneDimTask8d.unity b/environment/Assets/Scenes/OneDimTask8d.unity index 49d6200..df4d418 100644 --- a/environment/Assets/Scenes/OneDimTask8d.unity +++ b/environment/Assets/Scenes/OneDimTask8d.unity @@ -152,6 +152,55 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 20624300946089716, guid: 7807d5793a14e43459d66a7063f42614, + type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.r + value: 0.19215687 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.g + value: 0.3019608 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.b + value: 0.4745098 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: m_BackGroundColor.a + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: near clip plane + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 2009838, guid: 7807d5793a14e43459d66a7063f42614, type: 2} + propertyPath: far clip plane + value: 1000 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_IsPrefabParent: 0 From 2e1563ba40e695fc12afc14e8f0fce233ac09c73 Mon Sep 17 00:00:00 2001 From: Kotone Itaya Date: Fri, 8 Dec 2017 15:15:50 +0900 Subject: [PATCH 14/15] Add remaining automation sequences and fix bugs --- .../CrossPlatformInputInitialize.cs | 1 - .../Assets/Scenes/ArrowMazeTask1.unity | 80 +++++-------------- .../Assets/Scenes/ArrowMazeTask2.unity | 34 +++++--- .../Assets/Scenes/ArrowMazeTask3.unity | 30 ++++--- environment/Assets/Scripts/ArrowMazeTask1.cs | 38 ++++++--- environment/Assets/Scripts/ArrowMazeTask2.cs | 42 +++++++--- environment/Assets/Scripts/ArrowMazeTask3.cs | 40 +++++++--- environment/Assets/Scripts/CrossMazeTask1.cs | 18 ++++- environment/Assets/Scripts/CrossMazeTask2.cs | 64 ++++++++++++++- environment/Assets/Scripts/OneDimTask3.cs | 2 +- environment/Assets/Scripts/OneDimTask4.cs | 2 +- environment/Assets/Scripts/OneDimTask5.cs | 2 +- environment/Assets/Scripts/OneDimTask6.cs | 6 +- environment/Assets/Scripts/OneDimTask7.cs | 8 +- environment/Assets/Scripts/OneDimTask8a.cs | 2 +- environment/Assets/Scripts/OneDimTask8b.cs | 2 +- environment/Assets/Scripts/OneDimTask8c.cs | 6 +- 17 files changed, 242 insertions(+), 135 deletions(-) diff --git a/environment/Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs b/environment/Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs index c71c9fd..0c967c7 100755 --- a/environment/Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs +++ b/environment/Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs @@ -88,7 +88,6 @@ private static bool DisableValidate() private static BuildTargetGroup[] buildTargetGroups = new BuildTargetGroup[] { BuildTargetGroup.Standalone, - BuildTargetGroup.WebPlayer, BuildTargetGroup.Android, BuildTargetGroup.iOS, BuildTargetGroup.WP8, diff --git a/environment/Assets/Scenes/ArrowMazeTask1.unity b/environment/Assets/Scenes/ArrowMazeTask1.unity index a161de4..b97b18b 100644 --- a/environment/Assets/Scenes/ArrowMazeTask1.unity +++ b/environment/Assets/Scenes/ArrowMazeTask1.unity @@ -77,15 +77,17 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 - m_PVRFiltering: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 m_PVRFilteringMode: 1 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 m_LightingDataAsset: {fileID: 112000004, guid: 6f2fd0e974c2e4064b66a2a187164413, type: 2} m_UseShadowmask: 1 @@ -108,6 +110,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1 &508120 GameObject: @@ -133,7 +137,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 508120} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 160, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -207,7 +211,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 24736947} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 100, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -272,11 +276,6 @@ MonoBehaviour: Transform: m_PrefabParentObject: {fileID: 483300, guid: 7807d5793a14e43459d66a7063f42614, type: 2} m_PrefabInternal: {fileID: 1146091655} ---- !u!4 &492039140 stripped -Transform: - m_PrefabParentObject: {fileID: 4459475463355686, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, - type: 2} - m_PrefabInternal: {fileID: 1042818923} --- !u!1 &733901350 GameObject: m_ObjectHideFlags: 0 @@ -320,6 +319,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -335,6 +335,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -393,6 +394,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: agent: {fileID: 215569004} + reward: {fileID: 1000010065798232, guid: 1c43f5b083a864bcb8be9d120eb757fe, type: 2} --- !u!114 &853956081 MonoBehaviour: m_ObjectHideFlags: 0 @@ -422,7 +424,6 @@ Transform: - {fileID: 1861140891} - {fileID: 215457240} - {fileID: 215569014} - - {fileID: 492039140} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -507,9 +508,9 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1013818245} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 24.999998, z: 11.999998} + m_LocalScale: {x: 0.033670437, y: 0.033670437, z: 0.033670437} m_Children: - {fileID: 508121} - {fileID: 1369907427} @@ -523,48 +524,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!1001 &1042818923 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 853956082} - m_Modifications: - - target: {fileID: 4459475463355686, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, type: 2} - propertyPath: m_LocalPosition.x - value: 10.559999 - objectReference: {fileID: 0} - - target: {fileID: 4459475463355686, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, type: 2} - propertyPath: m_LocalPosition.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 4459475463355686, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, type: 2} - propertyPath: m_LocalPosition.z - value: 8.05 - objectReference: {fileID: 0} - - target: {fileID: 4459475463355686, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, type: 2} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 4459475463355686, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, type: 2} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 4459475463355686, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, type: 2} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 4459475463355686, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4459475463355686, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, type: 2} - propertyPath: m_RootOrder - value: 4 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: bb082bd6ac49f4a41b1ad42af0e9b84f, type: 2} - m_IsPrefabParent: 0 --- !u!1001 &1146091655 Prefab: m_ObjectHideFlags: 0 @@ -745,7 +704,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1369907426} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 140, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -849,7 +808,6 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 --- !u!81 &1521409642 AudioListener: m_ObjectHideFlags: 0 @@ -908,7 +866,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1630416949} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 120, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -1001,6 +959,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1016,6 +975,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 diff --git a/environment/Assets/Scenes/ArrowMazeTask2.unity b/environment/Assets/Scenes/ArrowMazeTask2.unity index 2d66ec5..7decaa7 100644 --- a/environment/Assets/Scenes/ArrowMazeTask2.unity +++ b/environment/Assets/Scenes/ArrowMazeTask2.unity @@ -77,15 +77,17 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 - m_PVRFiltering: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 m_PVRFilteringMode: 1 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 m_LightingDataAsset: {fileID: 112000004, guid: 6f2fd0e974c2e4064b66a2a187164413, type: 2} m_UseShadowmask: 1 @@ -108,6 +110,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1 &508120 GameObject: @@ -133,7 +137,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 508120} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 160, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -226,6 +230,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -241,6 +246,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -294,7 +300,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 24736947} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 100, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -396,6 +402,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -411,6 +418,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -602,6 +610,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: agent: {fileID: 1385033383} + reward: {fileID: 1000010065798232, guid: 1c43f5b083a864bcb8be9d120eb757fe, type: 2} --- !u!1 &1013818245 GameObject: m_ObjectHideFlags: 0 @@ -683,9 +692,9 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1013818245} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 24.999998, z: 11.999998} + m_LocalScale: {x: 0.033670437, y: 0.033670437, z: 0.033670437} m_Children: - {fileID: 508121} - {fileID: 1369907427} @@ -827,7 +836,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1369907426} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 140, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -926,6 +935,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -941,6 +951,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1024,7 +1035,6 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 --- !u!81 &1521409642 AudioListener: m_ObjectHideFlags: 0 @@ -1083,7 +1093,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1630416949} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 120, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} diff --git a/environment/Assets/Scenes/ArrowMazeTask3.unity b/environment/Assets/Scenes/ArrowMazeTask3.unity index 0e8082e..e23ab33 100644 --- a/environment/Assets/Scenes/ArrowMazeTask3.unity +++ b/environment/Assets/Scenes/ArrowMazeTask3.unity @@ -77,15 +77,17 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 - m_PVRFiltering: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 m_PVRFilteringMode: 1 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 m_LightingDataAsset: {fileID: 112000004, guid: 6f2fd0e974c2e4064b66a2a187164413, type: 2} m_UseShadowmask: 1 @@ -108,6 +110,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1 &508120 GameObject: @@ -133,7 +137,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 508120} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 160, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -207,7 +211,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 24736947} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 100, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -356,6 +360,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -371,6 +376,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -508,6 +514,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: agent: {fileID: 1711314061} + reward: {fileID: 1000010065798232, guid: 1c43f5b083a864bcb8be9d120eb757fe, type: 2} --- !u!1 &1013818245 GameObject: m_ObjectHideFlags: 0 @@ -589,9 +596,9 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1013818245} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 24.999998, z: 11.999998} + m_LocalScale: {x: 0.033670437, y: 0.033670437, z: 0.033670437} m_Children: - {fileID: 508121} - {fileID: 1369907427} @@ -733,7 +740,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1369907426} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 140, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} @@ -837,7 +844,6 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 --- !u!81 &1521409642 AudioListener: m_ObjectHideFlags: 0 @@ -896,7 +902,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1630416949} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -320, y: 120, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1013818249} diff --git a/environment/Assets/Scripts/ArrowMazeTask1.cs b/environment/Assets/Scripts/ArrowMazeTask1.cs index de86a58..a531bf2 100644 --- a/environment/Assets/Scripts/ArrowMazeTask1.cs +++ b/environment/Assets/Scripts/ArrowMazeTask1.cs @@ -1,24 +1,42 @@ using UnityEngine; +using System; public class ArrowMazeTask1 : ArrowMazeTaskBase { + public GameObject reward; + int waitedTime = 0; bool waited = false; + public override string AutomationSequence() { + return String.Join("", new string[] { + new String('0', 11), + new String('2', 8), + new String('3', 130), + new String('1', 4), + new String('2', 8) + }); + } + public override string Name() { return "Arrow Maze Task 1"; } public override void Initialize(int success, int failure) {} void Update() { - float x = agent.transform.position.x; - - if(0.0f <= x && x <= 4.0f) { - if(!waited && (waitedTime >= 2 * 60)) { - Reward.Add(2.0F); - waited = true; - } - waitedTime += 1; - } else { - waitedTime = 0; + float x = agent.transform.position.x; + + if(0.0f <= x && x <= 4.0f) { + if(!waited && (waitedTime >= 2 * 60)) { + Reward.Add(2.0F); + + GameObject rewardObj = (GameObject)GameObject.Instantiate( + reward, new Vector3(10.56F, 0.5F, 8.05F), Quaternion.identity + ); + + waited = true; } + waitedTime += 1; + } else { + waitedTime = 0; + } } } diff --git a/environment/Assets/Scripts/ArrowMazeTask2.cs b/environment/Assets/Scripts/ArrowMazeTask2.cs index a3bb06a..6c69577 100644 --- a/environment/Assets/Scripts/ArrowMazeTask2.cs +++ b/environment/Assets/Scripts/ArrowMazeTask2.cs @@ -1,24 +1,44 @@ using UnityEngine; +using System; public class ArrowMazeTask2 : ArrowMazeTaskBase { + public GameObject reward; + int waitedTime = 0; bool waited = false; + public override string AutomationSequence() { + return String.Join("", new string[] { + new String('2', 5), + new String('0', 9), + new String('2', 5), + new String('3', 130), + new String('2', 4), + new String('0', 9), + new String('2', 5) + }); + } + public override string Name() { return "Arrow Maze Task 2"; } public override void Initialize(int success, int failure) {} void Update() { - float x = agent.transform.position.x; - - if(0.0f <= x && x <= 4.0f) { - if(!waited && (waitedTime >= 2 * 60)) { - Reward.Add(2.0F); - waited = true; - } - waitedTime += 1; - } else { - waitedTime = 0; - } + float x = agent.transform.position.x; + + if(0.0f <= x && x <= 4.0f) { + if(!waited && (waitedTime >= 2 * 60)) { + Reward.Add(2.0F); + + GameObject rewardObj = (GameObject)GameObject.Instantiate( + reward, new Vector3(10.56F, 0.5F, 8.05F), Quaternion.identity + ); + + waited = true; + } + waitedTime += 1; + } else { + waitedTime = 0; + } } } diff --git a/environment/Assets/Scripts/ArrowMazeTask3.cs b/environment/Assets/Scripts/ArrowMazeTask3.cs index fb6c577..68f872e 100644 --- a/environment/Assets/Scripts/ArrowMazeTask3.cs +++ b/environment/Assets/Scripts/ArrowMazeTask3.cs @@ -1,24 +1,42 @@ using UnityEngine; +using System; public class ArrowMazeTask3 : ArrowMazeTaskBase { + public GameObject reward; + int waitedTime = 0; bool waited = false; + public override string AutomationSequence() { + return String.Join("", new string[] { + new String('0', 9), + new String('2', 5), + new String('3', 130), + new String('2', 4), + new String('0', 9) + }); + } + public override string Name() { return "Arrow Maze Task 3"; } public override void Initialize(int success, int failure) {} void Update() { - float x = agent.transform.position.x; - - if(0.0f <= x && x <= 4.0f) { - if(!waited && (waitedTime >= 2 * 60)) { - Reward.Add(2.0F); - waited = true; - } - waitedTime += 1; - } else { - waitedTime = 0; - } + float x = agent.transform.position.x; + + if(0.0f <= x && x <= 4.0f) { + if(!waited && (waitedTime >= 2 * 60)) { + Reward.Add(2.0F); + + GameObject rewardObj = (GameObject)GameObject.Instantiate( + reward, new Vector3(10.56F, 0.5F, 8.05F), Quaternion.identity + ); + + waited = true; + } + waitedTime += 1; + } else { + waitedTime = 0; + } } } diff --git a/environment/Assets/Scripts/CrossMazeTask1.cs b/environment/Assets/Scripts/CrossMazeTask1.cs index eeeb2af..fbe3c35 100644 --- a/environment/Assets/Scripts/CrossMazeTask1.cs +++ b/environment/Assets/Scripts/CrossMazeTask1.cs @@ -1,6 +1,11 @@ using UnityEngine; +using System; public class CrossMazeTask1 : CrossMazeTaskBase { + string automation; + + public override string AutomationSequence() { return automation; } + float rewardValue = 2.0F; public override string Name() { return "Cross Maze Task 1"; } @@ -8,7 +13,7 @@ public class CrossMazeTask1 : CrossMazeTaskBase { public override void Initialize(int success, int failure) { // 仕様「S地点は3ヶ所あり、ランダムにスタート地点が決定する」を実現する - int phase = (int)(Random.value * 3); + int phase = (int)(UnityEngine.Random.value * 3); float x = 0.0f; float y = 1.12f; float z = 0.5f; @@ -21,15 +26,26 @@ public override void Initialize(int success, int failure) { switch(phase) { case 0: // 南端からスタート {0, 0, 0} + automation = new String('2', 11); break; case 1: // 東端からスタート {0, 0, 0} + automation = String.Join("", new string[] { + new String('2', 6), + new String('0', 9), + new String('2', 5) + }); x = 12.0f; z = 12.5f; ry = -90.0f; break; case 2: // 西端からスタート {0, 0, 0} + automation = String.Join("", new string[] { + new String('2', 6), + new String('1', 9), + new String('2', 5) + }); x = -12.0f; z = 12.5f; ry = 90.0f; diff --git a/environment/Assets/Scripts/CrossMazeTask2.cs b/environment/Assets/Scripts/CrossMazeTask2.cs index 2b09931..1407164 100644 --- a/environment/Assets/Scripts/CrossMazeTask2.cs +++ b/environment/Assets/Scripts/CrossMazeTask2.cs @@ -1,12 +1,17 @@ using UnityEngine; +using System; public class CrossMazeTask2 : CrossMazeTaskBase { + string automation; + + public override string AutomationSequence() { return automation; } + public override string Name() { return "Cross Maze Task 2"; } public override void Initialize(int success, int failure) { // 仕様「S地点は中心で、向きはランダム」を実現する - int phase = (int)(Random.value * 4); + int phase = (int)(UnityEngine.Random.value * 4); float rx = 0.0f; float ry = 0.0f; float rz = 0.0f; @@ -15,18 +20,73 @@ public override void Initialize(int success, int failure) { switch(phase) { case 0: // 北向きでスタート {0, 0, 0} + automation = String.Join("", new string[] { + new String('1', 9), + new String('2', 6), + new String('0', 18), + new String('2', 6), + + new String('1', 9), + new String('2', 6), + new String('0', 18), + new String('2', 6), + + new String('1', 9), + new String('2', 6) + }); ry = 0.0f; break; case 1: - // 西向きでスタート {0, 0, 0} + // 西向きでスタート {n0, 0, 0} + automation = String.Join("", new string[] { + new String('2', 6), + new String('0', 18), + new String('2', 6), + + new String('1', 9), + new String('2', 6), + new String('0', 18), + new String('2', 6), + + new String('1', 9), + new String('2', 6) + }); ry = -90.0f; break; case 2: // 東向きでスタート {0, 0, 0} + automation = String.Join("", new string[] { + new String('0', 18), + new String('2', 6), + new String('0', 18), + new String('2', 6), + + new String('1', 9), + new String('2', 6), + new String('0', 18), + new String('2', 6), + + new String('1', 9), + new String('2', 6) + }); ry = 90.0f; break; case 3: // 向きでスタート {0, 0, 0} + automation = String.Join("", new string[] { + new String('0', 9), + new String('2', 6), + new String('0', 18), + new String('2', 6), + + new String('1', 9), + new String('2', 6), + new String('0', 18), + new String('2', 6), + + new String('1', 9), + new String('2', 6) + }); ry = 180.0f; break; default: diff --git a/environment/Assets/Scripts/OneDimTask3.cs b/environment/Assets/Scripts/OneDimTask3.cs index 831bf36..2b874d9 100755 --- a/environment/Assets/Scripts/OneDimTask3.cs +++ b/environment/Assets/Scripts/OneDimTask3.cs @@ -12,7 +12,7 @@ public class OneDimTask3 : OneDimTaskBase { public override string AutomationSequence() { return String.Join("", new string[] { new String('2', 7), - new String('3', 120), + new String('3', 130), new String('2', 4) }); } diff --git a/environment/Assets/Scripts/OneDimTask4.cs b/environment/Assets/Scripts/OneDimTask4.cs index ab786cc..8f123e0 100755 --- a/environment/Assets/Scripts/OneDimTask4.cs +++ b/environment/Assets/Scripts/OneDimTask4.cs @@ -12,7 +12,7 @@ public class OneDimTask4 : OneDimTaskBase { public override string AutomationSequence() { return String.Join("", new string[] { new String('2', 10), - new String('3', 120), + new String('3', 130), new String('2', 1) }); } diff --git a/environment/Assets/Scripts/OneDimTask5.cs b/environment/Assets/Scripts/OneDimTask5.cs index 31ec0a7..194ee3b 100755 --- a/environment/Assets/Scripts/OneDimTask5.cs +++ b/environment/Assets/Scripts/OneDimTask5.cs @@ -12,7 +12,7 @@ public class OneDimTask5 : OneDimTaskBase { public override string AutomationSequence() { return String.Join("", new string[] { new String('2', 4), - new String('3', 120), + new String('3', 130), new String('2', 7) }); } diff --git a/environment/Assets/Scripts/OneDimTask6.cs b/environment/Assets/Scripts/OneDimTask6.cs index e989886..37c9651 100755 --- a/environment/Assets/Scripts/OneDimTask6.cs +++ b/environment/Assets/Scripts/OneDimTask6.cs @@ -22,7 +22,7 @@ public override void Initialize(int success, int failure) { automation = String.Join("", new string[] { new String('2', 10), - new String('3', 120), + new String('3', 130), new String('2', 1) }); @@ -32,7 +32,7 @@ public override void Initialize(int success, int failure) { automation = String.Join("", new string[] { new String('2', 7), - new String('3', 120), + new String('3', 130), new String('2', 4) }); @@ -42,7 +42,7 @@ public override void Initialize(int success, int failure) { automation = String.Join("", new string[] { new String('2', 4), - new String('3', 120), + new String('3', 130), new String('2', 7) }); diff --git a/environment/Assets/Scripts/OneDimTask7.cs b/environment/Assets/Scripts/OneDimTask7.cs index 5e903cb..c2aea53 100755 --- a/environment/Assets/Scripts/OneDimTask7.cs +++ b/environment/Assets/Scripts/OneDimTask7.cs @@ -28,7 +28,7 @@ public override void Initialize(int success, int failure) { automation = String.Join("", new string[] { new String('2', 10), - new String('3', 120), + new String('3', 130), new String('2', 1) }); @@ -38,7 +38,7 @@ public override void Initialize(int success, int failure) { automation = String.Join("", new string[] { new String('2', 7), - new String('3', 120), + new String('3', 130), new String('2', 4) }); @@ -48,7 +48,7 @@ public override void Initialize(int success, int failure) { automation = String.Join("", new string[] { new String('2', 4), - new String('3', 120), + new String('3', 130), new String('2', 7) }); @@ -63,7 +63,7 @@ void FixedUpdate() { float z = agent.transform.position.z; - if(elapsed < 120) { + if(elapsed < 130) { agent.controller.Paralyzed = true; selector.Visible = true; elapsed += 1; diff --git a/environment/Assets/Scripts/OneDimTask8a.cs b/environment/Assets/Scripts/OneDimTask8a.cs index 5d711c5..007b436 100755 --- a/environment/Assets/Scripts/OneDimTask8a.cs +++ b/environment/Assets/Scripts/OneDimTask8a.cs @@ -12,7 +12,7 @@ public class OneDimTask8a : OneDimTaskBase { public override string AutomationSequence() { return String.Join("", new string[] { new String('2', 7), - new String('3', 120), + new String('3', 130), new String('2', 4) }); } diff --git a/environment/Assets/Scripts/OneDimTask8b.cs b/environment/Assets/Scripts/OneDimTask8b.cs index fbd629b..768aa0d 100755 --- a/environment/Assets/Scripts/OneDimTask8b.cs +++ b/environment/Assets/Scripts/OneDimTask8b.cs @@ -12,7 +12,7 @@ public class OneDimTask8b : OneDimTaskBase { public override string AutomationSequence() { return String.Join("", new string[] { new String('2', 10), - new String('3', 120), + new String('3', 130), new String('2', 1) }); } diff --git a/environment/Assets/Scripts/OneDimTask8c.cs b/environment/Assets/Scripts/OneDimTask8c.cs index 6848031..e277592 100755 --- a/environment/Assets/Scripts/OneDimTask8c.cs +++ b/environment/Assets/Scripts/OneDimTask8c.cs @@ -22,7 +22,7 @@ public override void Initialize(int success, int failure) { automation = String.Join("", new string[] { new String('2', 10), - new String('3', 120), + new String('3', 130), new String('2', 1) }); @@ -32,7 +32,7 @@ public override void Initialize(int success, int failure) { automation = String.Join("", new string[] { new String('2', 7), - new String('3', 120), + new String('3', 130), new String('2', 4) }); @@ -42,7 +42,7 @@ public override void Initialize(int success, int failure) { automation = String.Join("", new string[] { new String('2', 4), - new String('3', 120), + new String('3', 130), new String('2', 7) }); From 5c6fbbfeeb7e4753fe0c50a0f7c9f29128c3dc82 Mon Sep 17 00:00:00 2001 From: Kotone Itaya Date: Fri, 8 Dec 2017 13:49:07 +0900 Subject: [PATCH 15/15] Add agent address logging --- agent/server.py | 1 + agent/tool/result_logger.py | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/agent/server.py b/agent/server.py index a79a90b..eef5fb5 100644 --- a/agent/server.py +++ b/agent/server.py @@ -96,6 +96,7 @@ def create(self, identifier): feature = self.feature_extractor.feature(observation) self.result_logger.initialize() result = self.agent_service.create(reward, feature, identifier) + self.result_logger.add_agent(self.agent_service.agents[identifier]) outbound_logger.info('action: {}'.format(result)) diff --git a/agent/tool/result_logger.py b/agent/tool/result_logger.py index cff54f1..4486e80 100644 --- a/agent/tool/result_logger.py +++ b/agent/tool/result_logger.py @@ -2,6 +2,7 @@ from config.log import TASK_RESULT_KEY, EPISODE_RESULT_KEY import logging import time +from sets import Set episode_result_logger = logging.getLogger(EPISODE_RESULT_KEY) task_result_logger = logging.getLogger(TASK_RESULT_KEY) @@ -15,22 +16,28 @@ def __init__(self): self.episode = 0 self.task = 1 - episode_result_logger.info("task,episode,step,time") - task_result_logger.info("task,success,failure") + episode_result_logger.info("task,episode,step,time,agents") + task_result_logger.info("task,success,failure,agents") + + self.agents = Set() def initialize(self): self.start_time = time.time() self.steps = 0 self.episode += 1 + def add_agent(self, agent): + self.agents.add(agent) + def step(self): self.steps += 1 def report(self, success, failure, finished): + agent_ids = ':'.join([hex(id(agent)) for agent in self.agents]) elapsed_time = time.time() - self.start_time if finished: - task_result_logger.info('{}, {}, {}'.format(self.task, success, failure)) + task_result_logger.info('{}, {}, {}, {}'.format(self.task, success, failure, agent_ids)) self.task += 1 self.episode = 0 - episode_result_logger.info('{}, {}, {}, {}'.format(self.task, self.episode, self.steps, elapsed_time)) + episode_result_logger.info('{}, {}, {}, {}, {}'.format(self.task, self.episode, self.steps, elapsed_time, agent_ids))