if (logger.isDebugEnabled()) logger.debug("Have "+actions.size()+" actions");
if (logger.isDebugEnabled()) logger.debug("Have "+((actions != null)?actions.size():0)+" actions");
    private CostBenefitEvaluation createCostBenefitEvaluation(StateEstimation se, CostBenefitKnob knob) {        AssetID assetID = se.getAssetID();        if (logger.isDebugEnabled()) logger.debug("Looking for actions for "+assetID);        CostBenefitEvaluation cbe =                 new CostBenefitEvaluation(assetID, knob.getHorizon(), se);        Collection actions = findActionCollection(assetID);        if (logger.isDebugEnabled()) logger.debug("Have "+actions.size()+" actions");        if (actions == null) return cbe; // No actions exist that even possibly apply - usually an initialization situation        Iterator actionsIter = actions.iterator();        // iterate over all applicable Actions for this asset        // compute the expected c-b for each based on StateEstimation        while (actionsIter.hasNext()) {            ActionsWrapper thisActionWrapper = (ActionsWrapper) actionsIter.next();            Action thisAction = thisActionWrapper.getAction();            try {                //call tech spec service & get action tech spec                  ActionTechSpecInterface atsi = (ActionTechSpecInterface) actionTechSpecService.getActionTechSpec(thisAction.getClass().getName());                if (atsi == null) {                    throw (new TechSpecNotFoundException( "Cannot find Action Tech Spec for "+ this.getClass().getName() ));                }                // Which StateDimension does this Action apply to?                AssetStateDimension asd = atsi.getStateDimension();                if (logger.isDebugEnabled()) logger.debug("This Action: "+thisAction+":"+atsi+":"+asd);                if (logger.isDebugEnabled()) logger.debug("StateEstimation: "+se.toString());                                try {                     // Get the StateDimensionEstimation for the dimension the Action applies to - Throws an exception if SDE not found                    StateDimensionEstimation currentEstimatedStateDimension = se.getStateDimensionEstimation(asd);                    if (logger.isDebugEnabled()) logger.debug("Current ESD: "+((currentEstimatedStateDimension==null)?"null":"cesd="+currentEstimatedStateDimension.toString()));                    // create the Action container that will hold the evaluations of all offered Variants                    ActionEvaluation thisActionEvaluation = new ActionEvaluation(thisAction);                    cbe.addActionEvaluation(thisActionEvaluation);                    /* Evaluate ALL variants of this Action, not just the ones currently offered                     * Selection will down-select to only the offered variants                     * We compute for all variants because the set of offered variants may change during the process of addressing a problem                     */                    // Get the TechSpec data for all the Variants                    Collection variantDescriptions = atsi.getActions();                    // iterate thru all offered Variants of this Action                    Iterator variantIter = variantDescriptions.iterator();                                        while (variantIter.hasNext()) {                        // Get TechSpec for this Variant                        ActionDescription thisVariantDescription = (ActionDescription) variantIter.next();                        // Add an entry to the current Action containing the information about this Variant                        thisActionEvaluation.addVariantEvaluation(createVariantEvaluation(assetID, asd, currentEstimatedStateDimension, thisVariantDescription, knob));                     }                }                catch (BelievabilityException e) {                    logger.error("Cannot find StateDimensionEstimate for "+asd.toString());                }             }            catch (TechSpecNotFoundException e) {                if (logger.isErrorEnabled()) logger.error("Cannot find Action Tech Spec for "+ this.getClass().getName() );            }        }        return cbe;    }