Package ptolemy.actor

Examples of ptolemy.actor.TypedCompositeActor


            //parser.setErrorHandler(new StreamErrorHandler());
            // We use parse(URL, URL) here instead of parseFile(String)
            // because parseFile() works best on relative pathnames and
            // has problems finding resources like files specified in
            // parameters if the xml file was specified as an absolute path.
            TypedCompositeActor toplevel = (TypedCompositeActor) parser.parse(
                    null, new File(args[0]).toURI().toURL());

            System.out.println(generateGiottoCode(toplevel));
        } catch (Throwable ex) {
            System.err.println("Command failed: " + ex);
View Full Code Here


        int N = ((IntToken) nInstances.getToken()).intValue();

        // Make sure instance is correct (ignore any user errors :)
        instance.setToken(new IntToken(0));

        TypedCompositeActor container = (TypedCompositeActor) getContainer();

        // Now instantiate the clones and connect them to the model
        for (int i = 1; i < N; i++) {
            MultiInstanceComposite clone = (MultiInstanceComposite) container
                    .getEntity(getName() + "_" + i);

            if (clone == null) {
                try {
                    clone = (MultiInstanceComposite) _cloneClone(container
                            .workspace());
                } catch (CloneNotSupportedException ex) {
                    throw new IllegalActionException(this, ex, "Clone failed.");
                }
                try {
View Full Code Here

        // Note: wrapup() is called on any normal or abnormal run
        // termination. When embedded in a class that has already been
        // removed from its container, nContext may be eventually
        // referring to an undefined expression, so don't try getToken()
        // on it.
        TypedCompositeActor container = (TypedCompositeActor) getContainer();

        if (container == null) {
            return;
        }

        int i = 1;
        while (true) {
            // FIXME: Using a naming convention here is fragile!
            MultiInstanceComposite clone = (MultiInstanceComposite) container
                    .getEntity(getName() + "_" + i);
            if (clone == null) {
                break;
            }
            ++i;
View Full Code Here

TOP

Related Classes of ptolemy.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.