private void registerNeighbours ( Random rand , int count ) throws BeliefBaseException { int size = ( count < 0 ) ? 0 : count ; for ( int i = 0 ; i < size ; i ++ ) { boolean male = ( rand . nextDouble ( ) < 0.5 ) ? true : false ; this . addBelief ( beliefset , buildName ( male ) , male ? "male" : "female" ) ; } }
Helper function to add beliefs about neighbours .