private static boolean processPlansForGoal ( GoalType gtype , String [ ] plans ) { for ( int j = 0 ; j < plans . length ; j ++ ) { // Load the Plan class Class < ? > pclass = loadClass ( plans [ j ] , Plan . class ) ; if ( pclass == null ) { return false ; } // Found the plan class, so add this plan to the catalog of known plan types logger . info ( "Found Plan " + pclass . getName ( ) + " that handles Goal " + gtype . getName ( ) ) ; PlanType ptype = new PlanType ( pclass . getName ( ) ) ; ptype . setPlanClass ( pclass ) ; GlobalState . planTypes . push ( ptype ) ; // Set up the parent/child links between them (makings of a goal-plan tree) ptype . addParent ( ( byte ) gtype . getId ( ) ) ; gtype . addChild ( ( byte ) ptype . getId ( ) ) ; } return true ; }
Loads the given plan classes and sets up parent - child links with the given goal type .