jill/src/main/java/io/github/agentsoz/jill/core/ProgramLoader.java
private static boolean completeGoalPlanHierarchy() {
    for (int i = 0; i < GlobalState.planTypes.size(); i++) {
      PlanType ptype = (PlanType) GlobalState.planTypes.get(i);
      String[] postsGoals = getGoalsFromPlanInfoAnnotation(ptype.getPlanClass());
      // A @PlanInfo is optional, and only present if this plan posts goals
      if (postsGoals == null) {
        continue;
      }
      // But if @PlanInfo was given then it cannot be incomplete
      if (postsGoals.length == 0) {
        return false;
      }
      // All good, so find the goals that this plan posts and set up the Goal-Plan tree links
      for (String goalname : postsGoals) {
        GoalType gtype = (GoalType) GlobalState.goalTypes.find(goalname);
        if (gtype == null) {
          logger.error("Plan " + ptype.getName() + " posts goal " + goalname
              + "which is not a known goal type.");
          return false;
        }
        // Found a goal posted by the plan, so setup the parent-child links
        ptype.addChild((byte) gtype.getId());
        gtype.addParent((byte) ptype.getId());
      }
    }
    return true;
  }
private static boolean completeGoalPlanHierarchy() {
    for (int i = 0; i < GlobalState.planTypes.size(); i++) {
      PlanType ptype = (PlanType) GlobalState.planTypes.get(i);
      String[] postsGoals = getGoalsFromPlanInfoAnnotation(ptype.getPlanClass());
      // A @PlanInfo is optional, and only present if this plan posts goals
      if (postsGoals == null) {
        continue;
      }
      // But if @PlanInfo was given then it cannot be incomplete
      if (postsGoals.length == 0) {
        return false;
      }
      // All good, so find the goals that this plan posts and set up the Goal-Plan tree links
      for (String goalname : postsGoals) {
        GoalType gtype = (GoalType) GlobalState.goalTypes.find(goalname);
        if (gtype == null) {
          logger.error("Plan " + ptype.getName() + " posts goal " + goalname
              + "which is not a known goal type.");
          return false;
        }
        // Found a goal posted by the plan, so setup the parent-child links
        ptype.addChild((byte) gtype.getId());
        gtype.addParent((byte) ptype.getId());
      }
    }
    return true;
  }
private static boolean completeGoalPlanHierarchy ( ) { for ( int i = 0 ; i < GlobalState . planTypes . size ( ) ; i ++ ) { PlanType ptype = ( PlanType ) GlobalState . planTypes . get ( i ) ; String [ ] postsGoals = getGoalsFromPlanInfoAnnotation ( ptype . getPlanClass ( ) ) ; // A @PlanInfo is optional, and only present if this plan posts goals if ( postsGoals == null ) { continue ; } // But if @PlanInfo was given then it cannot be incomplete if ( postsGoals . length == 0 ) { return false ; } // All good, so find the goals that this plan posts and set up the Goal-Plan tree links for ( String goalname : postsGoals ) { GoalType gtype = ( GoalType ) GlobalState . goalTypes . find ( goalname ) ; if ( gtype == null ) { logger . error ( "Plan " + ptype . getName ( ) + " posts goal " + goalname + "which is not a known goal type." ) ; return false ; } // Found a goal posted by the plan, so setup the parent-child links ptype . addChild ( ( byte ) gtype . getId ( ) ) ; gtype . addParent ( ( byte ) ptype . getId ( ) ) ; } } return true ; }
Completes the Goal-Plan hierarchy linkages between all {@link GlobalState#goalTypes} and
{@link GlobalState#planTypes}.

@return true if successful, false otherwise
Completes the Goal - Plan hierarchy linkages between all { @link GlobalState#goalTypes } and { @link GlobalState#planTypes } .