public final double doOperation() throws OperatorFailedException {
  final double scale=(scaleFactor + (MathUtils.nextDouble() * ((1.0 / scaleFactor) - scaleFactor)));
  int goingUp=0, goingDown=0;
  if (upParameter != null) {
    for (    Scalable up : upParameter) {
      goingUp+=up.scale(scale,-1);
    }
  }
  if (downParameter != null) {
    for (    Scalable dn : downParameter) {
      goingDown+=dn.scale(1.0 / scale,-1);
    }
  }
  return (goingUp - goingDown - 2) * Math.log(scale);
}

public final double doOperation ( ) throws OperatorFailedException { final double scale = ( scaleFactor + ( MathUtils . nextDouble ( ) * ( ( 1.0 / scaleFactor ) - scaleFactor ) ) ) ; int goingUp = 0 , goingDown = 0 ; if ( upParameter != null ) { for ( Scalable up : upParameter ) { goingUp += up . scale ( scale , - 1 ) ; } } if ( downParameter != null ) { for ( Scalable dn : downParameter ) { goingDown += dn . scale ( 1.0 / scale , - 1 ) ; } } return ( goingUp - goingDown - 2 ) * Math . log ( scale ) ; }
change the parameter and return the hastings ratio .
