private void processElementGamma ( GeneratorSingleCluster cluster , Node cur ) { double k = 1.0 ; double theta = 1.0 ; String kstr = ( ( Element ) cur ) . getAttribute ( ATTR_K ) ; if ( kstr != null && kstr . length ( ) > 0 ) { k = ParseUtil . parseDouble ( kstr ) ; } String thetastr = ( ( Element ) cur ) . getAttribute ( ATTR_THETA ) ; if ( thetastr != null && thetastr . length ( ) > 0 ) { theta = ParseUtil . parseDouble ( thetastr ) ; } // *** New normal distribution generator Random random = cluster . getNewRandomGenerator ( ) ; Distribution generator = new GammaDistribution ( k , theta , random ) ; cluster . addGenerator ( generator ) ; // TODO: check for unknown attributes. XMLNodeIterator iter = new XMLNodeIterator ( cur . getFirstChild ( ) ) ; while ( iter . hasNext ( ) ) { Node child = iter . next ( ) ; if ( child . getNodeType ( ) == Node . ELEMENT_NODE ) { LOG . warning ( "Unknown element in XML specification file: " + child . getNodeName ( ) ) ; } } }
Process a gamma Element in the XML stream .