What director are you using? Did you try adding a listener to the director?

Also: If "mote" is an instance of your own actor, I would
carefully examine what happens when you clone it.  If it has
private variables that reference data structures or other
objects, then those need to be actively cloned as well...

Edward

At 02:58 PM 5/12/2005 -0700, Zimdars, Andrew wrote:
In our effort to build a headless Ptolemy model (Giri posted about it earlier this week), we find that most of our actors do not become "full citizens" of the new model. As a result, nothing happens when we execute the model. We tried to model our code on MoMLSimpleApplication and the entity-creation code in MoML parser:

  // The top-level TypedCompositeActor is named "world"

  // mote extends TypedCompositeActor
  NamedObj moteClone = (NamedObj) mote.clone(world.workspace());
  world.workspace().add(moteClone);
  moteClone.setName("MoteActor " + i);
  ((ComponentEntity)moteClone).setContainer(world);

  // This differs on purpose from the "_location" parameter
  Parameter position = (Parameter) moteClone.getAttribute("position");

  // ...

Actors added this way make it into the manager's contained entity list, but not into the entity cache. When we call execute(), the method returns almost immediately, and none of the actors we tried to add using the above method are initialized ...

Thanks for your guidance,

Andy Z.

-----
Andrew Zimdars
Modeling, Simulation, and Information Sciences (Org. ABCS)
Advanced Technology Center, Lockheed Martin Space Systems Co.
Bldg. 153, Col. 2J4
1111 Lockheed Martin Way, Sunnyvale, CA  94089

w: 408/742.2111 m: 510/915.0662

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

------------
Edward A. Lee
Professor, Chair of the EE Division, Associate Chair of EECS
231 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal



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

Reply via email to