Bug?

2008-12-24 Thread Richard Ware
  While reading the Ptolemy code, I found the following anomaly:

FloydWarshallAllPairShortestPathStrategy implements
AllPairShortestPathAnalyzer.

FloydWarshallCycleExistenceStrategy implements
CycleExistenceAnalyzer.

FloydWarshallNegativeLengthCycleStrategy implements
NegativeLengthCycleAnalyzer.

FloydWarshallTransitiveClosureStrategy implements
TransitiveClosureAnalyzer.

But
FloydWarshallZeroLengthCycleStrategy implements, not
ZeroLengthCycleAnalyzer, but
NegativeLengthCycleAnalyzer.

  Is this a bug?  Or just a design choice that doesn't
follow the pattern?


Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: ptolemy-hackers-requ...@ptolemy.eecs.berkeley.edu


Problem with escaped characters in MoML, [was Re: bug report.]

2008-07-11 Thread Christopher Brooks
Hi Jianwu,

This seems to be an issue with Kepler's documentation system.  The
custom documentation system in Ptolemy works fine.  


The difference between the two .xml files you attached is below:

[EMAIL PROTECTED] 34% diff model1.xml model2.xml
4c4
 entity name=model3 class=ptolemy.actor.TypedCompositeActor
---
 entity name=model4 class=ptolemy.actor.TypedCompositeActor
26c26
 property name=userLevelDocumentation 
class=ptolemy.kernel.util.ConfigurableAttributeconfigurephelloThe 
StringConstant actor outputs a string specified via the actor's value 
parameter./p
---
 property name=userLevelDocumentation 
 class=ptolemy.kernel.util.ConfigurableAttributeconfigureplt;hellogt;The
  StringConstant actor outputs a string specified via the actor's value 
 parameter./p
[EMAIL PROTECTED] 35%

If, under Ptolemy II 7.1.devel, I do this:
1) Start up, create a blank model
2) Drag a StringConst in
3) Right click, select Documentation | Customize Documentation
4) In the description field, enter

This is a btest/b of gt; in a description

5) View the documentation, it looks fine:

This is a test of  in a description

6) Saving and reloading the file seems to work fine as well.


In step 2 of your example, you edit the xml by hand, right?  One
solution is to not do that :-)

The issue here is that configure is defined to have PCDATA,
not CDATA.

The MoML DTD says:

!ELEMENT configure (#PCDATA)
!ATTLIST configure source CDATA #IMPLIED


http://www.w3schools.com/dtd/dtd_building.asp
described PCDATA and CDATA
--start--
PCDATA

PCDATA means parsed character data.

Think of character data as the text found between the start tag and
the end tag of an XML element.

PCDATA is text that WILL be parsed by a parser. The text will be
examined by the parser for entities and markup.

Tags inside the text will be treated as markup and entities will be
expanded.

However, parsed character data should not contain any , , or 
characters; these need to be represented by the amp; lt; and gt;
entities, respectively.

CDATA

CDATA means character data.

CDATA is text that will NOT be parsed by a parser. Tags inside the
text will NOT be treated as markup and entities will not be expanded.
--end--

So, if you use configure, then the contents get parsed and thus
should be well formed xml.

Now, it might be possible to something with configure source=Foo.xml
but I'm not sure.

I think there is a bug here in that if the inside of configure is

  gt;hellogt;

then somehow that should be preserved.  However, I'm not sure how to
do that.

_Christopher





Hi guys:

We met an exception on escaped character parsing of moml file. You 
can recur the exception by the following steps:
1, get one moml file (as model1.xml in attachement)
2, edit the moml file by adding lt;hellogt; in a certain configure 
(as model2.xml in attachement)
3, open the edited moml file (model2.xml)

There will be an exception when you save as the edited moml file 
(model2.xml) or save and open it. It is because lt;hellogt; is 
changed to hello when you save the file.

Any ideas? Thanks.

-- 

Best wishes

Sincerely yours

Jianwu Wang
[EMAIL PROTECTED]

Post-Doctor
Scientific Workflow Automation Technologies (SWAT) Laboratory
San Diego Supercomputer Center 
University of California, San Diego
San Diego, U.S.A. 


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


Re: Problem with escaped characters in MoML, [was Re: bug report.]

2008-07-11 Thread Jianwu Wang

Hi, Christopher,

   Thanks for your detailed reply. I made a mistake in model1.xml. It 
should not have the String: hello. Yet the bug still exist.


   Did you try customizing actor document with lt;anystringgt; ?  I 
think it will throw exception when you save and reopen it. If you 
customize actor document with anystring, it can not be saved. They 
happens in Kepler. Because the moml paser will throw exeption when it 
found anystring but didn't found /anystring.


   We did not intend to change moml file manually. :) The bug 
