示例#1
0
        // Use this for initialization
        public void init(List <GameObject> cubes, float blockSize, float stepSize, int horizon)
        {
            //Add translation action controller
            GameObject robot = GameObject.Find("Robot");

            if (robot == null)
            {
                Debug.LogError("There must be a robotic agent called 'Robot'");
            }

            this.queue = new Queue <Job> ();
            this.numberOfJobsFinished = new SynchronizedInt();

            // Add actions that the robot can perform e.g., translation, picking etc.
            this.translation = robot.AddComponent <LinearTranslation> ();
            this.translation.init(10.00f);

            // Snapshot ID
            this.snapshotID = 1;

            // Maximum number of epsiodes
            this.maxNumActions = horizon;
            this.numActions    = 0;
            this.blockSize     = blockSize;

            this.minimumApproachDistance = Mathf.Infinity;

            this.cubes     = cubes;
            this.stepSize  = stepSize;
            this.current   = this.getCurrentObjectSystem();
            this.rewardStr = "$NONE$";
        }
示例#2
0
    public void init(float speed)
    {
        this.jobQueue             = new Queue <Job> ();
        this.speed                = speed;
        this.epsilon              = 0.001f;
        this.tol                  = 0.0001f;
        this.stale                = true;
        this.animate              = false;
        this.lastL2Distance       = double.PositiveInfinity;
        this.numberOfJobsFinished = new SynchronizedInt();

        GameObject ground = GameObject.Find("Ground");

        this.groundOriginX = ground.transform.position.x;
        this.groundOriginZ = ground.transform.position.z;

        Bounds  groundBounds = ground.GetComponent <MeshFilter>().mesh.bounds;
        Vector3 groundScale  = ground.transform.localScale;

        this.groundWidth  = groundBounds.size.x * groundScale.x;
        this.groundHeight = groundBounds.size.z * groundScale.z;
    }