void Update () {
			int currentCapacity = foragerMemory.info.currentCapacity;
			GameObject target = foragerMemory.foragerCommunicated;

			if (target == null) {
				if (timer > 1f) {
					foragerCommunicate.EstablishCommunication ();
					timer = 0f;
				}
			} else {
				foragerMovement.GoTo (target.transform.position);
				foragerMemory.currentAction = "Communicate";
				return;
			}

			timer += Time.deltaTime;

			if (currentCapacity != 30) {
				if (foragerMemory.openlist.Count == 0) {
					foragerExplore.Explore ();
					foragerMemory.currentAction = "Explore";
				} else {
					FoodInfo info = foragerMemory.PickBestFood ();
					foragerMovement.GoTo (info.position);
					foragerMemory.currentAction = "Go to food";
				}
			} else {
				foragerMovement.GoTo (foragerMemory.hivePos);
				foragerMemory.currentAction = "Go home";
			}
		}
        void Update()
        {
            int currentCapacity = foragerMemory.info.currentCapacity;

            if (currentCapacity != 30)
            {
                if (foragerMemory.openlist.Count == 0)
                {
                    foragerExplore.Explore();
                }
                else
                {
                    FoodInfo info = foragerMemory.PickBestFood();
                    foragerMovement.GoTo(info.position);
                    foragerMemory.currentAction = "Go to food";
                }
            }
            else
            {
                foragerMovement.GoTo(foragerMemory.hivePos);
                foragerMemory.currentAction = "Go home";
            }
        }
        public void Explore()
        {
            foragerMemory.currentAction = "Explore";
            int     x   = (int)gameObject.transform.position.x;
            int     y   = (int)gameObject.transform.position.z;
            Vector3 tmp = new Vector3(x, foragerMovement.transform.position.y, y);

            try{
                if (((foragerMovement.transform.position - tmp).magnitude) < delete_radius && wanderpoint[x + size, y + size] != 0)
                {
                    wanderpoint[x + size, y + size] = 0;
                }
            }catch {}
            //print("update3");

            if (foragerMovement.isArrive())
            {
                bool index0 = true;
                while (index0)
                {
                    //int index = Random.Range(0, 2500);
                    int index = wanderDest();
                    //print(index);
                    int index_x = index / ((size + 1) * 2);
                    int index_y = index % ((size + 1) * 2);
                    //print((index_x-24) + " " + (index_y-24));
                    if (wanderpoint[index_x, index_y] != 0)
                    {
                        Vector3 pos = new Vector3(index_x - size, 0, index_y - size);
                        //print (pos);
                        foragerMovement.GoTo(pos);
                        //print (pos);
                        wanderpoint[index_x, index_y] = 0;
                        index0 = false;
                    }
                }
            }
        }