Package barsuift.simLife.universe

Examples of barsuift.simLife.universe.MockUniverse


        Percent lightRate = new Percent(70);
        mockSun = new MockSun();
        mockSun.setLuminosity(lightRate);
        MockEnvironment mockEnv = new MockEnvironment();
        mockEnv.setSun(mockSun);
        universe = new MockUniverse();
        universe.setEnvironment(mockEnv);

        leaf = new BasicTreeLeaf(universe, leafState);
        observerHelper = new ObservableTestHelper();
        attachLeaf3DIn3dStructure();
View Full Code Here


    private BasicTreeLeafFactory factory;

    protected void setUp() throws Exception {
        super.setUp();
        Universe universe = new MockUniverse();
        factory = new BasicTreeLeafFactory(universe);
    }
View Full Code Here

    private BasicTreeBranch branch;

    protected void setUp() throws Exception {
        super.setUp();
        universe = new MockUniverse();
        branchState = CoreDataCreatorForTests.createSpecificTreeBranchState();
        branch = new BasicTreeBranch(universe, branchState);
    }
View Full Code Here

    private BasicTree tree;

    protected void setUp() throws Exception {
        super.setUp();
        universe = new MockUniverse();
        treeState = CoreDataCreatorForTests.createSpecificTreeState();
        tree = new BasicTree(universe, treeState);
    }
View Full Code Here

    private TreeLeafState firstLeafState;

    protected void setUp() throws Exception {
        super.setUp();
        universe = new MockUniverse();
        branchPartState = CoreDataCreatorForTests.createSpecificTreeBranchPartState();
        firstLeafState = branchPartState.getLeaveStates().get(0);
        firstLeafState.setEfficiency(new Percent(10).getState());
        branchPart = new BasicTreeBranchPart(universe, branchPartState);
    }
View Full Code Here

        // it ends at 3.5
        // 0 ...... ...... 2 ...... 3 ... 3.5
        // the new leaf should be created around 1 (+/- 10% * distance -> 0.2)
        Point3d boundsStartPoint = new Point3d(0.8, 0, 0);
        Point3d boundsEndPoint = new Point3d(1.2, 0, 0);
        BasicTreeBranchPart part = new BasicTreeBranchPart(new MockUniverse(), partState);
        Point3d pointForNewLeaf = part.computeAttachPointForNewLeaf();
        PointTestHelper.assertPointIsWithinBounds(pointForNewLeaf, boundsStartPoint, boundsEndPoint);
    }
View Full Code Here

        // it ends at 7
        // 0 ...... 1 ...... ...... ...... ...... 5 ...... ...... 7
        // the new leaf should be created around 3 (+/- 10% * distance -> 0.4)
        Point3d boundsStartPoint = new Point3d(2.6, 0, 0);
        Point3d boundsEndPoint = new Point3d(3.4, 0, 0);
        BasicTreeBranchPart part = new BasicTreeBranchPart(new MockUniverse(), partState);
        Point3d pointForNewLeaf = part.computeAttachPointForNewLeaf();
        PointTestHelper.assertPointIsWithinBounds(pointForNewLeaf, boundsStartPoint, boundsEndPoint);
    }
View Full Code Here

        // it ends at 6
        // 0 ...... ...... 2 ...... 3 ...... ...... ...... 6
        // the new leaf should be created around 4.5 (+/- 10% * distance -> 0.3)
        Point3d boundsStartPoint = new Point3d(4.2, 0, 0);
        Point3d boundsEndPoint = new Point3d(4.8, 0, 0);
        BasicTreeBranchPart part = new BasicTreeBranchPart(new MockUniverse(), partState);
        Point3d pointForNewLeaf = part.computeAttachPointForNewLeaf();
        PointTestHelper.assertPointIsWithinBounds(pointForNewLeaf, boundsStartPoint, boundsEndPoint);
    }
View Full Code Here

        // it ends at 3.5
        // 0 ...... ...... 2 ...... 3 ... 3.5
        // the new leaf should be created around 1 (+/- 10% * distance -> 0.2)
        Point3d boundsStartPoint = new Point3d(0.8, 0, 0);
        Point3d boundsEndPoint = new Point3d(1.2, 0, 0);
        BasicTreeBranchPart part = new BasicTreeBranchPart(new MockUniverse(), partState);
        Point3d pointForNewLeaf = part.computeAttachPointForNewLeaf();
        PointTestHelper.assertPointIsWithinBounds(pointForNewLeaf, boundsStartPoint, boundsEndPoint);
    }
View Full Code Here

    public void testCreateOneNewLeaf() {
        // create object states
        TreeBranchPartState partState = new TreeBranchPartState();
        partState.setEnergy(new BigDecimal(150));
        BasicTreeBranchPart part = new BasicTreeBranchPart(new MockUniverse(), partState);

        assertEquals(0, part.getNbLeaves());
        assertEquals(0, part.getBranchPart3D().getLeaves().size());

        part.createOneNewLeaf();
View Full Code Here

TOP

Related Classes of barsuift.simLife.universe.MockUniverse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.