Package ptolemy.actor.lib

Examples of ptolemy.actor.lib.Clock


        Parameter stopTime = (Parameter) director.getAttribute("stopTime");
        stopTime.setToken(new DoubleToken(57.0));
        topLevelActor.setManager(manager);

        // Set up next level actors
        Clock vowelSrc = new Clock(topLevelActor, "vowelSrc");
        vowelSrc.values.setExpression("{1,1,1,1,1,1,1,1,1,1,1,1,1}");
        vowelSrc.period.setToken(new DoubleToken(100.0));
        vowelSrc.offsets
                .setExpression("{0.5,2.0,5.0,7.0,8.0,11.0,12.5,13.5,14.0,15.5,17.5,19.5,20.5}");
        vowelSrc.stopTime.setToken(new DoubleToken(30.0));

        Clock consonantsSrc = new Clock(topLevelActor, "consonantsSrc");
        consonantsSrc.values
                .setExpression("{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}");
        consonantsSrc.period.setToken(new DoubleToken(100.0));
        consonantsSrc.offsets
                .setExpression("{0.0, 1.0, 1.5, 4.0, 4.5, 6.0, 6.5, 7.5, 8.5, 9.0, 10.0, 10.5, 12.0, 13.0, 14.5, 16.0, 17.0, 18.0, 18.5, 19.0, 20.0}");
        consonantsSrc.stopTime.setToken(new DoubleToken(30.0));

        Clock punctuationSrc = new Clock(topLevelActor, "punctuationSrc");
        punctuationSrc.values.setExpression("{1, 1, 1, 1, 1, 1, 1, 1, 1}");
        punctuationSrc.period.setToken(new DoubleToken(100.0));
        punctuationSrc.offsets
                .setExpression("{2.5, 3.0, 3.5, 5.5, 9.5, 11.5, 15.0, 16.5, 21.0}");
        punctuationSrc.stopTime.setToken(new DoubleToken(30.0));

        PrintString printer = new PrintString(topLevelActor, "printer");
        Consonants consonants = new Consonants(topLevelActor, "consonants");
        Vowels vowels = new Vowels(topLevelActor, "vowels");
        Punctuation punctuation = new Punctuation(topLevelActor, "punctuation");

        // System.out.println("Actors have been instantiated.");
        // Set up ports, relation
        TypedIOPort vSrcOut = (TypedIOPort) vowelSrc.getPort("output");
        TypedIOPort cSrcOut = (TypedIOPort) consonantsSrc.getPort("output");
        TypedIOPort pSrcOut = (TypedIOPort) punctuationSrc.getPort("output");

        TypedIOPort cOutput = (TypedIOPort) consonants.getPort("output");
        TypedIOPort vOutput = (TypedIOPort) vowels.getPort("output");
        TypedIOPort pOutput = (TypedIOPort) punctuation.getPort("output");
View Full Code Here


        Merge merge = new Merge(toplevel, "merge");

        // Create 20 clocks.
        for (int i = 1; i < 20; i++) {
            Clock clock = new Clock(toplevel, "clock" + i);
            clock.period.setExpression("" + (i * 2));
            clock.values.setExpression("{" + i + ", " + i + "}");
            toplevel.connect(clock.output, merge.input);
        }

View Full Code Here

        manager = new Manager();
        _director = new DEDirector();
        _top.setDirector(_director);
        _top.setManager(manager);

        _clock = new Clock(_top, "clock");
        _clock.values.setExpression("[1.0]");
        _clock.offsets.setExpression("[0.0]");
        _clock.period.setExpression("1.0");
        _rec = new Recorder(_top, "recorder");
        _top.connect(_clock.output, _rec.input);
View Full Code Here

            public void _execute() throws IllegalActionException,
                    NameDuplicationException {
                _clock.output.unlinkAll();
                _rec.input.unlinkAll();

                Clock clock2 = new Clock(_top, "clock2");
                clock2.values.setExpression("[2.0]");
                clock2.offsets.setExpression("[0.5]");
                clock2.period.setExpression("2.0");

                Merge merge = new Merge(_top, "merge");
View Full Code Here

        _manager = new Manager();
        _director = new DEDirector();
        _top.setDirector(_director);
        _top.setManager(_manager);

        _clock = new Clock(_top, "clock");
        _clock.values.setExpression("{1.0}");
        _clock.offsets.setExpression("{0.0}");
        _clock.period.setExpression("1.0");
        _rec = new Recorder(_top, "rec");
        _top.connect(_clock.output, _rec.input);
View Full Code Here

        ChangeRequest change = new ChangeRequest(this, "test2") {
            protected void _execute() throws Exception {
                _clock.output.unlinkAll();
                _rec.input.unlinkAll();

                Clock clock2 = new Clock(_top, "clock2");
                clock2.values.setExpression("{2.0}");
                clock2.offsets.setExpression("{0.5}");
                clock2.period.setExpression("2.0");

                Merge merge = new Merge(_top, "merge");
View Full Code Here

        // Create the director.
        DEDirector director = new DEDirector(toplevel, "director");
        director.stopTime.setExpression("10.0");

        // Create two actors.
        Clock clock = new Clock(toplevel, "clock");
        TimedPlotter plotter = new TimedPlotter(toplevel, "plotter");

        // Connect them.
        toplevel.connect(clock.output, plotter.input);
        return toplevel;
View Full Code Here

        fir.taps.setExpression("{0.7, 0.3}");

        Quantizer quan = new Quantizer(this, "Quantizer");
        Average accumulator = new Average(this, "accumulator");
        Sampler sampler = new Sampler(this, "sampler");
        Clock clk = new Clock(this, "ADClock");
        clk.offsets.setExpression("{0.0}");
        clk.period.setToken(new DoubleToken(1.0));
        clk.values.setExpression("{true}");

        TimedPlotter dePlot = new TimedPlotter(this, "DEPlot");
View Full Code Here

        // Create the director.
        DEDirector director = new DEDirector(this, "director");
        setDirector(director);

        // Create two actors.
        Clock clock = new Clock(this, "clock");
        TimedPlotter plotter = new TimedPlotter(this, "plotter");

        // Set the user controlled parameters.
        director.stopTime.setExpression("stopTime");
        clock.period.setExpression("clockPeriod");
View Full Code Here

        DEDirector director = new DEDirector(this, "director");
        setDirector(director);
        director.stopTime.setExpression("10.0");

        // Create two actors.
        Clock clock = new Clock(this, "clock");
        TimedPlotter plotter = new TimedPlotter(this, "plotter");

        // Connect them.
        connect(clock.output, plotter.input);
    }
View Full Code Here

TOP

Related Classes of ptolemy.actor.lib.Clock

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.