+class TestPerformancePattern extends TestPattern {
+
+ final BasicParameter ops = new BasicParameter("OPS", 0);
+ final BasicParameter iter = new BasicParameter("ITER", 0);
+
+ TestPerformancePattern(GLucose glucose) {
+ super(glucose);
+ addParameter(ops);
+ addParameter(iter);
+ }
+
+ public void run(double deltaMs) {
+ if (iter.getValuef() > 0.5) {
+ for (int i = 0; i < colors.length; ++i) {
+ float x = 1;
+ for (int j = 0; j < ops.getValuef() * 30; ++j) {
+ x *= random(0, 1);
+ }
+ colors[i] = lx.hsb(
+ (lx.getBaseHuef() + model.px[i]*.2 + model.py[i]*.4) % 360,
+ 100,
+ 100
+ );
+ }
+ } else {
+ for (Point p : model.points) {
+ float x = 1;
+ for (int j = 0; j < ops.getValuef() * 30; ++j) {
+ x *= random(0, 1);
+ }
+ colors[p.index] = lx.hsb(
+ (lx.getBaseHuef() + p.x*.2 + p.y*.4) % 360,
+ 100,
+ 100
+ );
+ }
+ }
+ }
+}
+