Hi folks,

 

I was revisiting a model from last week when I ran into something.

 

The attached model executes upon the first run. Thereafter it throws an exception

that “queue_out” is undefined. If you completely close out PtII and open the model

again, you can again run it once, etc.

 

The exception is thrown in ParseTreeEvaluator.java, line 514, and caught on line

165 of OutputActionsAttribute.java. The former gets a null return from ModelScope.

java by way of FSMActor.java.

 

Debugging in Eclipse: start PtII, load the model, and run it once. Then put a BP on

OutputActionsAttribute.java:164. Press the green “Resume” arrow five times. Put

another breakpoint on FSMActor.java:1449. Step through; what happens is that a

bunch of getAttribute() methods are called, ultimately leading to the NamedList.get()

function being called (NamedList.java:165). This returns “null”, which seems to be

the start of the problem (?). Here is the call stack at this point:

 

Thread [Thread-9] (Suspended)

            NamedList.get(String) line: 169

            ModalController(NamedObj).getAttribute(String) line: 899

            ModalController(Entity).getAttribute(String) line: 309

            ModalController(CompositeEntity).getAttribute(String) line: 834

            ModelScope._searchIn(Variable, NamedObj, String) line: 129

            ModelScope.getScopedVariable(Variable, NamedObj, String) line: 112

            FSMActor$PortScope.get(String) line: 1449

            ParseTreeEvaluator.visitLeafNode(ASTPtLeafNode) line: 514

            ASTPtLeafNode.visit(ParseTreeVisitor) line: 126

            ParseTreeEvaluator._evaluateChild(ASTPtRootNode, int) line: 1117

            ParseTreeEvaluator._evaluateAllChildren(ASTPtRootNode) line: 1071

            ParseTreeEvaluator.visitSumNode(ASTPtSumNode) line: 961

            ASTPtSumNode.visit(ParseTreeVisitor) line: 129

            ParseTreeEvaluator.evaluateParseTree(ASTPtRootNode, ParserScope) line: 93

            OutputActionsAttribute.execute() line: 163

            ModalController(FSMActor)._chooseTransition(List) line: 993

            FSMDirector.fire() line: 292

            ModalModel(CompositeActor).fire() line: 329

            DEDirector.fire() line: 506

            MultiInstanceComposite(CompositeActor).fire() line: 329

            DEDirector.fire() line: 506

            TypedCompositeActor(CompositeActor).fire() line: 329

            Manager.iterate() line: 601

            Manager.execute() line: 319

            Manager.run() line: 951

            Manager$2.run() line: 1003

 

Any ideas on what the cause is?

 

Chuck Lutz

Lockheed Martin

Systems of Systems - Modeling and Operations Analysis

BMC4I Modeling and Simulation

Moorestown, NJ

(856)638-7234 (office)

[EMAIL PROTECTED]

 

“Everyone spoke of an information overload, but what there

was in fact was a non-information overload.”

– Richard Saul Wurman

 

