Package ptolemy.actor

Examples of ptolemy.actor.Manager


     *  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

            } catch (Exception ex) {
                System.out.println("startRun: " + ex);
            }
        }

        Manager manager = model.getManager();

        if (manager != null) {
            try {
                manager.startRun();
            } catch (IllegalActionException ex) {
                // Model is already running.  Ignore.
            }
        } else {
            report("Model " + model.getFullName() + " cannot be executed "
View Full Code Here

     *  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"));
                }
            } else {
                // Argument not recognized.
                return false;
            }
View Full Code Here

        } else if (toplevel instanceof CompositeActor) {
            CompositeActor result = (CompositeActor) toplevel;
            _manager = result.getManager();

            if (_manager == null) {
                _manager = new Manager(_workspace, "manager");
                result.setManager(_manager);
            }

            _manager.addExecutionListener(this);
        }
View Full Code Here

            System.out.println("TestApplication: Setting Iterations to "
                    + iterations.getToken());
        }

        Manager manager = new Manager(toplevel.workspace(), "TestApplication");
        toplevel.setManager(manager);
        toplevel.addChangeListener(this);

        String modelName = toplevel.getName();

        long startTime = System.currentTimeMillis();
        long totalMemory1 = runtime.totalMemory() / 1024;
        long freeMemory1 = runtime.freeMemory() / 1024;
        System.out.println("Spent " + (startTime - _parseStartTime)
                + " ms. creating the model.");
        System.out.println(modelName + ": Stats before execution:    "
                + Manager.timeAndMemory(startTime, totalMemory1, freeMemory1));

        // Second, we run and print memory stats.
        manager.execute();

        long totalMemory2 = runtime.totalMemory() / 1024;
        long freeMemory2 = runtime.freeMemory() / 1024;
        String standardStats = Manager.timeAndMemory(startTime, totalMemory2,
                freeMemory2);
View Full Code Here

        super(model, tableau);

        _pane = pane;
        getContentPane().add(_pane, BorderLayout.CENTER);

        Manager manager = model.getManager();

        if (manager != null) {
            manager.addExecutionListener(this);
        }

        // Make the go button the default.
        _pane.setDefaultButton();
View Full Code Here

        if (model != null) {
            if (_pane != null) {
                _pane.setModel(model);
            }

            Manager manager = model.getManager();

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

        // FIXME: Shouldn't the following only be done if the
        // above returns true.
        NamedObj model = getModel();

        if (model instanceof CompositeActor) {
            Manager manager = ((CompositeActor) model).getManager();

            if (manager != null) {
                manager.removeExecutionListener(this);
            }
        }

        if (_pane != null) {
            _pane.stopRun();
View Full Code Here

TOP

Related Classes of ptolemy.actor.Manager

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.