Package ptolemy.codegen.c.actor

Examples of ptolemy.codegen.c.actor.TypedCompositeActor


            State state) throws IllegalActionException {

        ptolemy.domains.fsm.kernel.MultirateFSMDirector director = (ptolemy.domains.fsm.kernel.MultirateFSMDirector) getComponent();
        ptolemy.domains.fsm.kernel.FSMActor controller = director
                .getController();
        TypedCompositeActor containerHelper = (TypedCompositeActor) _getHelper(director
                .getContainer());
        Actor[] refinements = state.getRefinement();
        if (refinements == null) {
            return;
        }
        TypedCompositeActor refinementHelper = (TypedCompositeActor) _getHelper((NamedObj) refinements[0]);
        Iterator states = controller.entityList().iterator();
        int tempSum = 0;

        while (states.hasNext()) {
            State nextState = (State) states.next();
            Actor[] actors = nextState.getRefinement();
            if (actors != null) {
                TypedCompositeActor helper = (TypedCompositeActor) _getHelper((NamedObj) actors[0]);
                int[][] rates = helper.getRates();

                if (nextState == state) {
                    if (rates == null) { // only one internal configuration
                        codeBuffer.append(containerHelper
                                .processCode("$actorSymbol("
View Full Code Here


                    if (actors[0] instanceof CompositeActor) {
                        ptolemy.actor.Director localDirector = actors[0]
                                .getDirector();
                        if (localDirector instanceof ptolemy.domains.hdf.kernel.HDFDirector
                                || localDirector instanceof ptolemy.domains.hdf.kernel.HDFFSMDirector) {
                            TypedCompositeActor actorHelper = (TypedCompositeActor) _getHelper((NamedObj) actors[0]);
                            int[] arrayOfFiringsPerGlobalIterationOfActor = actorHelper
                                    .getFiringsPerGlobalIteration();
                            if (arrayOfFiringsPerGlobalIterationOfActor == null) {
                                arrayOfFiringsPerGlobalIterationOfActor = new int[length];
                                actorHelper
                                        .setFiringsPerGlobalIteration(arrayOfFiringsPerGlobalIterationOfActor);
                            }
                            arrayOfFiringsPerGlobalIterationOfActor[i] = firingsPerGlobalIterationOfContainer;
                        }
                    }
View Full Code Here

                        }
                        // key statement here
                        int firingsPerGlobalIterationOfActor = firingsPerLocalIteration
                                * firingsPerGlobalIterationOfContainer;

                        TypedCompositeActor actorHelper = (TypedCompositeActor) _getHelper((NamedObj) actor);
                        int[] arrayOfFiringsPerGlobalIterationOfActor = actorHelper
                                .getFiringsPerGlobalIteration();
                        if (arrayOfFiringsPerGlobalIterationOfActor != null) {
                            int temp = arrayOfFiringsPerGlobalIterationOfActor[actorConfigurations[actorNumber]];
                            // only the maximum matters
                            if (temp < firingsPerGlobalIterationOfActor) {
                                arrayOfFiringsPerGlobalIterationOfActor[actorConfigurations[actorNumber]] = firingsPerGlobalIterationOfActor;
                            }
                        } else {
                            arrayOfFiringsPerGlobalIterationOfActor = new int[actorHelper
                                    .getRates().length];
                            actorHelper
                                    .setFiringsPerGlobalIteration(arrayOfFiringsPerGlobalIterationOfActor);
                            arrayOfFiringsPerGlobalIterationOfActor[actorConfigurations[actorNumber]] = firingsPerGlobalIterationOfActor;
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of ptolemy.codegen.c.actor.TypedCompositeActor

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.