<?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="QueueOutsideMIC" class="ptolemy.actor.TypedCompositeActor">
    <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="5.0.1">
    </property>
    <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={0, 1, 1154, 359}, maximized=false}">
    </property>
    <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[939, 250]">
    </property>
    <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.0">
    </property>
    <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{469.5, 125.0}">
    </property>
    <property name="DE Director" class="ptolemy.domains.de.kernel.DEDirector">
        <property name="stopTime" class="ptolemy.data.expr.Parameter" value="20">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[65.0, 40.0]">
        </property>
    </property>
    <property name="Annotation" class="ptolemy.vergil.kernel.attributes.TextAttribute">
        <property name="textSize" class="ptolemy.data.expr.Parameter" value="10">
        </property>
        <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Beginnings of attempt to&#10;get parallel outputs from&#10;MIC into one queue.">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[535.0, 160.0]">
        </property>
    </property>
    <property name="Annotation2" class="ptolemy.vergil.kernel.attributes.TextAttribute">
        <property name="textSize" class="ptolemy.data.expr.Parameter" value="10">
        </property>
        <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Diamond:&#10;see Vol.&#10;1, p. 75">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[265.0, 85.0]">
        </property>
    </property>
    <entity name="MIC" class="ptolemy.actor.lib.hoc.MultiInstanceComposite">
        <property name="nInstances" class="ptolemy.data.expr.Parameter" value="5">
        </property>
        <doc>Creates multiple instances of itself</doc>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[365.0, 135.0]">
        </property>
        <property name="annotation" class="ptolemy.kernel.util.Attribute">
            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
            </property>
            <property name="_iconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                <configure><svg><text x="20" y="20" style="font-size:14; font-family:SansSerif; fill:blue">Make sure there is a director here!</text></svg></configure>
            </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">-A-</text>
                </svg>
              </configure>
            </property>
            <property name="_controllerFactory" class="ptolemy.vergil.basic.NodeControllerFactory">
            </property>
            <property name="_editorFactory" class="ptolemy.vergil.toolbox.AnnotationEditorFactory">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[120.0, 10.0]">
            </property>
        </property>
        <property name="DE Director" class="ptolemy.domains.de.kernel.DEDirector">
            <property name="_location" class="ptolemy.kernel.util.Location" value="[65.0, 35.0]">
            </property>
        </property>
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={0, 364, 604, 287}, 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>
        <port name="q_out" class="ptolemy.actor.TypedIOPort">
            <property name="output"/>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[275.0, 100.0]">
            </property>
            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
            </property>
            <property name="_type" class="ptolemy.actor.TypeAttribute" value="int">
            </property>
        </port>
        <port name="q_in" class="ptolemy.actor.TypedIOPort">
            <property name="input"/>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[30.0, 100.0]">
            </property>
            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
            </property>
            <property name="_type" class="ptolemy.actor.TypeAttribute" value="int">
            </property>
        </port>
        <entity name="ModalModel" class="ptolemy.domains.fsm.modal.ModalModel">
            <property name="_tableauFactory" class="ptolemy.vergil.fsm.modal.ModalTableauFactory">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="{130.0, 100.0}">
            </property>
            <port name="queue_in" class="ptolemy.domains.fsm.modal.ModalPort">
                <property name="input"/>
                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
                <property name="_hide" class="ptolemy.data.expr.SingletonParameter" value="false">
                </property>
                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
                </property>
            </port>
            <port name="queue_out" class="ptolemy.domains.fsm.modal.ModalPort">
                <property name="output"/>
                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="EAST">
                </property>
                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
            </port>
            <entity name="_Controller" class="ptolemy.domains.fsm.modal.ModalController">
                <property name="initialStateName" class="ptolemy.kernel.util.StringAttribute" value="init">
                </property>
                <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.fsm.kernel.State"><property name="_centerName" class="ptolemy.kernel.util.Attribute"></property><property name="_controllerFactory" class="ptolemy.vergil.fsm.modal.HierarchicalStateControllerFactory"></property></entity></entity>
      </configure>
                </property>
                <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={462, 365, 815, 327}, 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="annotation2" class="ptolemy.kernel.util.Attribute">
                    <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
                    </property>
                    <property name="_iconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                        <configure><svg><text x="20" y="20" style="font-size:9; font-family:SansSerif; fill:blue">Changed queue_in to just input (4-May-04 based on advice from EAL):
"The problem here is that queue_in is both an input and an output. DE does not support
such ports (they in fact are treated as causality loops).  Is there a reason that you
made queue_in be both an input and output?  If I change it to just be an input, then the
model runs."
</text></svg></configure>
                    </property>
                    <property name="_location" class="ptolemy.kernel.util.Location" value="[-10.0, 0.0]">
                    </property>
                    <property name="_controllerFactory" class="ptolemy.vergil.basic.NodeControllerFactory">
                    </property>
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.AnnotationEditorFactory">
                    </property>
                </property>
                <property name="annotation3" class="ptolemy.kernel.util.Attribute">
                    <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
                    </property>
                    <property name="_iconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                        <configure><svg><text x="20" y="20" style="font-size:9; font-family:SansSerif; fill:blue">(9May06: currently supressed, possibly,
