if (logger.isDebugEnabled()) logger.debug("Found a transition for: "+startStateName+", "+atwc.toString());
if (logger.isDebugEnabled()) logger.debug("Found a transition for: "+ thisVariantDescription.name() + " for start state " + startStateName+" is "+atwc.toString());
   private VariantEvaluation createVariantEvaluation            (AssetID assetID, AssetStateDimension asd, StateDimensionEstimation currentStateDimensionEstimation, ActionDescription thisVariantDescription, CostBenefitKnob knob) {        double memorySize = 1000.0; // FIX _ needs to be dynamic        double bandwidthSize = 1000.0; // FIX -needs to be dynamic        double predictedCost = 0.0;        double predictedBenefit = 0.0;        long maxTransitionTime = 0L;        long horizon = knob.getHorizon();        Vector startStateVector = asd.getPossibleStates();        Iterator startStateIterator = startStateVector.iterator();        while (startStateIterator.hasNext()) {            AssetState startState = (AssetState) startStateIterator.next();            String startStateName = startState.getName();            double startStateProb;            double startStateBenefit;            double intermediateStateBenefit;            double endStateBenefit;            long transitionTime;            ActionCost oneTimeCost;            ActionCost continuingCost;            try {                startStateProb = currentStateDimensionEstimation.getProbability(startStateName);                AssetTransitionWithCost atwc = thisVariantDescription.getTransitionForState(startState);                if (atwc != null) { // the TechSpecs define a transition by this Variant for this state                    if (logger.isDebugEnabled()) logger.debug("Found a transition for: "+startStateName+", "+atwc.toString());                    startStateBenefit = computeStateBenefit(startState, knob);                    intermediateStateBenefit = computeStateBenefit(atwc.getIntermediateValue(), knob);                    endStateBenefit = computeStateBenefit(atwc.getEndValue(), knob);                    transitionTime = (atwc.getOneTimeCost()!=null)?atwc.getOneTimeCost().getTimeCost():0L; // assume for now that 1-time costs are all expressed in terms of time (and maybe other factors also)                    oneTimeCost = atwc.getOneTimeCost();                    continuingCost = atwc.getContinuingCost();                    if (horizon >= transitionTime)  { // the normal case                        predictedBenefit = predictedBenefit + startStateProb*(transitionTime*intermediateStateBenefit + (horizon-transitionTime)*endStateBenefit - horizon*startStateBenefit);                        predictedCost = predictedCost + startStateProb*(transitionTime                                * aggregateCost(oneTimeCost, memorySize, bandwidthSize) + (horizon-transitionTime)*aggregateCost(continuingCost, memorySize, bandwidthSize));                        }                    else  { // transition takes longer than the planning horizon, so action transition will not complete                        predictedBenefit = predictedBenefit + startStateProb*(horizon*intermediateStateBenefit - horizon*startStateBenefit);                        predictedCost = predictedCost + startStateProb*(horizon*aggregateCost(oneTimeCost, memorySize, bandwidthSize));                        }                    if (logger.isDebugEnabled()) logger.debug("**** "+startStateName+":"+startStateProb+":"+horizon+":"+transitionTime+":"+predictedCost);                    maxTransitionTime = Math.max(maxTransitionTime, transitionTime);                                        }               }            catch (BelievabilityException e) {                // Should be impossible to get here if the ActionDescription is correctly populated                throw new RuntimeException("Could not find an AssetState that the ActionDescription said it had");                }        }        return new VariantEvaluation(thisVariantDescription, predictedCost, predictedBenefit, maxTransitionTime);    }}