In comp.soft-sys.ptolemy, [EMAIL PROTECTED] (Manish_Kushwaha)
writes:
    Can someone tell me how do we add new entities in a model from within
    another entity. For example when 'MyActor' gets a trigger it should
    add 'n1' number of 'Actor1' and 'n2' number of 'Actor2' in present
    model. What I am trying to do is following:
    In fire function in MyActor.java I define new Actor1 as,
    
        Actor1 a1 = new Actor1(new CompositeEntity(_workspace), name); 
    
    this should add a1 (which is in some new container) to this workspace.
    But I am not able to see any new entity in model. Later in the
    function I run _workspace.directoryList() and print the list to see if
    new containers have been added. The print shows that new
    compositeEntities were added.
    I dont know if something else need to be done for Actor1(s) to show up
    in model.
--------

This sound like higher order components (hoc), you might look at
ptolemy/actor/lib/hoc/MultiInstanceComposite.java

I'm not sure, but sometimes things like this involve change requests.
Perhaps someone else has some ideas?

-Christopher

Christopher Hylands Brooks [EMAIL PROTECTED]  University of California
Programmer/Analyst Chess/Ptolemy/GSRC         US Mail: 558 Cory Hall #1770
ph: 510.643.9841 fax:510.642.2739             Berkeley, CA 94720-1770
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480  (office: 400A Cory)



----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to