by bus relation problem):
Changed to multiport because:
.QueueOutsideMIC.MIC.preinitialize():
output port q_out must be connected to
a multi-port in .QueueOutsideMIC.MIC
=>changed back to single port</text></svg></configure>
                    </property>
                    <property name="_location" class="ptolemy.kernel.util.Location" value="[395.0, 0.0]">
                    </property>
                    <property name="_controllerFactory" class="ptolemy.vergil.basic.NodeControllerFactory">
                    </property>
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.AnnotationEditorFactory">
                    </property>
                </property>
                <port name="queue_in" class="ptolemy.domains.fsm.modal.RefinementPort">
                    <property name="input"/>
                    <property name="_location" class="ptolemy.kernel.util.Location" value="[25.0, 125.0]">
                    </property>
                </port>
                <port name="queue_out" class="ptolemy.domains.fsm.modal.RefinementPort">
                    <property name="input"/>
                    <property name="output"/>
                    <property name="_location" class="ptolemy.kernel.util.Location" value="[435.0, 120.0]">
                    </property>
                </port>
                <entity name="Using" class="ptolemy.domains.fsm.kernel.State">
                    <property name="_controllerFactory" class="ptolemy.vergil.fsm.modal.HierarchicalStateControllerFactory">
                    </property>
                    <property name="_location" class="ptolemy.kernel.util.Location" value="[95.0, 120.0]">
                    </property>
                </entity>
                <entity name="Idle" class="ptolemy.domains.fsm.kernel.State">
                    <property name="_controllerFactory" class="ptolemy.vergil.fsm.modal.HierarchicalStateControllerFactory">
                    </property>
                    <property name="_location" class="ptolemy.kernel.util.Location" value="[375.0, 120.0]">
                    </property>
                </entity>
                <entity name="init" class="ptolemy.domains.fsm.kernel.State">
                    <property name="_controllerFactory" class="ptolemy.vergil.fsm.modal.HierarchicalStateControllerFactory">
                    </property>
                    <property name="_location" class="ptolemy.kernel.util.Location" value="[335.0, 190.0]">
                    </property>
                </entity>
                <relation name="relation" class="ptolemy.domains.fsm.kernel.Transition">
                    <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="true">
                    </property>
                    <property name="outputActions" class="ptolemy.domains.fsm.kernel.OutputActionsAttribute" value="queue_out = queue_out + 2">
                    </property>
                    <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="0.21083136556515109">
                    </property>
                    <property name="gamma" class="ptolemy.data.expr.Parameter" value="0.009761096271117788">
                    </property>
                    <property name="reset" class="ptolemy.data.expr.Parameter" value="false">
                    </property>
                    <property name="preemptive" class="ptolemy.data.expr.Parameter" value="false">
                    </property>
                    <property name="nondeterministic" class="ptolemy.data.expr.Parameter" value="false">
                    </property>
                </relation>
                <relation name="relation2" class="ptolemy.domains.fsm.kernel.Transition">
                    <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="queue_in &gt; 0">
                    </property>
                    <property name="outputActions" class="ptolemy.domains.fsm.kernel.OutputActionsAttribute" value="queue_out = queue_out - 1">
                    </property>
                    <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="0.23628591370860905">
                    </property>
                    <property name="gamma" class="ptolemy.data.expr.Parameter" value="-3.13067682051917">
                    </property>
                    <property name="reset" class="ptolemy.data.expr.Parameter" value="false">
                    </property>
                    <property name="preemptive" class="ptolemy.data.expr.Parameter" value="false">
                    </property>
                    <property name="nondeterministic" class="ptolemy.data.expr.Parameter" value="false">
                    </property>
                </relation>
                <relation name="relation3" class="ptolemy.domains.fsm.kernel.Transition">
                    <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="true">
                    </property>
                    <property name="outputActions" class="ptolemy.domains.fsm.kernel.OutputActionsAttribute" value="queue_out = 1">
                    </property>
                    <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="0.6283185307179586">
                    </property>
                    <property name="gamma" class="ptolemy.data.expr.Parameter" value="-0.3452534141203151">
                    </property>
                    <property name="reset" class="ptolemy.data.expr.Parameter" value="false">
                    </property>
                    <property name="preemptive" class="ptolemy.data.expr.Parameter" value="false">
                    </property>
                    <property name="nondeterministic" class="ptolemy.data.expr.Parameter" value="false">
                    </property>
                </relation>
                <link port="Using.incomingPort" relation="relation2"/>
                <link port="Using.outgoingPort" relation="relation"/>
                <link port="Idle.incomingPort" relation="relation"/>
                <link port="Idle.incomingPort" relation="relation3"/>
                <link port="Idle.outgoingPort" relation="relation2"/>
                <link port="init.outgoingPort" relation="relation3"/>
            </entity>
            <relation name="queue_inRelation" class="ptolemy.actor.TypedIORelation">
            </relation>
            <relation name="queue_outRelation" class="ptolemy.actor.TypedIORelation">
            </relation>
            <link port="queue_in" relation="queue_inRelation"/>
            <link port="queue_out" relation="queue_outRelation"/>
            <link port="_Controller.queue_in" relation="queue_inRelation"/>
            <link port="_Controller.queue_out" relation="queue_outRelation"/>
        </entity>
        <entity name="Inside MIC" class="ptolemy.actor.lib.gui.Display">
            <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="20">
            </property>
            <property name="title" class="ptolemy.kernel.util.StringAttribute" value="Inside MIC">
            </property>
            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={286, 775, 152, 222}, maximized=false}">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[285.0, 155.0]">
            </property>
        </entity>
        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation3" class="ptolemy.actor.TypedIORelation">
            <vertex name="vertex1" value="[235.0, 100.0]">
            </vertex>
        </relation>
        <link port="q_out" relation="relation3"/>
        <link port="q_in" relation="relation2"/>
        <link port="ModalModel.queue_in" relation="relation2"/>
        <link port="ModalModel.queue_out" relation="relation3"/>
        <link port="Inside MIC.input" relation="relation3"/>
    </entity>
    <entity name="Queue" class="ptolemy.domains.de.lib.Queue">
        <property name="QueueIcon" class="ptolemy.vergil.icon.EditorIcon">
            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds = {104, 126, 815, 516}, maximized = false}">
            </property>
            <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 400]">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[230.0, 140.0]">
        </property>
        <port name="input" class="ptolemy.actor.TypedIOPort">
            <property name="input"/>
            <property name="_type" class="ptolemy.actor.TypeAttribute" value="int">
            </property>
        </port>
        <port name="output" class="ptolemy.actor.TypedIOPort">
            <property name="output"/>
            <property name="_type" class="ptolemy.actor.TypeAttribute" value="int">
            </property>
        </port>
    </entity>
    <entity name="Clock" class="ptolemy.actor.lib.Clock">
        <doc>Create a set of pulses</doc>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[45.0, 215.0]">
        </property>
    </entity>
    <entity name="TimedDelay" class="ptolemy.domains.de.lib.TimedDelay">
        <property name="TimedDelayIcon" class="ptolemy.vergil.icon.EditorIcon">
            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={137, 109, 815, 518}, maximized=false}">
            </property>
            <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 400]">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[55.0, 140.0]">
        </property>
    </entity>
    <entity name="TopLevel" class="ptolemy.actor.lib.gui.Display">
        <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="20">
        </property>
        <property name="title" class="ptolemy.kernel.util.StringAttribute" value="TopLevel">
        </property>
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={1056, 771, 152, 222}, maximized=false}">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[655.0, 80.0]">
        </property>
    </entity>
    <entity name="SingleEvent" class="ptolemy.domains.de.lib.SingleEvent">
        <property name="value" class="ptolemy.data.expr.Parameter" value="1">
        </property>
        <property name="SingleEventIcon" class="ptolemy.vergil.icon.EditorIcon">
            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={292, 266, 815, 518}, maximized=false}">
            </property>
            <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 400]">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[130.0, 185.0]">
        </property>
    </entity>
    <entity name="Commutator" class="ptolemy.actor.lib.Commutator">
        <property name="CommutatorIcon" class="ptolemy.vergil.icon.EditorIcon">
            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds = {46, 101, 815, 516}, maximized = false}">
            </property>
            <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 400]">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[565.0, 140.0]">
        </property>
    </entity>
    <entity name="Post-Queue" class="ptolemy.actor.lib.gui.Display">
        <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="20">
        </property>
        <property name="title" class="ptolemy.kernel.util.StringAttribute" value="Post-Queue">
        </property>
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={2, 774, 152, 222}, maximized=false}">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[335.0, 205.0]">
        </property>
    </entity>
    <entity name="Post MIC" class="ptolemy.actor.lib.gui.Display">
        <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="20">
        </property>
        <property name="title" class="ptolemy.kernel.util.StringAttribute" value="Post MIC">
        </property>
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={903, 772, 152, 222}, maximized=false}">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[500.0, 205.0]">
        </property>
    </entity>
    <relation name="relation" class="ptolemy.actor.TypedIORelation">
    </relation>
    <relation name="relation5" class="ptolemy.actor.TypedIORelation">
        <vertex name="vertex1" value="[610.0, 80.0]">
        </vertex>
    </relation>
    <relation name="relation4" class="ptolemy.actor.TypedIORelation">
        <vertex name="vertex1" value="[185.0, 140.0]">
        </vertex>
    </relation>
    <relation name="relation2" class="ptolemy.actor.TypedIORelation">
        <vertex name="vertex1" value="[290.0, 140.0]">
        </vertex>
    </relation>
    <relation name="relation6" class="ptolemy.actor.TypedIORelation">
        <vertex name="vertex1" value="[455.0, 140.0]">
        </vertex>
    </relation>
    <link port="MIC.q_out" relation="relation6"/>
    <link port="MIC.q_in" relation="relation2"/>
    <link port="Queue.input" relation="relation4"/>
    <link port="Queue.output" relation="relation2"/>
    <link port="Queue.trigger" relation="relation"/>
    <link port="Clock.output" relation="relation"/>
    <link port="TimedDelay.input" relation="relation5"/>
    <link port="TimedDelay.output" relation="relation4"/>
    <link port="TopLevel.input" relation="relation5"/>
    <link port="SingleEvent.output" relation="relation4"/>
    <link port="Commutator.input" relation="relation6"/>
    <link port="Commutator.output" relation="relation5"/>
    <link port="Post-Queue.input" relation="relation2"/>
    <link port="Post MIC.input" relation="relation6"/>
</entity>

Reply via email to