Package ptolemy.domains.fsm.kernel

Examples of ptolemy.domains.fsm.kernel.FSMActor.currentState()


            _debug("Firing " + getFullName(), " at time " + getModelTime());
        }
        FSMActor controller = getController();
        // Read the inputs from the environment.
        controller.readInputs();
        State st = controller.currentState();

        // Chose a preemptive transition, if there is one,
        // and execute its choice actions.
        // The choice actions are the outputActions, not the setActions.
        Transition tr = controller.chooseTransition(st
View Full Code Here


            return result;
        }
        try {
            // Check whether there is any preemptive transition enabled.
            FSMActor controller = getController();
            State currentState = controller.currentState();
            List preemptiveEnabledTransitions = controller
                    .enabledTransitions(currentState.preemptiveTransitionList());

            if (preemptiveEnabledTransitions.size() != 0) {
                if (_debugging && _verbose) {
View Full Code Here

        CompositeActor container = (CompositeActor) getContainer();
        FSMActor controller = getController();
        controller.setNewIteration(_sendRequest);
        _readInputs();

        State currentState = controller.currentState();

        Actor[] actors = currentState.getRefinement();

        // NOTE: Paranoid coding.
        if ((actors == null) || (actors.length != 1)) {
View Full Code Here

            ChangeRequest request = new ChangeRequest(this,
                    "choose a transition") {
                protected void _execute() throws KernelException,
                        IllegalActionException {
                    FSMActor controller = getController();
                    State currentState = controller.currentState();
                    chooseNextNonTransientState(currentState);
                }
            };

            request.setPersistent(false);
View Full Code Here

        if (_debugging) {
            _debug(getName(), " fire.");
        }

        FSMActor ctrl = getController();
        State currentState = ctrl.currentState();

        ctrl.readInputs();

        Transition transition;
View Full Code Here

     */
    public void initialize() throws IllegalActionException {
        super.initialize();

        FSMActor ctrl = getController();
        State currentState = ctrl.currentState();

        _enabledRefinements = new LinkedList();

        Actor[] actors = currentState.getRefinement();

View Full Code Here

        // All non-preemptive and preemptive transitions are checked below,
        // because even if a preemptive transition is enabled, the non-preemptive
        // transitions never even get a chance to be evaluated.
        try {
            FSMActor ctrl = getController();
            State currentState = ctrl.currentState();
            // Check if there is any preemptive transition enabled.
            List preemptiveEnabledTransitions = ctrl
                    .enabledTransitions(currentState.preemptiveTransitionList());

            if (preemptiveEnabledTransitions.size() != 0) {
View Full Code Here

     */
    public boolean postfire() throws IllegalActionException {
        boolean postfireReturns = true;

        FSMActor ctrl = getController();
        State currentState = ctrl.currentState();

        CompositeActor container = (CompositeActor) getContainer();
        Director executiveDirector = container.getExecutiveDirector();
        Iterator refinements = _enabledRefinements.iterator();

View Full Code Here

     *  state, or the prefire() method of refinements throw it, or the super
     class throws it.
     */
    public boolean prefire() throws IllegalActionException {
        FSMActor ctrl = getController();
        State currentState = ctrl.currentState();

        if (_debugging) {
            _debug(getName(), " find FSMActor " + ctrl.getName()
                    + " and the current state is " + currentState.getName());
        }
View Full Code Here

                        }
                    }
                }
            } else {
                // Optimistic approximation
                Actor[] actors = controller.currentState().getRefinement();
                // If the modal model has no refinements, the modal model is
                // basically an FSM actor. We use the function dependency of
                // the controller instead.
                if ((actors != null) && (actors.length > 0)) {
                    for (int i = 0; i < actors.length; ++i) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.