Package ptolemy.actor

Examples of ptolemy.actor.Manager$State


     *  stop execution by calling the stop() method of the manager.
     *  If there is no manager, do nothing.
     *  @param model The model to stop.
     */
    public void stopRun(CompositeActor model) {
        Manager manager = model.getManager();

        if (manager != null) {
            manager.stop();
        }
    }
View Full Code Here


                }

                _models.add(model);

                // Create a manager.
                Manager manager = model.getManager();

                if (manager == null) {
                    model.setManager(new Manager(model.workspace(), "manager"));
                    //manager = model.getManager();
                }
            } else {
                // Argument not recognized.
                return false;
View Full Code Here

    public static void main(String[] args) {
        try {
            TypedCompositeActor univ = new TypedCompositeActor();
            univ.setName("DiningPhilosophers demo");

            Manager manager = new Manager("Manager");
            new CSPDirector(univ, "Local Director");
            univ.setManager(manager);

            Parameter thinkingRate = new Parameter(univ, "thinkingRate");
            thinkingRate.setExpression("1.0");
View Full Code Here

    /** Constructor.
     */
    public TestDE() throws IllegalActionException, NameDuplicationException {
        _top = new TypedCompositeActor();
        _top.setName("top");
        _manager = new Manager();
        _director = new DEDirector();
        _top.setDirector(_director);
        _top.setManager(_manager);

        _clock = new Clock(_top, "clock");
View Full Code Here

            univ = new TypedCompositeActor();
            univ.setName("Top");

            // Set up the directors
            _localDirector = new CSPDirector(univ, "CSP Director");
            _manager = new Manager("Manager");
            univ.setManager(_manager);

            Parameter eatingRate = new Parameter(univ, "eatingRate");
            eatingRate.setExpression("1.0");
            eatingRate.getToken();
View Full Code Here

        if (!(toplevel instanceof CompositeActor)) {
            throw new IllegalActionException(toplevel,
                    "Cannot get a manager because the model is not a CompositeActor.");
        }

        Manager manager = ((CompositeActor) toplevel).getManager();

        if (manager == null) {
            try {
                manager = new Manager(toplevel.workspace(), "manager");
                ((CompositeActor) toplevel).setManager(manager);
            } catch (IllegalActionException ex) {
                // Should not occur.
                throw new InternalErrorException(ex);
            }
        }

        if (manager != _manager) {
            // If there was a previous manager, unlisten.
            if (_manager != null) {
                _manager.removeExecutionListener(this);
            }

            manager.addExecutionListener(this);
            _manager = manager;
        }

        return manager;
    }
View Full Code Here

     */
    public ChangeRequestTest() throws IllegalActionException,
            NameDuplicationException {
        _top = new TypedCompositeActor();
        _top.setName("top");
        _manager = new Manager();

        SDFDirector director = new SDFDirector();
        _top.setDirector(director);
        _top.setManager(_manager);

View Full Code Here

         ex.printStackTrace();
         System.out.println("startRun: " + ex);
         }
         }
         */
        Manager manager = model.getManager();

        try {
            if (manager == null) {
                model.setManager(new Manager(model.workspace(), "manager"));
                manager = model.getManager();
            }

            long startTime = System.currentTimeMillis();
            manager.execute();
            System.out.println("Execution stats:");
            System.out.println(timeAndMemory(startTime));
        } catch (KernelException ex) {
            // Model is already running.  Ignore.
            System.out.println("Exception = " + ex);
View Full Code Here

     *  stop execution by calling the finish() method of the manager.
     *  If there is no manager, do nothing.
     *  @param model The model to stop.
     */
    public void stopRun(CompositeActor model) {
        Manager manager = model.getManager();

        if (manager != null) {
            manager.finish();
        }
    }
View Full Code Here

        toplevel.setName("toplevel");

        SDFDirector director = new SDFDirector(toplevel, "director");

        // director.addDebugListener(new StreamListener());
        Manager manager = new Manager(w, "manager");
        toplevel.setManager(manager);

        Ramp ramp = new Ramp(toplevel, "ramp");
        Recorder recorder = new Recorder(toplevel, "recorder");
        recorder.capacity.setExpression("0");
        toplevel.connect(ramp.output, recorder.input);

        director.iterations.setExpression("10000");
        manager.run();
        manager.run();
        System.out.println("Total number of events seen by Recorder: "
                + recorder.getCount());
    }
View Full Code Here

TOP

Related Classes of ptolemy.actor.Manager$State

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.