コード例 #1
0
    void Start()
    {
        dataObj     = GetComponent <DataCollect>();
        lookupTable = GetComponent <QTable>();

        lookupTable.qTableInit();



        positions       = dataObj.getPositions();
        directionsTaken = dataObj.getdDirectionTaken();
        distToGoal      = dataObj.getDistToGoal();
        canMoveLeft     = dataObj.getCanMoveLeft();
        canMoveRight    = dataObj.getCanMoveRight();
        canMoveBack     = dataObj.getCanMoveBack();
        canMoveForward  = dataObj.getCanMoveForward();
        rewardGiven     = dataObj.getRewardGiven();
    }
コード例 #2
0
    void Start()
    {
        energyScriptRef = energyBarr.GetComponent <energyScript>();
        lookupTable     = GetComponent <QTable>();
        lookupTable.qTableInit();
        tableMessenger = GetComponent <TextWriteTest>();
        // keep reference to numIterations alive when scene reload
        variableForPrefab      = Resources.Load("prefabs/MainCube", typeof(GameObject)) as GameObject;
        numIterationsScriptRef = variableForPrefab.GetComponent <numIterationsScript>();
        // run the read function to update Qtable from local text files
        read();
        numIterationsScriptRef.numIterations += 1;    // increment numIterations
        completeText.text = "";
        StartCoroutine(runStartText());

        // if aiEnabled = false hide the aiCube and render in the playerCube
        if (aiEnabled == false)
        {
            cube.SetActive(false);
            CubeController scriptRef = GetComponent <CubeController>();
            scriptRef.enabled = false;  // disable the mlScript so computations dont use resources in background
        }
        if (playerEnabled == false)
        {
            //playerCube.SetActive(false);
            GameObject.Destroy(playerCube);
            //CubeController scriptRefTwo = GetComponent<playerController>();
            //scriptRefTwo.enabled = false;
        }
        else
        {
            aiCam.enabled = false;
        }
        dataObj         = GetComponent <DataCollect>();
        positions       = dataObj.getPositions();
        directionsTaken = dataObj.getdDirectionTaken();
        distToGoal      = dataObj.getDistToGoal();
        canMoveLeft     = dataObj.getCanMoveLeft();
        canMoveRight    = dataObj.getCanMoveRight();
        canMoveBack     = dataObj.getCanMoveBack();
        canMoveForward  = dataObj.getCanMoveForward();
        rewardGiven     = dataObj.getRewardGiven();
    }