Hi Andrew,

I'm not totally sure what you are getting at here.

If you look at
$PTII/ptolemy/domains/sdf/demo/Butterfly/Butterfly.java,
then you will find that it defines a class that extends
TypedCompositeActor.
To run the class with a run control panel, run: 
java -classpath $PTII ptolemy.actor.gui.CompositeActorApplication -class 
ptolemy.domains.sdf.demo.Butterfly.Butterfly

$PTII/ptolemy/actor/gui/CompositeActorApplication.java says:

   This application creates one or more Ptolemy II models given a
   classname on the command line, and then executes those models, each in
   its own thread.  Each specified class should be derived from
   CompositeActor, and should have a constructor that takes a single
   argument, an instance of Workspace.  If the model does not contain
   a manager, then one will be created for it. The model is displayed using
   an instance of ModelFrame, which provides controls for executing
   the model and setting its top-level and director parameters.

$PTII/ptolemy/actor/gui/CompositeActorSimpleApplication.java 
will work with non-graphical models
If you run this command:

java -classpath $PTII ptolemy.actor.gui.CompositeActorApplication -class 
ptolemy.actor.gui.test.TestModel

Then you will run a really simple model that does not print anything,
but it does run.

However, this model below will print to stdout:

[EMAIL PROTECTED] 131% cat RampModel.java
package ptolemy.actor.gui.test;

import java.util.List;

import ptolemy.actor.TypedCompositeActor;
import ptolemy.actor.lib.io.LineWriter;
import ptolemy.actor.lib.Ramp;
import ptolemy.domains.sdf.kernel.SDFDirector;
import ptolemy.kernel.util.Workspace;


public class RampModel extends TypedCompositeActor {
    public RampModel(Workspace workspace) throws Exception {
        super(workspace);

        // Construct the model.
        Ramp ramp = new Ramp(this, "ramp");
        LineWriter lineWriter = new LineWriter(this, "lineWriter");
        connect(ramp.output, lineWriter.input);

        // Attach a director.
        SDFDirector dir = new SDFDirector(this, "director");
        dir.iterations.setExpression("3");
    }
}
[EMAIL PROTECTED] 132% javac -classpath $PTII RampModel.java
[EMAIL PROTECTED] 133% java -classpath $PTII 
ptolemy.actor.gui.CompositeActorApplication -class 
ptolemy.actor.gui.test.RampModel
0
1
2
169 ms. Memory: 3520K Free: 1991K (57%)
[EMAIL PROTECTED] 134% 

Perhaps you are not instantiating a director?
Now, there could be an issue with a particular domain.


It took a quick look at creating headless java based models for the
wireless domain by using Copernicus shallow codegen and it looks like
Copernicus shallow codegen does not work with AtomicWirelessChannel.

These demos
1. domains/wireless/test/auto/range.xml
2. domains/wireless/test/auto/delay.xml
3. domains/wireless/test/auto/erasure.xml
4. domains/wireless/test/auto/properties.xml
5. domains/wireless/test/auto/properties5.xml
6. domains/wireless/test/auto/powerLoss.xml
7. domains/wireless/test/auto/powerLoss2.xml
Fail with this message:

Exception occurred: class ptolemy.kernel.util.IllegalActionException(Cannot 
determine location for port port.)
ptolemy.kernel.util.IllegalActionException: Cannot determine location for port 
port.
        at 
ptolemy.domains.wireless.kernel.AtomicWirelessChannel._locationOf(AtomicWirelessChannel.java:677)

I suspect that the problem here is that we are filtering out the
Locatable class somewhere.  

This might be affecting you?

_Christopher

--------

    In our effort to build a headless Ptolemy model (Giri posted about it earli
   er 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 almo
   st immediately, and none of the actors we tried to add using the above metho
   d 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]
--------

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

Reply via email to