Greetings:
I have a couple questions regarding modal models, and one general modeling question.

1a. Should I be able to modify extended state parameters from within transition refinements using SetVariable?

In the attached simple (but otherwise uninteresting) example, I can successfully SetVariable from within the state refinement and via the transition setAction, but apparently not from within the transition refinement.

1b. When I run the attached simple example the first time after loading it, I get the following error.  It works as expected on subsequent runs.  What does this error mean?
ptolemy.kernel.util.IllegalActionException: Failed to compute schedule:
  in .vergiltest.state.SDF Director
Because:
Invalid weight argument, the number of elements for this weight is zero.
The weight is of class ptolemy.data.expr.Variable and its description follows:
ptolemy.data.expr.Variable {.vergiltest.relation.Parameter2} value undefined
A Dump of the offending graph follows.

**I can send the rest if desired**
2.  Is there any mechanism to reference the current state by name from within a state refinement?  I wish to do this for logging purposes.

3.  Is there any mechanism to for a model to reference the current top-level director's iteration count?  (this is for any model - not just modal models, also for logging purposes)

Appreciate the help,

Frank

PS: Congrats and thanks for the Ptolemy book!    I love it!

  

<?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="vergiltest" class="ptolemy.domains.modal.modal.ModalModel">
    <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.0.1">
    </property>
    <property name="_tableauFactory" class="ptolemy.vergil.modal.modal.ModalTableauFactory">
    </property>
    <entity name="_Controller" class="ptolemy.domains.modal.modal.ModalController">
        <property name="_library" class="ptolemy.moml.LibraryAttribute">
            <configure>
      <entity name="state library" class="ptolemy.kernel.CompositeEntity"><input source="ptolemy/configs/basicUtilities.xml"></input><entity name="state" class="ptolemy.domains.modal.kernel.State"><property name="_centerName" class="ptolemy.kernel.util.Attribute"></property><property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory"></property></entity></entity>
    </configure>
        </property>
        <property name="Parameter1" class="ptolemy.data.expr.Parameter" value="0">
            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
                </property>
            </property>
            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                <configure>
      <svg>
        <text x="20" style="font-size:14; font-family:SansSerif; fill:blue" y="20">-P-</text>
      </svg>
    </configure>
            </property>
            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[170.0, 155.0]">
            </property>
        </property>
        <property name="Parameter2" class="ptolemy.data.expr.Parameter" value="0">
            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
                </property>
            </property>
            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                <configure>
      <svg>
        <text x="20" style="font-size:14; font-family:SansSerif; fill:blue" y="20">-P-</text>
      </svg>
    </configure>
            </property>
            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="{170.0, 180.0}">
            </property>
        </property>
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={233, 144, 813, 511}, 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>
        <property name="Parameter3" class="ptolemy.data.expr.Parameter" value="0">
            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
                </property>
            </property>
            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                <configure>
      <svg>
        <text x="20" style="font-size:14; font-family:SansSerif; fill:blue" y="20">-P-</text>
      </svg>
    </configure>
            </property>
            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[170.0, 205.0]">
            </property>
        </property>
        <entity name="state" class="ptolemy.domains.modal.kernel.State">
            <property name="refinementName" class="ptolemy.kernel.util.StringAttribute" value="state">
            </property>
            <property name="isInitialState" class="ptolemy.data.expr.Parameter" value="true">
            </property>
            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
            </property>
            <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[120.0, 260.0]">
            </property>
        </entity>
        <entity name="state2" class="ptolemy.domains.modal.kernel.State">
            <property name="refinementName" class="ptolemy.kernel.util.StringAttribute" value="state2">
            </property>
            <property name="isFinalState" class="ptolemy.data.expr.Parameter" value="true">
            </property>
            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
            </property>
            <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[320.0, 260.0]">
            </property>
        </entity>
        <relation name="relation" class="ptolemy.domains.modal.kernel.Transition">
            <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="true">
            </property>
            <property name="setActions" class="ptolemy.domains.modal.kernel.CommitActionsAttribute" value="Parameter3=3">
            </property>
            <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="0.6283185307179586">
            </property>
            <property name="gamma" class="ptolemy.data.expr.Parameter" value="0.04861784931237138">
            </property>
            <property name="refinementName" class="ptolemy.kernel.util.StringAttribute" value="relation">
            </property>
        </relation>
        <link port="state.outgoingPort" relation="relation"/>
        <link port="state2.incomingPort" relation="relation"/>
    </entity>
    <entity name="state" class="ptolemy.domains.modal.modal.Refinement">
        <property name="SDF Director" class="ptolemy.domains.sdf.kernel.SDFDirector">
            <property name="iterations" class="ptolemy.data.expr.Parameter" value="0">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="{65, 40}">
            </property>
        </property>
        <entity name="SetVariable" class="ptolemy.actor.lib.SetVariable">
            <property name="variableName" class="ptolemy.kernel.util.StringAttribute" value="Parameter1">
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="variableName">
                </property>
                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="40">
                </property>
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[215.0, 155.0]">
            </property>
        </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="{60, 155}">
            </property>
        </entity>
        <relation name="relation" class="ptolemy.actor.TypedIORelation">
        </relation>
        <link port="SetVariable.input" relation="relation"/>
        <link port="Const.output" relation="relation"/>
    </entity>
    <entity name="relation" class="ptolemy.domains.modal.modal.Refinement">
        <property name="SDF Director" class="ptolemy.domains.sdf.kernel.SDFDirector">
            <property name="iterations" class="ptolemy.data.expr.Parameter" value="0">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="{105, 50}">
            </property>
        </property>
        <entity name="SetVariable" class="ptolemy.actor.lib.SetVariable">
            <property name="variableName" class="ptolemy.kernel.util.StringAttribute" value="Parameter2">
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="variableName">
                </property>
                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="40">
                </property>
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="{225.0, 165.0}">
            </property>
        </entity>
        <entity name="Const" class="ptolemy.actor.lib.Const">
            <property name="value" class="ptolemy.data.expr.Parameter" value="2">
            </property>
            <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="{70.0, 165.0}">
            </property>
        </entity>
        <relation name="relation" class="ptolemy.actor.TypedIORelation">
        </relation>
        <link port="SetVariable.input" relation="relation"/>
        <link port="Const.output" relation="relation"/>
    </entity>
    <entity name="state2" class="ptolemy.domains.modal.modal.Refinement">
        <property name="SDF Director" class="ptolemy.domains.sdf.kernel.SDFDirector">
            <property name="iterations" class="ptolemy.data.expr.Parameter" value="0">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="{130, 45}">
            </property>
        </property>
        <entity name="Const" class="ptolemy.actor.lib.Const">
            <property name="value" class="ptolemy.data.expr.Parameter" value="Parameter1">
            </property>
            <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="[135.0, 100.0]">
            </property>
        </entity>
        <entity name="Const2" class="ptolemy.actor.lib.Const">
            <property name="value" class="ptolemy.data.expr.Parameter" value="Parameter2">
            </property>
            <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="[120.0, 155.0]">
            </property>
        </entity>
        <entity name="Const3" class="ptolemy.actor.lib.Const">
            <property name="value" class="ptolemy.data.expr.Parameter" value="Parameter3">
            </property>
            <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="[135.0, 225.0]">
            </property>
        </entity>
        <entity name="Display" class="ptolemy.actor.lib.gui.Display">
            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={398, 296, 484, 208}, maximized=false}">
            </property>
            <property name="_paneSize" class="ptolemy.actor.gui.SizeAttribute" value="[484, 164]">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[305.0, 120.0]">
            </property>
        </entity>
        <relation name="relation" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation3" class="ptolemy.actor.TypedIORelation">
        </relation>
        <link port="Const.output" relation="relation"/>
        <link port="Const2.output" relation="relation2"/>
        <link port="Const3.output" relation="relation3"/>
        <link port="Display.input" relation="relation"/>
        <link port="Display.input" relation="relation2"/>
        <link port="Display.input" relation="relation3"/>
    </entity>
</entity>
_______________________________________________
Kepler-users mailing list
Kepler-users@kepler-project.org
http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users

Reply via email to