Hi Hackers,

I've encountered an inconsistency in the way MoML written by Vergil gets
executed by the generic Director.

At the end of this message are two simple Ptolemy layouts that are
functionally and structurally identical in Vergil.  However, running the
first layout produces a "full mailbox" exception.  Is this a bug?

Reordering entities in the xml file will solve the problem.  However, in
more complex layouts more connected entities, the proper order is not
clear.  What is the correct ordering of entities in MoML to get the
generic Director to run layout without full mailbox execeptions?


I can send the xml files as email attachments as requested.  I also have
examples of slightly more complex MoML reproducing the bad behavior and
the fix, and can send those as well.


Thank you very much,

Kevin





------------------------------------------

bad_model.xml


<?xml version="1.0" standalone="no"?>
<!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN"
    "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd";>
<entity name="bad_model" class="ptolemy.actor.TypedCompositeActor">
    <property name="_createdBy" 
class="ptolemy.kernel.attributes.VersionAttribute" value="4.0.1">
    </property>
    <property name="Director" class="ptolemy.actor.Director">
        <doc>Simple director that executes actors in the order in which 
they were created.</doc>
        <property name="_location" class="ptolemy.kernel.util.Location" 
value="[140.0, -25.0]">
        </property>
    </property>
    <property name="_windowProperties" 
class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={393, 
220, 778, 486}, maximized=false}">
    </property>
    <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" 
value="[563, 377]">
    </property>
    <property name="_vergilZoomFactor" 
class="ptolemy.data.expr.ExpertParameter" value="1.0">
    </property>
    <property name="_vergilCenter" 
class="ptolemy.data.expr.ExpertParameter" value="{294.2360641891892, 
93.1304898648649}">
    </property>
    <entity name="Const2" class="ptolemy.actor.lib.Const">
        <doc>Create a constant sequence</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" 
class="ptolemy.kernel.util.StringAttribute" value="value">
            </property>
            <property name="displayWidth" 
class="ptolemy.data.expr.Parameter" value="60">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" 
value="[105.0, 85.0]">
        </property>
    </entity>
    <entity name="Expression" class="ptolemy.actor.lib.Expression">
        <property name="expression" 
class="ptolemy.kernel.util.StringAttribute" value="1">
        </property>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" 
class="ptolemy.kernel.util.StringAttribute" value="expression">
            </property>
            <property name="displayWidth" 
class="ptolemy.data.expr.Parameter" value="60">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" 
value="[195.0, 55.0]">
        </property>
        <port name="output" class="ptolemy.actor.TypedIOPort">
            <property name="output"/>
            <property name="_type" class="ptolemy.actor.TypeAttribute" 
value="unknown">
            </property>
        </port>
        <port name="in1" class="ptolemy.actor.TypedIOPort">
            <property name="input"/>
            <property name="_type" class="ptolemy.actor.TypeAttribute" 
value="unknown">
            </property>
            <property name="_showName" 
class="ptolemy.kernel.util.SingletonAttribute">
            </property>
        </port>
        <port name="in2" class="ptolemy.actor.TypedIOPort">
            <property name="input"/>
            <property name="_type" class="ptolemy.actor.TypeAttribute" 
value="unknown">
            </property>
            <property name="_showName" 
class="ptolemy.kernel.util.SingletonAttribute">
            </property>
        </port>
    </entity>
    <entity name="Const" class="ptolemy.actor.lib.Const">
        <doc>Create a constant sequence</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" 
class="ptolemy.kernel.util.StringAttribute" value="value">
            </property>
            <property name="displayWidth" 
class="ptolemy.data.expr.Parameter" value="60">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" 
value="[105.0, 45.0]">
        </property>
    </entity>
    <relation name="relation3" class="ptolemy.actor.TypedIORelation">
    </relation>
    <relation name="relation" class="ptolemy.actor.TypedIORelation">
    </relation>
    <link port="Const2.output" relation="relation"/>
    <link port="Expression.in1" relation="relation3"/>
    <link port="Expression.in2" relation="relation"/>
    <link port="Const.output" relation="relation3"/>
</entity>


