public void run(RobotController rc) throws GameActionException {
            if (rc.isActive()) {
                // Spawn a soldier
                Direction dir = rc.getLocation().directionTo(rc.senseEnemyHQLocation());

                if (rc.canMove(dir)&&(rc.getTeamPower()>130)) {
                    if(doResearch) {
                        if(this.upgrade==null){
                            this.getUpgrade(rc);
                        } else if (rc.hasUpgrade(this.upgrade)) {
                            this.getUpgrade(rc);
                        }
                        doResearch = false;
                        rc.researchUpgrade(this.upgrade);
                        return;
                    } else {
                        doResearch = true;
                        rc.spawn(dir);
                        this.units = this.units + 1;
                        if (this.units>9) {
                            rc.broadcast(0,2);
                            this.units = 0;
                        } else {
                            rc.broadcast(0, 1);
                        }
                    }
                    return;
                } else {
                    if(this.upgrade==null){
                        this.getUpgrade(rc);
                    } else if (rc.hasUpgrade(this.upgrade)) {
                        this.getUpgrade(rc);
                    }
                    rc.researchUpgrade(this.upgrade);
                    return;
                }
            }
        //rc.researchUpgrade(Upgrade.NUKE);
        // End turn
        return;
    }