Add microbenchmarks with script for analyzing our Prefetch and other results
[IRC.git] / Robust / src / Benchmarks / Prefetch / MicroBenchmarks / Metropolis.java
diff --git a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/Metropolis.java b/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/Metropolis.java
new file mode 100644 (file)
index 0000000..4651c54
--- /dev/null
@@ -0,0 +1,14 @@
+public class Metropolis {
+  public static void main(String[] args) {
+    int N = Integer.parseInt(args[0]);
+    double kT = Double.parseDouble(args[1]);
+    StdDraw.setXscale(0, N);
+    StdDraw.setYscale(0, N);
+    State state = new State(N, 0.5);
+    while (true) {
+      state.phase(kT);
+      state.draw();
+      StdDraw.show(50);
+    }
+  }
+}