示例#1
0
    // Use this for initialization
    void Start()
    {
        rigid = GetComponent <Rigidbody>();
        SetStatusText("Welcome");
        SetControlText(COMMAND_TEXT);
        initialPosition = transform.position;
        initialRotation = transform.rotation;

        network      = new NeuralNet(SENSOR_VALUE_COUNT, 8, TARGET_VALUE_COUNT);
        sensors      = GameObject.FindObjectOfType <SensorSuite>();
        recordedData = new Dictionary <Command, List <DataSet> >();
        recordedData.Add(Command.Left, new List <DataSet>());
        recordedData.Add(Command.Right, new List <DataSet>());
        recordedData.Add(Command.Jump, new List <DataSet>());
        recordedData.Add(Command.Empty, new List <DataSet>());

        if (controlMode == ControlMode.automatic)
        {
            LoadDataFromTrainSet();
            trainingThread = new Thread(new ThreadStart(TrainNetwork));
            SetStatusText("Train the network...");
            Time.timeScale = 0.0f;
            trainingThread.Start();
        }
    }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     sensor = GetComponentInChildren <SensorSuite>();
     rigid  = GetComponent <Rigidbody>();
     Rotate(-30);
     gameObject.layer = Physics.IgnoreRaycastLayer;
     ControllScript.GetInstance().RegisterRobot(this);
     ControllScript.GetInstance().notifyRobotReady();
 }
示例#3
0
 public override void InitializeAgent()
 {
     sensor        = sensorSuite.GetComponent <SensorSuite>();
     controlScript = this.GetComponent <ControlScript>();
 }
示例#4
0
 public void RegisterInstance(ControlScript control, SensorSuite sensors)
 {
     Instances.Add(control, sensors);
 }