HyperNEATUtil { public static List<Substrate> getSubstrateInformation(int inputWidth, int inputHeight, int numInputSubstrates, List<Triple<String, Integer, Integer>> output){ int processWidth = Parameters.parameters.integerParameter("HNProcessWidth"); int processDepth = Parameters.parameters.integerParameter("HNProcessDepth"); return getSubstrateInformation(inputWidth, inputHeight, numInputSubstrates, processWidth, processDepth, output); }  static void clearHyperNEATVisualizations(); static void resetSubstrates(); static List<DrawingPanel> drawSubstrates(ArrayList<Node> nodes); static DrawingPanel drawSubstrate(Substrate s, ArrayList<Node> nodes, int nodeIndexStart); static DrawingPanel drawSubstrate(DrawingPanel dp, Substrate s, ArrayList<Node> nodes, int nodeIndexStart); static HyperNEATTask getHyperNEATTask(); static Color regularVisualization(double activation); static List<DrawingPanel> drawWeight(TWEANNGenotype genotype, HyperNEATTask hnt); static int numBiasOutputsNeeded(); static int indexFirstBiasOutput(HyperNEATTask hnt); static int totalPossibleLinks(HyperNEATTask hnt); static List<Substrate> getSubstrateInformation(int inputWidth, int inputHeight, int numInputSubstrates, List<Triple<String, Integer, Integer>> output); static List<Substrate> getSubstrateInformation(int inputWidth, int inputHeight, int numInputSubstrates, int processWidth, int processDepth, List<Triple<String, Integer, Integer>> output); static List<Triple<String, String,Boolean>> getSubstrateConnectivity(int numInputSubstrates, List<String> outputNames); static List<Triple<String, String,Boolean>> getSubstrateConnectivity(int numInputSubstrates, List<String> outputNames, boolean connectInputsToOutputs); static List<Triple<String, String,Boolean>> getSubstrateConnectivity(int numInputSubstrates, int processWidth, int processDepth, List<String> outputNames); static List<Triple<String, String,Boolean>> getSubstrateConnectivity(int numInputSubstrates, int processWidth, int processDepth, List<String> outputNames, boolean connectInputsToOutputs); static int numCPPNOutputs(); static int numCPPNInputs(); static int numCPPNInputs(HyperNEATTask task); final static int LINK_WINDOW_SPACING; final static int SUBS_GRID_SIZE; final static int WEIGHT_GRID_SIZE; }
@Test public void testGetSubstrateInformationHyperNEAT(){ List<Triple<String, Integer, Integer>> output = new ArrayList<Triple<String, Integer, Integer>>(); output.add(new Triple<String, Integer, Integer>("o1", 5, 5)); output.add(new Triple<String, Integer, Integer>("o2", 10, 10)); output.add(new Triple<String, Integer, Integer>("o3", 1, 1)); List<Substrate> test = HyperNEATUtil.getSubstrateInformation(10, 20, 3, 2, 3, output); for(int i = 0; i < 9; i++){ assertEquals(test.get(i).getSize(), new Pair<Integer, Integer>(10, 20)); } assertEquals(test.get(9).getSize(), new Pair<Integer, Integer>(5, 5)); assertEquals(test.get(10).getSize(), new Pair<Integer, Integer>(10, 10)); assertEquals(test.get(11).getSize(), new Pair<Integer, Integer>(1, 1)); for(int i = 0; i < 3; i++){ assertEquals(test.get(i).getName(), "Input(" + i + ")"); } int index = 3; for(int i = 0; i < 3; i++){ for(int j = 0; j < 2; j++){ assertEquals(test.get(index++).getName(), "process(" + j + "," + i + ")"); } } assertEquals(test.get(9).getName(), "o1"); assertEquals(test.get(10).getName(), "o2"); assertEquals(test.get(11).getName(), "o3"); }