00001
00002
00003
00004
00005
00006
00007 package edu.tum.cs.bayesnets.inference;
00008
00009 import java.lang.reflect.InvocationTargetException;
00010
00011 import edu.tum.cs.bayesnets.core.BeliefNetworkEx;
00012
00013 public enum Algorithm {
00014 LikelihoodWeighting("likelihood weighting", LikelihoodWeighting.class),
00015 LWU("likelihood weighting with uncertain evidence", LikelihoodWeightingWithUncertainEvidence.class),
00016 GibbsSampling("Gibbs sampling (MCMC)", GibbsSampling.class),
00017 EPIS("importance sampling based on evidence prepropagation [SMILE]", SmileEPIS.class),
00018 BackwardSampling("backward simulation", BackwardSampling.class),
00019 BackwardSamplingPriors("backward simulation with prior bias", BackwardSamplingWithPriors.class),
00020 BackwardSamplingWithChildren("backward simulation with extended context", BackwardSamplingWithChildren.class),
00021 SmileBackwardSampling("backward simulation [SMILE]", SmileBackwardSampling.class),
00022 SATIS("SAT-IS: satisfiability-based importance sampling", SATIS_BSampler.class),
00023 SampleSearch("SampleSearch: backtracking search for satisfiable states", SampleSearch.class),
00024 IJGP("Iterative Join-Graph Propagation", IJGP.class),
00025 BeliefPropagation("Belief Propagation", BeliefPropagation.class),
00026 EnumerationAsk("Enumeration-Ask (exact, highly inefficient)", EnumerationAsk.class),
00027 Pearl("Pearl's algorithm for polytrees (exact)", BNJPearl.class),
00028 SmilePearl("Pearl's algorithm for polytrees (exact) [SMILE]", SmilePearl.class),
00029
00030 VarElim("variable elimination (exact)", VariableElimination.class),
00031 Experimental("an experimental algorithm (usually beta)", SampleSearch.class);
00032
00033 String description;
00034 Class<? extends Sampler> samplerClass;
00035
00036 private Algorithm(String description, Class<? extends Sampler> samplerClass) {
00037 this.description = description;
00038 this.samplerClass = samplerClass;
00039 }
00040
00041 public Sampler createSampler(BeliefNetworkEx bn) throws IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
00042 return samplerClass.getConstructor(bn.getClass()).newInstance(bn);
00043 }
00044
00045 public String getDescription() {
00046 return description;
00047 }
00048 }