private int findIndex2(String rule) { rule = rule.trim(); if (rule.startsWith("m")) { int n = Integer.parseInt(rule.substring(1)); return -1 * Math.abs(n); } return Integer.parseInt(rule); }
private int random(int n) { return (int) (Math.random() * n); }
public double h(double v) throws Exception { double v1 = find(o1, v); double v2 = find(o2, v); return Math.pow(v1, v2); }
protected int distanceTo(int[] p1, int[] p2) { return Math.abs(p1[0] - p2[0]) + Math.abs(p1[1] - p2[1]); }
public double h(double v) throws Exception { double v1 = h1.h(v); double v2 = h2.h(v); return Math.pow(v1, v2); }