Examples of Firing


Examples of ptolemy.actor.sched.Firing

            }
            Schedule schedule = new Schedule();
            Iterator sortedActorsIterator = sortedActors.iterator();
            while (sortedActorsIterator.hasNext()) {
                Actor actor = (Actor) sortedActorsIterator.next();
                Firing firing = new Firing();
                firing.setActor(actor);
                schedule.add(firing);
            }

            return schedule;
        }
View Full Code Here

Examples of ptolemy.actor.sched.Firing

            } catch (Exception ex) {
                throw new KernelRuntimeException(ex, "Failed to get schedule");
            }

            while (schedule.hasNext()) {
                Firing firing = (Firing) schedule.next();

                Entity entity = (Entity) firing.getActor();
                int firingCount = firing.getIterationCount();
                String fieldName = ModelTransformer.getFieldNameForEntity(
                        entity, model);
                SootField field = modelClass.getFieldByName(fieldName);
                String className = ModelTransformer.getInstanceClassName(
                        entity, options);
View Full Code Here

Examples of ptolemy.actor.sched.Firing

            for (i = 0; i < actorCount; i++) {
                Actor actor = (Actor) actorListIterator.next();

                if ((_giottoSchedulerTime % intervalArray[i]) == 0) {
                    fireAtSameTimeSchedule.add(new Firing(actor));
                }
            }

            _giottoSchedulerTime += 1;
View Full Code Here

Examples of ptolemy.actor.sched.Firing

        Schedule schedule = director.getScheduler().getSchedule();

        boolean isIDefined = false;
        Iterator actorsToFire = schedule.firingIterator();
        while (actorsToFire.hasNext()) {
            Firing firing = (Firing) actorsToFire.next();
            Actor actor = firing.getActor();

            // FIXME: Before looking for a helper class, we should check to
            // see whether the actor contains a code generator attribute.
            // If it does, we should use that as the helper.
            CodeGeneratorHelper helper = (CodeGeneratorHelper) _getHelper((NamedObj) actor);

            if (inline) {
                for (int i = 0; i < firing.getIterationCount(); i++) {

                    // generate fire code for the actor
                    code.append(helper.generateFireCode());
                    code.append(helper.generateTypeConvertFireCode());

                    // update buffer offset after firing each actor once
                    Iterator inputPorts = actor.inputPortList().iterator();
                    while (inputPorts.hasNext()) {
                        IOPort port = (IOPort) inputPorts.next();
                        int rate = DFUtilities.getRate(port);
                        _updatePortOffset(port, code, rate);
                    }

                    Iterator outputPorts = actor.outputPortList().iterator();
                    while (outputPorts.hasNext()) {
                        IOPort port = (IOPort) outputPorts.next();
                        int rate = DFUtilities.getRate(port);
                        _updateConnectedPortsOffset(port, code, rate);
                    }
                }
            } else {

                int count = firing.getIterationCount();
                if (count > 1) {
                    if (!isIDefined) {
                        code.append(CodeStream.indent("int i;" + _eol));
                        isIDefined = true;
                    }
View Full Code Here

Examples of ptolemy.actor.sched.Firing

                        int firingsPerLocalIteration = 0;
                        Schedule schedule = _schedules[configurationNumber];
                        if (schedule != null) {
                            Iterator firings = schedule.firingIterator();
                            while (firings.hasNext()) {
                                Firing firing = (Firing) firings.next();
                                if (firing.getActor() == actor) {
                                    firingsPerLocalIteration += firing
                                            .getIterationCount();
                                }
                            }
                        }
                        // key statement here
View Full Code Here

Examples of ptolemy.actor.sched.Firing

                continue;
            }

            Iterator actorsToFire = schedule.firingIterator();
            while (actorsToFire.hasNext()) {
                Firing firing = (Firing) actorsToFire.next();
                Actor actor = firing.getActor();

                // Find the actor number for the given actor.
                // Actors are numbered in the order as in the list returned
                // by deepEntityList().
                int actorNumber = 0;
                Iterator actors = container.deepEntityList().iterator();
                while (actors.hasNext()) {
                    if (actors.next() == actor) {
                        break;
                    }
                    actorNumber++;
                }

                CodeGeneratorHelper helper = (CodeGeneratorHelper) _getHelper((NamedObj) actor);
                int[][] rates = helper.getRates();

                if (inline) {
                    for (int i = 0; i < firing.getIterationCount(); i++) {

                        // generate fire code for the actor
                        code.append(helper.generateFireCode());
                        code.append(helper.generateTypeConvertFireCode());

                        // update buffer offset after firing each actor once
                        Iterator ports = ((Entity) actor).portList().iterator();
                        int j = 0; // j is the port number
                        while (ports.hasNext()) {
                            IOPort port = (IOPort) ports.next();
                            int rate;
                            if (rates != null) {
                                rate = rates[actorConfigurations[actorNumber]][j];
                            } else {
                                rate = DFUtilities.getRate(port);
                            }
                            if (port.isInput()) {
                                _updatePortOffset(port, code, rate);
                            } else {
                                _updateConnectedPortsOffset(port, code, rate);
                            }
                            j++;
                        }
                    }
                } else {

                    int count = firing.getIterationCount();
                    if (count > 1) {
                        code.append("for (i = 0; i < " + count + " ; i++) {"
                                + _eol);
                    }
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.