Yes, this is a bug in the code generator that shipped with the beta.
It is likely that the final release will include a fix that allows constants (like PI) to be dealt with
correctly.


Note that for other reasons, the Butterfly demo will not generate usable code. (Because the
plotter uses parts of Ptolemy II that are not initialized or understood by the code generator).
This is also something I'm working on, but it is unlikely that a fix will be included in the release.


Steve

At 04:04 PM 8/18/2003 -0700, Christopher Hylands Brooks wrote:
Sorry for the delay in getting back to you on this, I was
away on vacation
On 8/02, in comp.soft-sys.ptolemy, [EMAIL PROTECTED] (Long-Bao) wrote:
--------

Hi, everyone:

    I've encounterd the following exception
        when I used "code generator" (for Java)
        with the Demo "Butterfly" (or something else)
        in SDF Domain:

>>>
Soot started on Sat Aug 02 21:58:46 CST 2003
WatchDogTimer.internalTransform(wjtp.watchDog, {time=600000,
cancel=false})
ModelTransformer.internalTransform(wjtp.mt,
{targetPackage=ptolemy.copernicus.java.cg.Butterfly})
ModelTransformer: Creating actor class
ptolemy.copernicus.java.cg.Butterfly.CGRamp
for actor .Butterfly.Ramp
based on ptolemy.actor.lib.Ramp
ptolemy.kernel.util.IllegalActionException: The ID PI is undefined.
at ptolemy.copernicus.java.DataUtilities$ActorCodeGenerationScope.getType(DataUtilities.java:366)
at ptolemy.data.expr.ParseTreeTypeInference._getTypeForName(ParseTreeTypeInference.java:495)
at ptolemy.data.expr.ParseTreeTypeInference.visitLeafNode(ParseTreeTypeInference.java:303)
at ptolemy.data.expr.ASTPtLeafNode.visit(ASTPtLeafNode.java:115)
at ptolemy.data.expr.ParseTreeTypeInference._inferChild(ParseTreeTypeInference.java:536)
at ptolemy.data.expr.ParseTreeTypeInference._inferAllChildren(ParseTreeTypeInference.java:519)
at ptolemy.data.expr.ParseTreeTypeInference.visitProductNode(ParseTreeTypeInference.java:400)
at ptolemy.data.expr.ASTPtProductNode.visit(ASTPtProductNode.java:124)
at ptolemy.data.expr.ParseTreeTypeInference.inferTypes(ParseTreeTypeInference.java:78)
at ptolemy.copernicus.java.ParseTreeCodeGenerator.generateCode(ParseTreeCodeGenerator.java:74)
at ptolemy.copernicus.java.DataUtilities.generateExpressionCodeBefore(DataUtilities.java:184)
at ptolemy.copernicus.java.ModelTransformer.computeAttributesBefore(ModelTransformer.java:185)
at ptolemy.copernicus.java.GenericAtomicActorCreator.createAtomicActor(GenericAtomicActorCreator.java:196)
at ptolemy.copernicus.java.ModelTransformer._createActorsIn(ModelTransformer.java:1462)
at ptolemy.copernicus.java.ModelTransformer._createCompositeActor(ModelTransformer.java:1493)
at ptolemy.copernicus.java.ModelTransformer.internalTransform(ModelTransformer.java:914)
at soot.SceneTransformer.transform(SceneTransformer.java:46)
at soot.Pack.apply(Pack.java:79)
at soot.Main.run(Main.java:1649)
at ptolemy.copernicus.kernel.KernelMain.generateCode(KernelMain.java:17
5)
at ptolemy.copernicus.java.Main.main(Main.java:450)
Code generation of 'jar:file:/C:/Ptolemy/Ptolemy_II_3.0-beta/ptolemy/domain
s/sdf/demo/demo.jar!/ptolemy/domains/sdf/demo/Butterfly/Butterfly.xml'
failed:
java.lang.RuntimeException:
ptolemy.kernel.util.IllegalActionException: The ID PI is undefined.
at ptolemy.copernicus.java.DataUtilities.generateExpressionCodeBefore(DataUtilities.java:188)
at ptolemy.copernicus.java.ModelTransformer.computeAttributesBefore(ModelTransformer.java:185)
at ptolemy.copernicus.java.GenericAtomicActorCreator.createAtomicActor(GenericAtomicActorCreator.java:196)
at ptolemy.copernicus.java.ModelTransformer._createActorsIn(ModelTransformer.java:1462)
at ptolemy.copernicus.java.ModelTransformer._createCompositeActor(ModelTransformer.java:1493)
at ptolemy.copernicus.java.ModelTransformer.internalTransform(ModelTransformer.java:914)
at soot.SceneTransformer.transform(SceneTransformer.java:46)
at soot.Pack.apply(Pack.java:79)
at soot.Main.run(Main.java:1649)
at ptolemy.copernicus.kernel.KernelMain.generateCode(KernelMain.java:175)
at ptolemy.copernicus.java.Main.main(Main.java:450)
WARNING: Default charset MS950 not supported, using ISO-8859-1 instead
All Done.
>>>



Have anyone met the same problem as me ?? Or I've done something wrong?? I'm using Ptolemy II Windows executable file that includes JVM on Windows XP Professional SP1 and Compaq Presario 1500.

How to overcome it???

Thans a lot!!!

    Long-Bao
--------
I see the same problem in Ptolemy 3.0-beta in the Windows prebuilt
executable and in a 3.0-beta binary built from scratch.

I think the problem is the Expression actor.  Generating code for
this actor is difficult

I'll see if the author of the code generation facility can take a
look.

-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)


_______________________________________________ Ptolemy maillist - [EMAIL PROTECTED] http://chess.eecs.berkeley.edu/ptolemy/listinfo/ptolemy



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

Reply via email to