originated from one of our new kepler actor which has document with  
string. We have transform them to lt;gt; character when it is added. 
It works when it is saved for the first time. But throws exception when 
we reopen and save as an another file. It is because the file is saved 
as lt;anystringgt; for the first time but as anystring for the 
second time.


   I will report it in kepler bugzilla for record.

Best wishes

Sincerely yours

Jianwu Wang
[EMAIL PROTECTED]

Post-Doctor
Scientific Workflow Automation Technologies (SWAT) Laboratory
San Diego Supercomputer Center 
University of California, San Diego
San Diego, U.S.A. 




Christopher Brooks wrote:

Hi Jianwu,

This seems to be an issue with Kepler's documentation system.  The
custom documentation system in Ptolemy works fine.  



The difference between the two .xml files you attached is below:

[EMAIL PROTECTED] 34% diff model1.xml model2.xml
4c4
 entity name=model3 class=ptolemy.actor.TypedCompositeActor
---
  

entity name=model4 class=ptolemy.actor.TypedCompositeActor


26c26
 property name=userLevelDocumentation 
class=ptolemy.kernel.util.ConfigurableAttributeconfigurephelloThe StringConstant actor 
outputs a string specified via the actor's value parameter./p
---
  

property name=userLevelDocumentation 
class=ptolemy.kernel.util.ConfigurableAttributeconfigureplt;hellogt;The StringConstant 
actor outputs a string specified via the actor's value parameter./p


[EMAIL PROTECTED] 35%

If, under Ptolemy II 7.1.devel, I do this:
1) Start up, create a blank model
2) Drag a StringConst in
3) Right click, select Documentation | Customize Documentation
4) In the description field, enter

This is a btest/b of gt; in a description

5) View the documentation, it looks fine:

This is a test of  in a description

6) Saving and reloading the file seems to work fine as well.


In step 2 of your example, you edit the xml by hand, right?  One
solution is to not do that :-)

The issue here is that configure is defined to have PCDATA,
not CDATA.

The MoML DTD says:

