public void terminate() {
        if (subGoals.size() > 0) {
            //terminate sub goals
            for (int i = 0; i < subGoals.size(); i++) {
                Goal subGoal = subGoals.get(i);
                if(subGoal != null) {
                    subGoal.terminate();
                }
            }
            
            //destroy sub goals
            for (int i = 0; i < subGoals.size(); i++) {
                subGoals.remove(i);
            }
        }
    }