/** Test of getMaxValue method, of class ParameterisedGroup. */ @Test public void testGetMaxValue() throws ParameterException { System.out.println("--- testGetMaxValue..."); assertEquals(1, pg1.getMaxValue(cell), 0); assertEquals(30, pg2.getMaxValue(cell), 0); }
/** Test of evaluateAt method, of class ParameterisedGroup. */ @Test public void testEvaluateAt() throws ParameterException { System.out.println("--- testEvaluateAt..."); // SegmentLocation loc1 = new PostSynapticTerminalLocation(d2.getSegmentId(), 0.5f); assertEquals(0.5, pg1.evaluateAt(cell, d2, 0.5f), 0); assertEquals(15, pg2.evaluateAt(cell, d2, 0.5f), 0); //////// assertEquals(15, pg5.evaluateAt(cell, loc1), 0); // SegmentLocation loc2 = new PostSynapticTerminalLocation(d3.getSegmentId(), 0.5f); assertEquals(5d / 6d, pg1.evaluateAt(cell, d3, 0.5f), 1e-7); assertEquals(25, pg2.evaluateAt(cell, d3, 0.5f), 0); assertEquals(0.5, pg3.evaluateAt(cell, d3, 0.5f), 0); assertEquals(0, pg4.evaluateAt(cell, d3, 0), 0); assertEquals(5, pg4.evaluateAt(cell, d3, 0.5f), 0); SegmentLocation sl1 = new SegmentLocation(d3.getSegmentId(), 0.5f); assertEquals( 25, pg5.evaluateAt(cell, cell.getSegmentWithId(sl1.getSegmentId()), sl1.getFractAlong()), 0); assertEquals(30, pg5.evaluateAt(cell, d3, 1), 0); GenesisCompartmentalisation g = new GenesisCompartmentalisation(); Cell gCell = g.getCompartmentalisation(cell); System.out.println(CellTopologyHelper.printDetails(cell, null)); System.out.println( "Changed from morph: " + cell.getMorphSummary() + ", to morph: " + gCell.getMorphSummary()); System.out.println("getSegmentMapper: " + g.getSegmentMapper()); System.out.println(CellTopologyHelper.printDetails(gCell, null)); SegmentLocation sl1_g = g.getSegmentMapper().mapSegmentLocation(sl1); System.out.println("Mapped: " + sl1 + " to " + sl1_g); assertEquals( 25, pg5.evaluateAt(gCell, gCell.getSegmentWithId(sl1_g.getSegmentId()), sl1_g.getFractAlong()), 0); }
@Test public void testCloneEquals() { System.out.println("--- testCloneEquals..."); ParameterisedGroup pg1a = (ParameterisedGroup) pg1.clone(); System.out.println("Checking: " + pg1a); System.out.println("equals: " + pg1a); assertEquals(pg1a, pg1); pg1.setProximalPref(ProximalPref.NO_TRANSLATION); System.out.println("Checking: " + pg1a); System.out.println("NOT equals: " + pg1a); assertNotSame(pg1, pg1a); }