logDetail( "Threat transition matrix: "
if ( _logger.isDetailEnabled() ) _logger.detail( "Threat transition matrix: "
    void updateBeliefStateThreatTrans( BeliefStateDimension prev_belief,                                       long start_time,                                       long end_time,                                       BeliefStateDimension next_belief )            throws BelievabilityException    {        // The updating of the belief state due to threats is a        // relatively complicated process.  The complication comes        // from the fact that we must allow multiple threats to cause        // the same event, and even allow multiple events to affect        // the state dimension of an asset.  We have models for how        // the threats and events act individually, but no models        // about how they act in combination.  Our job here is trying        // to estimate what effect these threats and events could have        // on the asset state dimension. (Note that threats cause        // events in the techspec model.        //        // Note that making a simplifying asumption that only one        // event will occur at a time does not help us in this        // computation: we are not trying to adjust after the fact        // when we *know* an event occurred; we are trying to deduce        // which of any number of events might have occurred.  Thus,        // we really do need to reason about combinations of events.        //        // The prospect of having the techspec encode the full joint        // probability distributions for a events is not something        // that will be managable, so we must live with the individual        // models and make some assumptions.  At the heart of the        // assumption sare that threats that can generate a given        // event will do so independently, and among multiple events,        // they too act independently.        //         // Details of the calculations and assumptions are found in        // the parts of the code where the calculations occur.        //        // All the complications of handling multiple threats happens        // in this method call.        //        double[][] trans_matrix                = _asset_dim_model.getThreatTransitionMatrix                ( prev_belief.getAssetID(),                  start_time,                  end_time );        logDetail( "Threat transition matrix: "                   + _asset_dim_model.getStateDimensionName() + "\n"                   + ProbabilityUtils.arrayToString( trans_matrix ));        double[] prev_belief_prob = prev_belief.getProbabilityArray();        double[] next_belief_prob = new double[prev_belief_prob.length];        // The event transition matrix will model how the asset state        // transitions occur.  We now need to fold this into the        // current belief sate to produce the next belief state.        //        for ( int cur_state = 0;               cur_state < prev_belief_prob.length;               cur_state++ )         {                        for ( int next_state = 0;                   next_state < prev_belief_prob.length;                   next_state++ )             {                next_belief_prob[next_state]                         += prev_belief_prob[cur_state]                          * trans_matrix[cur_state][next_state];                            } // for next_state        }  // for cur_state        // We do this before the sanity check, but maybe this isn't        // the right thing to do. For now, it allows me to more easily        // convert it to a string in the case where there is a        // problem.         //        next_belief.setProbabilityArray( next_belief_prob );        // Add a sanity check to prevent bogus belief from being        // propogated to other computations.         //        double sum = 0.0;        for ( int i = 0; i < next_belief_prob.length; i++ )            sum += next_belief_prob[i];        if( ! Precision.isZeroComputation( 1.0 - sum ))            throw new BelievabilityException                    ( "updateBeliefStateThreatTrans()",                      "Resulting belief doesn't sum to 1.0 : "                      + next_belief.toString() );    } // method updateBeliefStateThreatTrans