@Override public Value sample(Assignment condition){
  double prob=getProb(condition);
  if (sampler.nextDouble() < prob) {
    return ValueFactory.create(true);
  }
 else {
    return ValueFactory.create(false);
  }
}

@ Override public Value sample ( Assignment condition ) { double prob = getProb ( condition ) ; if ( sampler . nextDouble ( ) < prob ) { return ValueFactory . create ( true ) ; } else { return ValueFactory . create ( false ) ; } }
generates a sample from the distribution given the conditional assignment .