----------------------------------------------

good_model.xml


<?xml version="1.0" standalone="no"?>
<!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN"
    "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd";>
<entity name="good_model" class="ptolemy.actor.TypedCompositeActor">
    <property name="_createdBy" 
class="ptolemy.kernel.attributes.VersionAttribute" value="4.0.1">
    </property>
    <property name="Director" class="ptolemy.actor.Director">
        <doc>Simple director that executes actors in the order in which 
they were created.</doc>
        <property name="_location" class="ptolemy.kernel.util.Location" 
value="[125.0, 70.0]">
        </property>
    </property>
    <property name="_windowProperties" 
class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={339, 
294, 815, 509}, maximized=false}">
    </property>
    <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" 
value="[600, 400]">
    </property>
    <property name="_vergilZoomFactor" 
class="ptolemy.data.expr.ExpertParameter" value="1.0">
    </property>
    <property name="_vergilCenter" 
class="ptolemy.data.expr.ExpertParameter" value="{300.0, 200.0}">
    </property>
    <entity name="Const" class="ptolemy.actor.lib.Const">
        <doc>Create a constant sequence</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" 
class="ptolemy.kernel.util.StringAttribute" value="value">
            </property>
            <property name="displayWidth" 
class="ptolemy.data.expr.Parameter" value="60">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" 
value="[92.20703125, 139.8125]">
        </property>
    </entity>
    <entity name="Const2" class="ptolemy.actor.lib.Const">
        <doc>Create a constant sequence</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" 
class="ptolemy.kernel.util.StringAttribute" value="value">
            </property>
            <property name="displayWidth" 
class="ptolemy.data.expr.Parameter" value="60">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" 
value="[92.20703125, 179.8125]">
        </property>
    </entity>
    <entity name="Expression" class="ptolemy.actor.lib.Expression">
        <property name="expression" 
class="ptolemy.kernel.util.StringAttribute" value="1">
        </property>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" 
class="ptolemy.kernel.util.StringAttribute" value="expression">
            </property>
            <property name="displayWidth" 
class="ptolemy.data.expr.Parameter" value="60">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" 
value="[190.0, 150.0]">
        </property>
        <port name="in1" class="ptolemy.actor.TypedIOPort">
            <property name="input"/>
            <property name="_type" class="ptolemy.actor.TypeAttribute" 
value="unknown">
            </property>
            <property name="_showName" 
class="ptolemy.kernel.util.SingletonAttribute">
            </property>
        </port>
        <port name="in2" class="ptolemy.actor.TypedIOPort">
            <property name="input"/>
            <property name="_type" class="ptolemy.actor.TypeAttribute" 
value="unknown">
            </property>
            <property name="_showName" 
class="ptolemy.kernel.util.SingletonAttribute">
            </property>
        </port>
    </entity>
    <relation name="relation" class="ptolemy.actor.TypedIORelation">
    </relation>
    <relation name="relation2" class="ptolemy.actor.TypedIORelation">
    </relation>
    <link port="Const.output" relation="relation"/>
    <link port="Const2.output" relation="relation2"/>
    <link port="Expression.in1" relation="relation"/>
    <link port="Expression.in2" relation="relation2"/>
</entity>


---------------------------------------

Full mailbox exception, from running bad_model.xml:


ptolemy.actor.NoRoomException: Cannot put a token in a full mailbox.
  in .keymodel_bad.Expression2.in1
        at ptolemy.actor.Mailbox.put(Mailbox.java:142)
        at ptolemy.actor.TypedIOPort.send(TypedIOPort.java:550)
        at ptolemy.actor.lib.Const.fire(Const.java:115)
        at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:283)
        at ptolemy.actor.Director.fire(Director.java:270)
        at ptolemy.actor.CompositeActor.fire(CompositeActor.java:316)
        at ptolemy.actor.Manager.iterate(Manager.java:519)
        at ptolemy.actor.Manager.execute(Manager.java:295)
        at ptolemy.actor.Manager.run(Manager.java:852)
        at ptolemy.actor.Manager$2.run(Manager.java:901)



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

Reply via email to