Package barsuift.simLife.process

Examples of barsuift.simLife.process.ConditionalTaskState


        int nbBranches = Randomizer.randomBetween(30, 50);
        List<TreeBranchState> branches = new ArrayList<TreeBranchState>(nbBranches);
        for (int i = 0; i < nbBranches; i++) {
            branches.add(createRandomTreeBranchState());
        }
        ConditionalTaskState photosynthesis = UtilDataCreatorForTests.createRandomConditionalTaskState();
        ConditionalTaskState aging = UtilDataCreatorForTests.createRandomConditionalTaskState();
        ConditionalTaskState growth = UtilDataCreatorForTests.createRandomConditionalTaskState();
        TreeTrunkState trunkState = createRandomTreeTrunkState();
        float height = (float) Math.random();
        Tree3DState tree3dState = DisplayDataCreatorForTests.createRandomTree3DState();
        return new TreeState(age, energy, branches, photosynthesis, aging, growth, trunkState, height, tree3dState);
    }
View Full Code Here


        int nbBranches = 40;
        List<TreeBranchState> branches = new ArrayList<TreeBranchState>(nbBranches);
        for (int i = 0; i < nbBranches; i++) {
            branches.add(createSpecificTreeBranchState());
        }
        ConditionalTaskState photosynthesis = UtilDataCreatorForTests.createSpecificConditionalTaskState();
        ConditionalTaskState aging = UtilDataCreatorForTests.createSpecificConditionalTaskState();
        ConditionalTaskState growth = UtilDataCreatorForTests.createSpecificConditionalTaskState();
        TreeTrunkState trunkState = createSpecificTreeTrunkState();
        float height = (float) 4;
        Tree3DState tree3dState = DisplayDataCreatorForTests.createRandomTree3DState();
        return new TreeState(age, energy, branches, photosynthesis, aging, growth, trunkState, height, tree3dState);
    }
View Full Code Here

     * </ul>
     */
    public static ConditionalTaskState createRandomConditionalTaskState() {
        CyclicConditionState executionCondition = createRandomCyclicConditionState();
        BoundConditionState endingCondition = createRandomBoundConditionState();
        return new ConditionalTaskState(executionCondition, endingCondition);
    }
View Full Code Here

     * </ul>
     */
    public static ConditionalTaskState createSpecificConditionalTaskState() {
        CyclicConditionState executionCondition = createSpecificCyclicConditionState();
        BoundConditionState endingCondition = createSpecificBoundConditionState();
        return new ConditionalTaskState(executionCondition, endingCondition);
    }
View Full Code Here

     * <li>conditionalTask made through {@link #createRandomConditionalTaskState()}</li>
     * <li>stepSize=[2-5]</li>
     * </ul>
     */
    public static SplitConditionalTaskState createRandomSplitConditionalTaskState() {
        ConditionalTaskState conditionalTask = createRandomConditionalTaskState();
        int stepSize = Randomizer.randomBetween(2, 5);
        return new SplitConditionalTaskState(conditionalTask, stepSize);
    }
View Full Code Here

     * <li>conditionalTask made through {@link #createSpecificConditionalTaskState()}</li>
     * <li>stepSize=3</li>
     * </ul>
     */
    public static SplitConditionalTaskState createSpecificSplitConditionalTaskState() {
        ConditionalTaskState conditionalTask = createSpecificConditionalTaskState();
        int stepSize = 3;
        return new SplitConditionalTaskState(conditionalTask, stepSize);
    }
View Full Code Here

        List<TreeBranchState> branches = new ArrayList<TreeBranchState>(nbBranches);
        for (int i = 0; i < nbBranches; i++) {
            branches.add(computeRandomBranchState(radius, height));
        }
        ConditionalTaskStateFactory taskStateFactory = new ConditionalTaskStateFactory();
        ConditionalTaskState photosynthesis = taskStateFactory.createConditionalTaskState(Photosynthesis.class);
        ConditionalTaskState aging = taskStateFactory.createConditionalTaskState(Aging.class);
        ConditionalTaskState growth = taskStateFactory.createConditionalTaskState(TreeGrowth.class);
        TreeTrunkStateFactory trunkStateFactory = new TreeTrunkStateFactory();
        TreeTrunkState trunkState = trunkStateFactory.createRandomTreeTrunkState(radius, height);

        Tree3DStateFactory tree3DStateFactory = new Tree3DStateFactory();
        Tree3DState tree3dState = tree3DStateFactory.createRandomTree3DState(new Tuple3dState(translationVector));
View Full Code Here

    @Override
    public void setFpsShowing(boolean fpsShowing) {
        if (fpsShowing) {
            fpsCounter.reset();
            ConditionalTaskStateFactory taskStateFactory = new ConditionalTaskStateFactory();
            ConditionalTaskState fpsTickerState = taskStateFactory.createConditionalTaskState(FpsTicker.class);
            fpsTicker = new FpsTicker(fpsTickerState, fpsCounter);
            universe.getSynchronizer().schedule(fpsTicker);
        } else {
            if (this.fpsShowing) {
                // only unschedule the fpsTicker if it was previously scheduled
View Full Code Here

        this.environment = new BasicEnvironment(state.getEnvironment());
        this.physics = new BasicPhysics(this, state.getPhysics());
        this.synchronizer = new BasicSynchronizerCore(state.getSynchronizerState());
        this.dateHandler = new DateHandler(state.getDateHandler());
        ConditionalTaskStateFactory taskStateFactory = new ConditionalTaskStateFactory();
        ConditionalTaskState dateUpdaterState = taskStateFactory.createConditionalTaskState(DateUpdater.class);
        DateUpdater dateUpdater = new DateUpdater(dateUpdaterState, dateHandler.getDate());
        synchronizer.schedule(dateUpdater);
        this.trees = new HashSet<Tree>();
        Set<TreeState> treeStates = state.getTrees();
        for (TreeState treeState : treeStates) {
View Full Code Here

        this.energy = new BigDecimal(0);
        this.branches = new ArrayList<TreeBranchState>();
        this.height = 0;
        this.trunkState = new TreeTrunkState();
        this.tree3DState = new Tree3DState();
        this.photosynthesis = new ConditionalTaskState();
        this.aging = new ConditionalTaskState();
        this.growth = new ConditionalTaskState();
    }
View Full Code Here

TOP

Related Classes of barsuift.simLife.process.ConditionalTaskState

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.