!ELEMENT configure (#PCDATA)
!ATTLIST configure source CDATA #IMPLIED


http://www.w3schools.com/dtd/dtd_building.asp
described PCDATA and CDATA
--start--
PCDATA

PCDATA means parsed character data.

Think of character data as the text found between the start tag and
the end tag of an XML element.

PCDATA is text that WILL be parsed by a parser. The text will be
examined by the parser for entities and markup.

Tags inside the text will be treated as markup and entities will be
expanded.

However, parsed character data should not contain any , , or 
characters; these need to be represented by the amp; lt; and gt;
entities, respectively.

CDATA

CDATA means character data.

CDATA is text that will NOT be parsed by a parser. Tags inside the
text will NOT be treated as markup and entities will not be expanded.
--end--

So, if you use configure, then the contents get parsed and thus
should be well formed xml.

Now, it might be possible to something with configure source=Foo.xml
but I'm not sure.

I think there is a bug here in that if the inside of configure is

  gt;hellogt;

then somehow that should be preserved.  However, I'm not sure how to
do that.

_Christopher





Hi guys:

We met an exception on escaped character parsing of moml file. You 
can recur the exception by the following steps:

1, get one moml file (as model1.xml in attachement)
2, edit the moml file by adding lt;hellogt; in a certain configure 
(as model2.xml in attachement)

3, open the edited moml file (model2.xml)

There will be an exception when you save as the edited moml file 
(model2.xml) or save and open it. It is because lt;hellogt; is 
changed to hello when you save the file.

Any ideas? Thanks.

-- 

Best wishes

Sincerely yours

Jianwu Wang

[EMAIL PROTECTED]

Post-Doctor

Scientific Workflow Automation Technologies (SWAT) Laboratory
San Diego Supercomputer Center 
University of California, San Diego
San Diego, U.S.A. 
  


Re: CT in DE in CT bug.

2007-02-28 Thread Xavier Snelgrove
It seems like the problem may be more than that. The test-case I  
posted was a stripped-down version of a more complex model in which  
the internal CT model did have components which care about the  
passage of time.

I've attached a new proof-of-concept showing this.

Xavier Snelgrove


?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=CTinDEinCTNEW class=ptolemy.actor.TypedCompositeActor
property name=_createdBy class=ptolemy.kernel.attributes.VersionAttribute value=6.1.devel
/property
property name=CT Director class=ptolemy.domains.ct.kernel.CTMixedSignalDirector
property name=_location class=ptolemy.kernel.util.Location value={55, 40}
/property
/property
property name=_windowProperties class=ptolemy.actor.gui.WindowPropertiesAttribute value={bounds={125, 22, 813, 507}, 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=Annotation class=ptolemy.vergil.kernel.attributes.TextAttribute
property name=text class=ptolemy.kernel.util.StringAttribute value=This is a proof of concept of a bug in Ptolemy II 6.0.#10;Time does not pass, unless you remove the CT actor#10;within the DE actor shown here.
/property
property name=_location class=ptolemy.kernel.util.Location value=[170.0, 25.0]
/property
/property
entity name=PeriodicSampler class=ptolemy.domains.ct.lib.CTPeriodicSampler
property name=_location class=ptolemy.kernel.util.Location value=[235.0, 180.0]
/property
/entity
entity name=Nested DE class=ptolemy.actor.TypedCompositeActor
property name=_location class=ptolemy.kernel.util.Location value=[345.0, 185.0]
/property
property name=DE Director class=ptolemy.domains.de.kernel.DEDirector
property name=_location class=ptolemy.kernel.util.Location value={45, 35}
/property
/property
property name=Annotation class=ptolemy.vergil.kernel.attributes.TextAttribute
property name=text class=ptolemy.kernel.util.StringAttribute value=Remove me to make execution work again!
/property
property name=_location class=ptolemy.kernel.util.Location value=[175.0, 70.0]
/property
/property
property name=Line class=ptolemy.vergil.kernel.attributes.LineAttribute
property name=_location class=ptolemy.kernel.util.Location value=[310.0, 90.0]
/property
property name=x class=ptolemy.data.expr.Parameter value=-20
/property
property name=y class=ptolemy.data.expr.Parameter value=80
/property
/property
property name=_windowProperties class=ptolemy.actor.gui.WindowPropertiesAttribute value={bounds={106, 130, 813, 507}, 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=port class=ptolemy.actor.TypedIOPort
property name=input/
property name=_location class=ptolemy.kernel.util.Location value={20.0, 200.0}
/property
/port
port name=port2 class=ptolemy.actor.TypedIOPort
property name=output/
property name=_location class=ptolemy.kernel.util.Location value={580.0, 200.0}
/property
/port
entity name=Nested CT class=ptolemy.actor.TypedCompositeActor
property name=_location class=ptolemy.kernel.util.Location value=[255.0, 230.0]
/property
property name=CT Director class=ptolemy.domains.ct.kernel.CTMixedSignalDirector
property name=_location class=ptolemy.kernel.util.Location value={40, 50}
/property
/property
property name=_windowProperties class=ptolemy.actor.gui.WindowPropertiesAttribute value={bounds={105, 130, 813, 507}, 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=port class=ptolemy.actor.TypedIOPort
property name=input

CT in DE in CT bug.

2007-02-12 Thread webmaster
Hello all,

There appears to be some sort of a bug when you nest a CT actor within a
DE actor which is, in turn, within a CT domain. Time does not ever advance
past 0. This problem is new with v6.0, and can be seen with a test-case
I've made at:

http://wxs.ca/ptII/CTinDEinCTbase.xml

That example will run normally in v5, time advances and it plots a
straight line as you would expect. In v6 it sits at time 0.

I'm on a Mac, but I assume that's a non-issue for something as fundamental
as this. I have not, however, tested it on any other systems, so it may be
platform-specific.

   Thanks,
 Xavier Snelgrove



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


Re: Bug in RecordUpdate

2006-11-14 Thread Christopher Brooks
Hi J.S,

Thanks I added your test case to the tree as
actor/lib/test/auto/RecordUpdater2.xml

The model has a RecordUpdater with three inputs.  

   Const  ||
   Const2 ||---
   Const3 || 

The last input port of the RecordUpdater (associate with Const3) has a
type constraint that is set to int.  If I set the type constraint of
the third input to unknown and set the output of Const3 to int, then
the problem goes away.

There is a bug here, but I'm not sure of an easy fix.

I cleaned up the error message so we now get:

ptolemy.kernel.util.InvalidStateException: Port 
.RecordUpdater2.RecordUpdater.id of type int in an InequalityTerm
is not settable. If the port is an input and has a type constraint,
try removing the type constraint and possibly placing it on the
output.
at ptolemy.graph.InequalitySolver._addToClist(InequalitySolver.java:324)
at 
ptolemy.graph.InequalitySolver.addInequality(InequalitySolver.java:107)
at 
ptolemy.graph.InequalitySolver.addInequalities(InequalitySolver.java:93)
at 
ptolemy.actor.TypedCompositeActor.resolveTypes(TypedCompositeActor.java:259)
at ptolemy.actor.Manager.resolveTypes(Manager.java:993)
at ptolemy.actor.Manager.preinitializeAndResolveTypes(Manager.java:890)
at ptolemy.actor.Manager.initialize(Manager.java:572)
at ptolemy.actor.Manager.execute(Manager.java:320)
at ptolemy.actor.Manager.run(Manager.java:1044)
at ptolemy.actor.Manager$3.run(Manager.java:1085)

The error message is a too verbose, but it might help the next person.

Maybe someone else has an idea here?

_Christopher

Hi,

I found a bug in RecordUpdate. When you add an input port and enforce a
Type (e.g. string, int, etc.) it breaks with the following stack:

ptolemy.kernel.util.InvalidStateException: Variable in an InequalityTerm
is not settable.
at ptolemy.graph.InequalitySolver._addToClist(InequalitySolver.java:308
   )
at ptolemy.graph.InequalitySolver.addInequality(InequalitySolver.java:1
   06)
at ptolemy.graph.InequalitySolver.addInequalities(InequalitySolver.java
   :92)
at
ptolemy.actor.TypedCompositeActor.resolveTypes(TypedCompositeActor.java:259
   )
at ptolemy.actor.Manager.resolveTypes(Manager.java:989)
at ptolemy.actor.Manager.preinitializeAndResolveTypes(Manager.java:886)
at ptolemy.actor.Manager.initialize(Manager.java:572)
at ptolemy.actor.Manager.execute(Manager.java:320)
at ptolemy.actor.Manager.run(Manager.java:1040)
at ptolemy.actor.Manager$3.run(Manager.java:1081)

The original test for RecordUpdater
(ptolemy/actor/lib/test/auto/RecordUpdater.xml) wasn't able to find it
because it did not enforce any type. The test file I send in attach. to
this email is just a small modif. of it, trying to force an int input.

Cheers,

++ js


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


Re: [kepler-dev] PN + NondeterministicMerge bug/question (fwd)

2006-07-31 Thread Christopher Brooks
Hi Norbert,

I modified your example slightly and added it as a test as
ptII/ptolemy/domains/pn/test/auto/Branching-switch-PN-ptolemy.xml

I can't get this to fail though.
I'm running under Java 1.5.0_06 under Windows with the Ptolemy CVS
tree.  
I changed the Sleep actor to 0L and I always get 10 outputs.

I've left a copy of what I checked in at:
http://ptolemy.eecs.berkeley.edu/~cxh/models/Branching-switch-PN-ptolemy.xml

If you have a chance, could you download that version and try
replicating the error?  
Also, what version of Java and what OS (Linux? Windows?) are you
running.

If you let me know via email, I'll summarize to the list once we get
to the bottom of the problem.

_Christopher




Hi,

I have created a small workflow to demonstrate the Switch actor. A Ramp 
produces numbers 1..10, an Expression produces 0..2 (input mod 3), and the 
Switch has three channels, each with just one Expression to produce a Strin
   g. 
Finally, the three branches are brough together with NondeterministicMerge 
   and 
the strings are displayed.

So there I expect 10 strings as output, which is mostly the case if I run i
   t. 
However, sometimes - quite frequently - less strings are displayed (tokens 
somewhere are lost) when the workflow stops.

The workflow works nicely if I do one of the followings:
  - replace NondeterministicActor for Select
  - put a Sleep with 1ms to slow down the execution

So it seems to me that PN senses termination condition wrongly in the origi
   nal 
case. Or what else?

I attach the workflow, already with the Sleep, so it works as expected.
If you delete the Sleep actor (or even just set to 0) and run it a couple o
   f 
times, you will see shorter outputs occasionally.

I would like to understand what is happening and why (except if it is a bug
   ). 
Thanks in advance for explanation.
Norbert

  Norbert Podhorszki

  University of California, Davis
  Department of Computer Science
  1 Shields Ave, 2236 Kemper Hall
  Davis, CA 95616
  (530) 754-8188
  [EMAIL PROTECTED]
  --


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


Re: [kepler-dev] PN + NondeterministicMerge bug/question (fwd)

2006-07-31 Thread Norbert Podhorszki


Hi Christopher,
I could see the early stop only once with your workflow, in which case 
only 9 from 10 tokens arrived at the end. Since then it seems to be warmed 
up, as never more behaves incorrectly.


Opening user preferences PtolemyPreferences.xml...
247 ms. Memory: 4812K Free: 1882K (39%)
173 ms. Memory: 4812K Free: 1511K (31%)
72 ms. Memory: 4812K Free: 1198K (25%)
80 ms. Memory: 4812K Free: 193K (4%)
58 ms. Memory: 4812K Free: 1917K (40%)
56 ms. Memory: 4812K Free: 1377K (29%)
Warning: '.Branching-switch-PN-ptolemy.Test' The test produced only 9 
tokens, yet the correctValues parameter was expecting 10 tokens.

66 ms. Memory: 4812K Free: 1038K (22%)
88 ms. Memory: 4812K Free: 457K (9%)
55 ms. Memory: 4812K Free: 1708K (35%)
65 ms. Memory: 4812K Free: 1121K (23%)
51 ms. Memory: 4812K Free: 328K (7%)
...

When I replaced the Test for Display, I got bad results more 
frequently (1 from 4-5 runs), with 5,6,7 tokens out of 10, resp.


Test env:
  P4 2.80 D, 1GB RAM
  Linux, Fedora Core 4
  Java 1.4.2_10-b03

Norbert



On Mon, 31 Jul 2006, Christopher Brooks wrote:


Hi Norbert,

I modified your example slightly and added it as a test as
ptII/ptolemy/domains/pn/test/auto/Branching-switch-PN-ptolemy.xml

I can't get this to fail though.
I'm running under Java 1.5.0_06 under Windows with the Ptolemy CVS
tree.
I changed the Sleep actor to 0L and I always get 10 outputs.

I've left a copy of what I checked in at:
http://ptolemy.eecs.berkeley.edu/~cxh/models/Branching-switch-PN-ptolemy.xml

If you have a chance, could you download that version and try
replicating the error?
Also, what version of Java and what OS (Linux? Windows?) are you
running.

If you let me know via email, I'll summarize to the list once we get
to the bottom of the problem.

_Christopher




   Hi,

   I have created a small workflow to demonstrate the Switch actor. A Ramp
   produces numbers 1..10, an Expression produces 0..2 (input mod 3), and the
   Switch has three channels, each with just one Expression to produce a Strin
  g.
   Finally, the three branches are brough together with NondeterministicMerge
  and
   the strings are displayed.

   So there I expect 10 strings as output, which is mostly the case if I run i
  t.
   However, sometimes - quite frequently - less strings are displayed (tokens
   somewhere are lost) when the workflow stops.

   The workflow works nicely if I do one of the followings:
 - replace NondeterministicActor for Select
 - put a Sleep with 1ms to slow down the execution

   So it seems to me that PN senses termination condition wrongly in the origi
  nal
   case. Or what else?

   I attach the workflow, already with the Sleep, so it works as expected.
   If you delete the Sleep actor (or even just set to 0) and run it a couple o
  f
   times, you will see shorter outputs occasionally.

   I would like to understand what is happening and why (except if it is a bug
  ).
   Thanks in advance for explanation.
   Norbert

 Norbert Podhorszki
   
 University of California, Davis
 Department of Computer Science
 1 Shields Ave, 2236 Kemper Hall
 Davis, CA 95616
 (530) 754-8188
 [EMAIL PROTECTED]
 --




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