Hi Haiyang,

Many, many thanks for the detailed analysis.

It looks like the QueueOutsideMIC.xml model failure is moving around.
Chuck, the original author of the test case was getting a different
failure in Ptolemy II 5.0.1 (See below)

On May 18, in the devel tree, I was getting an exception.
Then, on or about May 31, the model started never exiting.

Chuck, to access the devel tree, see
http://chess.eecs.berkeley.edu/ptexternal 

_Christopher


--------

    There two issues about this model.
    
    1. Both TimedDelay and SingleEvent actors drive the Queue 
    actor, which is not right. A Merge actor is necessary to 
    merge the two output signals into one input signal for the 
    Queue actor.
    
    2. FSMDirector now supports transient states, meaning that 
    once a transition is enabled and taken, the modal model will 
    request another firing by calling the fireAt() method with 
    the current time as the argument. This causes the 
    QueueOutsideMIC model to deadlock.
    
    Note that the MIC model resides inside a DE model, which is 
    usually fired only when the MIC model receives some input 
    event. However, with the FSMDirector supporting transient 
    states, the MIC model may also be fired with pure events 
    posted by itself.
    
    The modal model inside the MIC model has a transition from 
    the Idle state to the Using state whose guard expression is 
    "queue_in > 0". Because the way to check whether a 
    transition is enabled or not is based on a hashmap that 
    associates variables with their values, this transition 
    happens to enabled all the time. With the transition from 
    the Using state to the Idle state is always enabled too 
    (with a true guard), both the Idle and Using states become 
    transient. This causes the model to deadlock.
    
    One fix is to prefix the guard expression with 
    "queue_in_isPresent && ", which serves as a predicate. 
    Another way to think about this prefix is that it serves as 
    a prefire() method. I checked in the fixed version of the 
    test.
    
    -Haiyang
    
    > >
    >> ############################
    >> Failed: 666  Total Tests: 0 ((Passed: 0, Newly Passed: 0) 
    >> Known Failed: 0) util.testsuite.WatchDog went off
    >>
    >> ------------------ testing 
    >> $PTII/ptolemy/actor/lib/hoc/test/auto/QueueOutsideMIC.xml
    >>
    >> never exits.
    >>
    >> This is a test from Chuck that I added.  It used to exit
    >>
    >
    > I am still working on this one. This has to do with my 
    > change to the FSMDirector.
    > Christopher, could you temporarily remove this file from 
    > the test to make the nightly build pass? I saved a copy on 
    > my machine and will check it back into the repository when 
    > I find a solution.
    >
--------


> From: "Christopher Brooks" <[EMAIL PROTECTED]>
> To: "Lutz, Charles D" <[EMAIL PROTECTED]>
> Subject: Re: Undefined port error - repeatable behavior 
> Cc: ptolemy-hackers@bennett.EECS.Berkeley.EDU
> Date: Thu, 18 May 2006 18:17:55 -0700
> 
> Hi Chuck,
> 
> It looks like a different bug in the devel tree as well.
> I took your model, replaced the Display actors with Tests and added it as
> ptolemy/actor/lib/hoc/test/auto/QueueOutsideMIC.xml
> 
> ptolemy.kernel.util.IllegalActionException:   in 
> .QueueOutsideMIC.MoMLSimpleApp
>     lication
> Because:
> Attempt to add a node that is already contained in the graph.
> Dumps of the offending node and graph follow.
> The offending node:
> ptolemy.actor.TypedIOPort {.QueueOutsideMIC.MIC.q_in}
> The offending graph:
> {ptolemy.graph.DirectedGraph
> Node Set:
> 0: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Clock.trigger}
> 1: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Clock.output}
> 2: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.MIC.q_in}
> 3: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.MIC.q_out}
> 4: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Queue.input}
> 5: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Queue.trigger}
> 6: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Queue.output}
> 7: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Queue.size}
> 8: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.TimedDelay.input}
> 9: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.TimedDelay.output}
> 10: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.SingleEvent.output}
> 11: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Commutator.input}
> 12: ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Commutator.output}
> Edge Set:
> 0: (ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Clock.trigger}, 
> ptolemy.actor.T
>     ypedIOPort {.QueueOutsideMIC.Clock.output})
> 1: (ptolemy.actor.TypedIOPort {.QueueOutsideMIC.MIC.q_in}, 
> ptolemy.actor.TypedI
>     OPort {.QueueOutsideMIC.MIC.q_out})
> 2: (ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Queue.input}, 
> ptolemy.actor.Typ
>     edIOPort {.QueueOutsideMIC.Queue.size})
> 3: (ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Queue.trigger}, 
> ptolemy.actor.T
>     ypedIOPort {.QueueOutsideMIC.Queue.output})
> 4: (ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Queue.trigger}, 
> ptolemy.actor.T
>     ypedIOPort {.QueueOutsideMIC.Queue.size})
> 5: (ptolemy.actor.TypedIOPort {.QueueOutsideMIC.Commutator.input}, 
> ptolemy.acto
>     r.TypedIOPort {.QueueOutsideMIC.Commutator.output})
> }
> 
> 
>       at ptolemy.actor.Manager.execute(Manager.java:386)
>       at ptolemy.actor.gui.MoMLSimpleApplication.rerun(MoMLSimpleApplication.
>     java:219)
>       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
>     ssorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at tcl.lang.reflect.PkgInvoker.invokeMethod(PkgInvoker.java:129)
>       at tcl.lang.JavaInvoke.call(JavaInvoke.java:253)
>       at tcl.lang.JavaInvoke.callMethod(JavaInvoke.java:116)
> 
> Offhand, I'm not sure what the problem is.
> I also had problems adding a test actor to just after the MIC block.
> I was getting cast problems.  
> 
> _Christopher
> 
> --------
>     
>     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
> 
> ----------------------------------------------------------------------------
> 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