Re: bug in SDFScheduler?

2007-12-12 Thread Chad Berkley

Hey Stephen,

Here's the error.  I'm not sure why it's complaining about the 
consumption rate.  What is happening is there is a input port connected 
to a repeat actor.  the number of iterations of the repeat actor is set 
by a portparam.  The portparam is set statically by a higher level 
parameter at design time.  It is never actually changed during runtime 
(as the error seems to indicate), but the director seems to think it 
could be changed and complains.


chad

[java] ptolemy.kernel.util.IllegalActionException: Failed to compute 
schedule:

 [java]   in .distributedModel.DistributedCompositeActor.SDF Director
 [java] Because:
 [java] The SDF rate parameter changes during execution of the 
schedule!
 [java]   in .distributedModel.DistributedCompositeActor.Calculate 
Best Rulesets.longitude_latitude_table._tokenConsumptionRate
 [java] at 
ptolemy.domains.sdf.kernel.SDFDirector.preinitialize(SDFDirector.java:548)
 [java] at 
ptolemy.actor.CompositeActor.preinitialize(CompositeActor.java:1076)

 [java] at ptolemy.actor.Director.preinitialize(Director.java:865)
 [java] at 
ptolemy.domains.sdf.kernel.SDFDirector.preinitialize(SDFDirector.java:527)
 [java] at 
ptolemy.actor.CompositeActor.preinitialize(CompositeActor.java:1076)
 [java] at 
ptolemy.actor.Manager.preinitializeAndResolveTypes(Manager.java:912)

 [java] at ptolemy.actor.Manager.initialize(Manager.java:578)
 [java] at ptolemy.actor.Manager.execute(Manager.java:321)
 [java] at 
org.kepler.distributed.SlaveController.run(SlaveController.java:514)
 [java] at 
org.kepler.distributed.SlaveController.ready(SlaveController.java:738)
 [java] at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown 
Source)
 [java] at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

 [java] at java.lang.reflect.Method.invoke(Method.java:585)
 [java] at 
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)

 [java] at sun.rmi.transport.Transport$1.run(Transport.java:153)
 [java] at java.security.AccessController.doPrivileged(Native 
Method)
 [java] at 
sun.rmi.transport.Transport.serviceCall(Transport.java:149)
 [java] at 
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
 [java] at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)

 [java] at java.lang.Thread.run(Thread.java:595)
 [java] Caused by: ptolemy.kernel.util.IllegalActionException: The 
SDF rate parameter changes during execution of the schedule!
 [java]   in .distributedModel.DistributedCompositeActor.Calculate 
Best Rulesets.longitude_latitude_table._tokenConsumptionRate
 [java] at 
ptolemy.domains.sdf.kernel.SDFScheduler._assertDynamicRateVariable(SDFScheduler.java:869)
 [java] at 
ptolemy.domains.sdf.kernel.SDFScheduler._checkDynamicRateVariables(SDFScheduler.java:306)
 [java] at 
ptolemy.domains.sdf.kernel.SDFScheduler._getSchedule(SDFScheduler.java:501)
 [java] at 
ptolemy.actor.sched.Scheduler.getSchedule(Scheduler.java:188) [java] 
at 
ptolemy.domains.sdf.kernel.SDFDirector.preinitialize(SDFDirector.java:542)

 [java] ... 19 more
 [java] Caused by: ptolemy.kernel.util.IllegalActionException: The 
SDF rate parameter changes during execution of the schedule!
 [java]   in .distributedModel.DistributedCompositeActor.Calculate 
Best Rulesets.longitude_latitude_table._tokenConsumptionRate
 [java] at 
ptolemy.domains.sdf.kernel.SDFScheduler._assertDynamicRateVariable(SDFScheduler.java:869)
 [java] at 
ptolemy.domains.sdf.kernel.SDFScheduler._checkDynamicRateVariables(SDFScheduler.java:306)
 [java] at 
ptolemy.domains.sdf.kernel.SDFScheduler._getSchedule(SDFScheduler.java:501)
 [java] at 
ptolemy.actor.sched.Scheduler.getSchedule(Scheduler.java:188) [java] 
at 
ptolemy.domains.sdf.kernel.SDFDirector.preinitialize(SDFDirector.java:542)
 [java] at 
ptolemy.actor.CompositeActor.preinitialize(CompositeActor.java:1076)

 [java] at ptolemy.actor.Director.preinitialize(Director.java:865)
 [java] at 
ptolemy.domains.sdf.kernel.SDFDirector.preinitialize(SDFDirector.java:527)
 [java] at 
ptolemy.actor.CompositeActor.preinitialize(CompositeActor.java:1076)
 [java] at 
ptolemy.actor.Manager.preinitializeAndResolveTypes(Manager.java:912)

 [java] at ptolemy.actor.Manager.initialize(Manager.java:578)
 [java] at ptolemy.actor.Manager.execute(Manager.java:321)
 [java] at 
org.kepler.distributed.SlaveController.run(SlaveController.java:514)
 [java] at 
org.kepler.distributed.SlaveController.ready(SlaveController.java:738)
 [java] at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown 
Source)
 [java] at 

Re: actor configuration pane customization

2007-10-10 Thread Chad Berkley

Thanks Edward, that totally worked.

chad

Edward A. Lee wrote:

I think you want to extend EditorFactory rather than EditorPaneFactory.

Edward

At 01:47 PM 10/9/2007, you wrote:

Hi,

I've recently customized the configuration pane on one of my actors by 
extending EditorPaneFactory.  The problem I'm having is that the default 
buttons in the configuration dialog still appear, although they now make no 
sense in my dialog.  Is there a way to keep all or some of them from appearing?

thanks,
chad


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



 
Edward A. Lee

Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal  




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


actor configuration pane customization

2007-10-09 Thread Chad Berkley

Hi,

I've recently customized the configuration pane on one of my actors by 
extending EditorPaneFactory.  The problem I'm having is that the default 
buttons in the configuration dialog still appear, although they now make 
no sense in my dialog.  Is there a way to keep all or some of them from 
appearing?


thanks,
chad


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


Re: Looking for a 802.11 or 802.15.4 actor

2007-10-09 Thread Christopher Brooks
Hi Manuel
There is a start on some 802.11 actors in
ptII/ptolemy/domains/wireless/lib/network

This directory is not shipped as part of the Ptolemy releases, but
is available via CVS.  To get access via read only cvs, see
http://chess.eecs.berkeley.edu/ptexternal

I have no idea if this code works at all, but it might be a start.

_Christopher



I am looking for a 802.11 or 802.15.4 actor . Has anyone built any of 
these kind of actors or similar actors ?

Thanks

Manuel Ferreira



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


Re: Data Type Mapping

2007-08-06 Thread Nathan Potter



Edward et. al,


Perhaps I should have prefaced my request with an explanation of what  
I am up too. I am working on the REAP project (Which I imagine you  
are already familiar with. The REAP's PIs include the lead PIs that  
initiated the Kepler project e.g., Ludäscher, Jones, Altintas, etc.)


Part of the REAP project is to provide data integration with OPeNDAP  
data sources (www.opendap.org). From my (so far limited) view of PTII  
and Kepler it seems that many of the OPeNDAP datasources include data  
sets whose structure is from new (to PTII and Kepler) scientific  
domains and in many cases includes 4D data. Global atmospheric models  
and satellite orbits are two examples of such data.


The OPeNDAP data model and the PTII data model have many  
similarities, but they diverge in that:


- The OPeNDAP data model is optimized for multidimensional arrays.
- The OPeNDAP data model supports a Grid data type that encapsulates  
map vector semantics for multidimensional gridded data.


Both of these data types represent high value content that the REAP  
project would like to make available in PTII/Kepler.


I hope a little background helps to further our discussion.


On Aug 6, 2007, at 5:39 AM, Edward A. Lee wrote:




Nathan,

Perhaps it would help to explain the reason for the current
design:

The existence is MatrixToken types has two motivations.
First, matrices have a natural set of operations that require
fairly sophisticated libraries to support (multiplication,
inverse, eigenvalue computation, etc.). As far as I known,
there are no such natural operations for higher dimensional
matrices.  Second, algorithms using matrices need to be
efficient. Data should be represented using native Java
data types, not wrapped in Tokens.




That kind of optimization is very useful, and is exactly what is done  
for all arrays in the reference implementations of the OPeNDAP data  
model.





In my experience, how to represent higher dimensional
data really depends on the application.  E.g., images
are 2-D, and can be represented in matrix types.
Video is 3-D, and is naturally represented as a sequence
of matrix tokens.




By mapping the OPeNDAP data model into PTII/Kepler we will be making  
available many multidimensional data sets, including 4D atmospheric  
models. Many of these data sets are quite large, so storage/ 
processing optimizations like the one used in the MatrixToken data  
type are generally favored.


Part of this process is to determine how to most effectively  
represent this information in the target(PTII/Kepler) data model.  
This should be driven in part by the tools available in the  
application for subseting and slicing the data.


At this point, based on your comments and those posted by C. Brooks,  
my instinct is to develop a prototype based using MatrixTokens for  
all 2D arrays and nested ArrayTokens elsewhere, as required. You make  
an excellent point about the optimization of using the native java  
types for arrays, and certainly promoting individual array values to  
ArrayToken objects will probably create serious memory usage and  
performance issues in the long run.


I can see a couple of alternate mechainsms for addressing this:

- Extend the PTII/Kepler data model with a more generalized array  
type that uses an efficient storage mechanism and that provides a  
reasonable interface for sub-setting/slicing/dicing the array. I am  
not suggesting a set linear algebra stype functions, just sub-setting  
methods. (I think one goal here would be that if a sub-setting  
activity produces a 2D array result then it should get mapped to a  
MatrixToken type.)


- OPeNDAP servers can perform server side sub-setting. It may be the  
most expedient thing would be to force the sub-setting to happen on  
the orgin server and only import 1D or 2D subsets into the ptolemy  
environment.







You have readily available the following mechanisms
for adding dimensions:
 - sequences (streams)
 - arrays (and arrays of arrays)
 - records
Which to choose will depend on the modeling problem, I think.

Note that a while ago, we did some major research into
representations of multidimensional data via generalized streams
(multidimensional streams).  See:

http://ptolemy.eecs.berkeley.edu/publications/papers/02/synchronous/



I followed this link to a page containing the abstract for the paper  
you mentioned. Unfortunately the link on that page to the full paper:


http://ptolemy.eecs.berkeley.edu/publications/papers/02/synchronous/ 
MurthyLee_MultimensionalSDF.pdf


Returns a 404 not found. Is there another location that you know of?  
I would interested in reading the document.



Thanks you all for your thoughtful responses,



Nathan







This mechanism was implemented in Ptolemy Classic, but never ported
to Ptolemy II.  Probably some good research to be done here still...

Edward


At 07:57 PM 8/3/2007, Nathan Potter wrote:



Greetings,

I am looking at how I might represent an 

ptII web site down?

2007-07-03 Thread Chad Berkley

Hey,

I just noticed that the ptolemy.eecs.berkeley.edu web site seems to be 
down.  Just thought I'd let someone know.


chad


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


Re: finding an effigy

2007-06-05 Thread Chad Berkley

Thanks, Edward!  That worked.

chad

Edward A. Lee wrote:

I think you probably need to create a DocEffigy and set it's
container to be the container of the effigy for the model.

Edward

At 01:52 PM 6/5/2007, Chad Berkley wrote:

Ok, I got a lot of wires redirected and finally got the PtolemyFrame to be 
referenced from the right click action handler.  Now I can call getModel() 
which works fine.  I can also call Configuration.findEffigy() which seems to 
work fine, except that it returns a PtolemyEffigy, not a DocEffigy which is 
what GetDocumentationAction wants.  It looks like PtolemyEffigy and DocEffigy 
are not related to each other in the hierarchy (they both extend Effigy).  I'm 
using the same calls that are used within GetDocumenationAction itself, but I 
get back a different type of Effigy.  Any ideas why and how I can get a 
DocEffigy?  Note that since there is nothing in the model at the time I call 
getModel() it returns a blank model, which seems like it should be fine.

thanks,
chad

Edward A. Lee wrote:

I'm sure it's possible, but I think it will a little indirect.
In particular, the right click will have an event that can tell
you what Frame delivered the event.  This will be instance of PtolemyFrame,
so you can cast it and call getModel().  Then call Configuration.findEffigy()
on that model...
Edward
At 02:08 PM 6/4/2007, you wrote:

Ok, that sounds good.  Is there an easy method for getting the effigy of that 
workflow?  When I do a Configuration.findEffigy(actor), it returns null.  I'm 
not sure how to get a pointer to that open workflow from a random place in the code.

thanks,
chad

Edward A. Lee wrote:

I would suggest using the effigy for the model being viewed next to the
library... The main purpose of this effigy is to give hierarchy to window
managements, so that (for example), if you close a window, then all windows
that are conceptually sub-windows close...
Edward

At 10:22 AM 6/4/2007, Chad Berkley wrote:

Hi,

I'm trying to make it possible to get the documentation for an actor from the 
actor library by right clicking on an actor.  In the GetDocumentationAction 
class, it asks the Configuration for an Effigy for the object you are trying to 
open the documentation for.  Since there is no effigy for an actor that is not 
yet part of a model, it fails.  Is there a way for me to add a ghost effigy 
into the configuration so that the documentation can be created?

thanks,
chad


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

 Edward A. Lee
Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal  

 Edward A. Lee
Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal  


 
Edward A. Lee

Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal  




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


finding an effigy

2007-06-04 Thread Chad Berkley

Hi,

I'm trying to make it possible to get the documentation for an actor 
from the actor library by right clicking on an actor.  In the 
GetDocumentationAction class, it asks the Configuration for an Effigy 
for the object you are trying to open the documentation for.  Since 
there is no effigy for an actor that is not yet part of a model, it 
fails.  Is there a way for me to add a ghost effigy into the 
configuration so that the documentation can be created?


thanks,
chad


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


Re: finding an effigy

2007-06-04 Thread Chad Berkley
Ok, that sounds good.  Is there an easy method for getting the effigy of 
that workflow?  When I do a Configuration.findEffigy(actor), it 
returns null.  I'm not sure how to get a pointer to that open workflow 
from a random place in the code.


thanks,
chad

Edward A. Lee wrote:


I would suggest using the effigy for the model being viewed next to the
library... The main purpose of this effigy is to give hierarchy to window
managements, so that (for example), if you close a window, then all windows
that are conceptually sub-windows close...

Edward


At 10:22 AM 6/4/2007, Chad Berkley wrote:

Hi,

I'm trying to make it possible to get the documentation for an actor from the 
actor library by right clicking on an actor.  In the GetDocumentationAction 
class, it asks the Configuration for an Effigy for the object you are trying to 
open the documentation for.  Since there is no effigy for an actor that is not 
yet part of a model, it fails.  Is there a way for me to add a ghost effigy 
into the configuration so that the documentation can be created?

thanks,
chad


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



 
Edward A. Lee

Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal  




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


possible bug in DocManager.java

2007-04-23 Thread Chad Berkley

Hi,

I've recently run across a ClassNotFoundException when trying to view 
the documentation for Sinewave in Kepler.  I've traced it to 
DocManager.java where, in the method docClassNameToURL, there is a call 
to Class.forName().  The problem is that Sinewave is a moml class, not a 
java class so this fails.  I'm not sure if the changes I put into the 
documentation system a few months ago might have caused this or if it is 
just a bug.  Has anyone else (specifically those running ptii without 
kepler) had this problem?


thanks,
chad


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


Re: possible bug in DocManager.java

2007-04-23 Thread Christopher Brooks
Hi Chad,

Getting the documentation for Sinewave works in the devel version of
Ptolemy II built from CVS today.

However, it was printing a stacktrace about Sinewave not being found,
it looks like the See also was failing:

java.lang.ClassNotFoundException: ptolemy.actor.lib.Sinewave
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at ptolemy.vergil.actor.DocManager.docClassNameToURL(DocManager.java:438
)
at ptolemy.vergil.actor.DocManager.getSeeAlso(DocManager.java:799)
at ptolemy.vergil.actor.DocViewer._init(DocViewer.java:960)
at ptolemy.vergil.actor.DocViewer.init(DocViewer.java:114)
at ptolemy.vergil.actor.DocTableau.init(DocTableau.java:90)
at ptolemy.vergil.basic.GetDocumentationAction.showDocAttributeTableau(G
etDocumentationAction.java:364)
at 
ptolemy.vergil.basic.GetDocumentationAction.actionPerformed(GetDocumentationAction.java:156)
at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at 
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at 
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at 
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5501)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at java.awt.Component.processEvent(Component.java:5266)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3968)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at 
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

I modified vergil/actor/DocManager.java so that we catch and ignore
the exception, which gets rid of the message. 

DocManager is set up to print any stacktraces and then return null.
Perhaps it should be modified so that it does not try to look up the
Java class on an Actor Oriented class such as Sinewave, but I think
ignoring the exception is right, because the portion of getSeeAlso()
that is calling docClassNameToURL() and triggering printing the
exception is:

URL toRead = docClassNameToURL(_configuration, className, true,
true, true, false);
if (toRead != null) {
result.append(lia href=\ + toRead.toExternalForm()
+ \);
if (toRead.toExternalForm().endsWith(.html)) {
result.append(Javadoc Documentation);
} else if (toRead.toExternalForm().endsWith(.java)) {
result.append(Java Source);
} else if (toRead.toExternalForm().endsWith(.xml)) {
result.append(Class Documentation);
}
result.append(/a/li);
}

The Sinewave Actor Oriented class does not have Javadoc or Java
source, and it looks like we already have the Class Documentation, so
I think we are set.

Edward?

_Christopher


Hi,

I've recently run across a ClassNotFoundException when trying to view 
the documentation for Sinewave in Kepler.  I've traced it to 
DocManager.java where, in the method 

ptolemy text attribute question

2005-08-22 Thread Chad Berkley

Hi,

I've been trying to figure out how to define an Attribute that allows 
the use of CDATA within the body of the property element.  For instance:


property name=documentation 
class=org.kepler.moml.DocumentationAttribute

  This is some docs...
/property

I don't see any current Attributes that will do this and upon looking at 
the MoMLParser code, it doesn't look like they can do this because the 
_handlePropertyElement() method is called before the charData() method 
gets called to handle the character data inside the element.  This seems 
to limit the xml author to only including text inside the value 
attribute of the element.  This would normally be fine, but I would like 
to include a lot of text.  Maybe hundreds of lines.  Putting the text 
into the value attribute doesn't lend itself to this very well.


So, my question is, am I missing something and if not, would anyone 
object to me modifying the MoMLParser to be able to accept CDATA in leiu 
of the value attribute in a property element?


thanks,
chad


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


Re: [kepler-dev] ptolemy text attribute question

2005-08-22 Thread Edward A. Lee


There is ConfigurableAttribute.
The plotter uses this for example to include foreign XML as
a parameter value for the actor.  To see it, put a SequentialPlotter
actor in a model, change its formatting (by clicking on the format
button in the plot), and look at the resulting XML.
The fact that the plotter's CDATA is XML is irrelevant...
It could be arbitrary text (almost).

Edward

At 01:18 PM 8/22/2005 -0700, Chad Berkley wrote:

Hi,

I've been trying to figure out how to define an Attribute that allows
the use of CDATA within the body of the property element.  For instance:

property name=documentation
class=org.kepler.moml.DocumentationAttribute
   This is some docs...
/property

I don't see any current Attributes that will do this and upon looking at
the MoMLParser code, it doesn't look like they can do this because the
_handlePropertyElement() method is called before the charData() method
gets called to handle the character data inside the element.  This seems
to limit the xml author to only including text inside the value
attribute of the element.  This would normally be fine, but I would like
to include a lot of text.  Maybe hundreds of lines.  Putting the text
into the value attribute doesn't lend itself to this very well.

So, my question is, am I missing something and if not, would anyone
object to me modifying the MoMLParser to be able to accept CDATA in leiu
of the value attribute in a property element?

thanks,
chad
___
Kepler-dev mailing list
[EMAIL PROTECTED]
http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev



Edward A. Lee
Professor, Chair of the EE Division, Associate Chair of EECS
231 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal  




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


Re: [Ptolemy] Re: Transparent CompositeActor firings?

2004-06-16 Thread Stephen Andrew Neuendorffer
At 02:25 PM 6/16/2004, Christopher Hylands Brooks wrote:
The following appeared in comp.soft-sys.ptolemy.
If you respond, please cc [EMAIL PROTECTED]
-Christopher
--- Forwarded Message
From: Mark Hodson [EMAIL PROTECTED]
Subject: Transparent CompositeActor firings?
Date: Tue, 15 Jun 2004 00:05:18 +0930
G'day Ptolemy seers,
Despite having read the Ptolemy documentation more than once, I am
having trouble coming to grips with one particular aspect of Ptolemy's
execution model (I am mostly interested in the DE domain);
I wish to hierarchically compose a system, lets say for simplicity
entirely in the DE domain.  I thus wish a DE director to exist at the
top level, and every other part of the hierarchy below this to be
transparent, thus allowing that one director to resolve a correct
ordering for each iteration of the world.  The benefit of transparency
here is of course that you get significant interleaving of firings of
the deepest (leaf) children as necessary.
eg. The world has two transponders, A and B.  Each transponder has an Rx
and a Tx.  The correct firing order is A.Tx with B.Tx before A.Rx and
B.Rx.  You needed A and B to be transparent to get this behaviour.
Given that in this scenario, A.Rx/A.Tx/B.Rx/B.Tx are the 4 AtomicActors,
and A and B are CompositeActors, my question is; do A and B get fired in
any way?  If not, why not, and if so, in accordance with what rules (wrt
the firing of their children, at least).
Only opaque actors are fired.  This includes all atomic actors and composite
actors with a director.  So, no, A and B will not get fired.

Of course if A and B have nothing to do, then there is no drama, but if
A and B carry some of the mathematics/behaviour of the model, then they
will require some sort of firing opportunity.
Then they should be opaque...  Note that in DE, a composite actor is perfectly
able to fire if only some of its inputs have events.  It will fire the 
correct contained
actors that receive those events and then return.


A case in point is the wiring of CompositeActor A's children, which
notionally I consider it responsible for.  There are many cases in
scientific computing when the first iteration of bringing the models up
to time zero has a different wiring to subsequent iterations.  I would
wish A to perform this rewiring duty at the conclusion of that first
iteration.  Other similar behaviours might include timed or triggered
introduction of additional children (perhaps A holds an input port that
is not connected to any child components, but rather is used as a
trigger to mutate the topology of A).
Can you give me some conceptual guidance on how you see this sort of
problem is best solved, in general terms and in the bounds of Ptolemy II?
Yes, these are certainly interesting questions...  We have recently begun
experimenting with some of these issues and some tentative first steps
are in the new 4.0 release.  We have variously been calling them lifecycle
actors or higher-order actors depending on the particular case.
Higher-order components tend to populate themselves during initialization, 
while
lifecycle actors tend to make more dynamic modifications during runtime.
I would take a look at these to see if you get some ideas...  Some of the key
difficulties are ensuring that the model is in a consistent state when 
making modifications
and ensuring that static analysis, which is sometimes necessary to ensure
semantics of a model, is performed again.

I would note that there is a distinct tradeoff between complex, unchanging
architectures and simpler, changing architectures...  It may be easier
to do a little bit more upfront work by explicilty representing the 
different control
flows in the model.

Steve

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


Re: introduction distributed ptolemy

2004-06-14 Thread Christopher Hylands Brooks
There was a mail configuration problem with the ptolemy-hackers
list, so I'm forwarding a couple of bounced messages. 

Rather than trying to merge them, I'm sending them in the order
they were originally sent.

-Christopher

 From: Ferdinando Villa [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: Bertram Ludaescher [EMAIL PROTECTED]
 Cc: Edward A Lee [EMAIL PROTECTED], Tobin Fricke [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED], yang [EMAIL PROTECTED],
 [EMAIL PROTECTED]
 In-Reply-To: [EMAIL PROTECTED]
 References: [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
 Content-Type: text/plain
 Organization: University of Vermont
 Message-Id: [EMAIL PROTECTED]
 Mime-Version: 1.0
 X-Mailer: Ximian Evolution 1.4.6 
 Date: Mon, 14 Jun 2004 11:25:19 -0400
 Content-Transfer-Encoding: 7bit
 
 On Mon, 2004-06-14 at 11:01, Bertram Ludaescher wrote:
   Ideally the ports of an actor should (or at least could)
  have multiple types:
  - the data type (including say XML Schema type),
  - the semantic type (e.g. a concept expression describing more formally
  what else might be known about the data flowing through the port)
  [[aside for Ferdinando: our reductionist/separatist approach does not 
  preclude forever an integrated modeling solution - it's just bottom up 
  to get sth useful soon/in finite time ;-]]
 
 Hi Bertram! one point - if you read reductionistic (which I probably
 wrote somewhere) as reductive you're misinterpreting me - we
 ecologists mostly see reduct. vs. holistic as complementary (with
 hierarchical thinking as a possible integrating framework) so when we
 say reductionistic, we mean exactly what you also mean... one GOOD way
 to look at the problem, usually the most practical, easier to study,
 while often the least conducive to synthetic understanding... but NOT
 separatist
 
 Philosophy aside, here's a more SEEK-specific provocation: don't you
 think that the conceptual/holistic/top-down approach is the one that
 needs the semantic types, while the workflow/reductionist/ptolemy
 approach would be just fine with just the storage/machine types of
 whatever virtual machine AMS will be? 
 
 Also: where do the transformations belong (scaling, units)? I'd argue
 they belong mechanically to the reductionistic side - just like all
 other actors, created to calculate a concept - and if the user don't
 need to see them, it's not because we hide them up in the conceptual
 description, but because they're actors in the workflow, and the
 conceptual description that users work with is not the workflow. 
 
 Maybe we're mixing the sides up somewhat, and if so, is this ok... or is
 it going to postpone the beautiful moment of clarity when we all
 realize that we've all been thinking the same thing all along?
 
 Cheers,
 ferdinand
 
 
  - the event consumption/production type (useful for scheduling a la
  SDF)
  - the communication type (through the Ptolemy/Kepler client, directly
  via say FTP or HTTP) etc
  
  At some levels of modeling ones does explicitely hide such detail from 
  the modeler/user but at other levels this might be a good way of
  overcoming some scalability issues (if you have terabyte data streams
  you want them to go directly where they need to)
  
  A related problem of web servies (as actors) is that they send results 
  back to the caller (Kepler) and don't forward them to the subsequent
  actor making large data transfers virtually  impossible..
  
  A simple extension to the web service model (anyone knows whether
  that's already done???) would allow for data to include *references*
  so that a process would be able return to Kepler just a reference to
  the result data and that reference would be passed on to the consuming 
  actor who then understands how to derefernce it. This simple
  extension seems to be an easy solution to what we called before the
  3rd party transfer problem:
  
  --[Actor A] --- [ Actor B] -- ...
  
  To stream large data set D from A to B w/o going through
  Ptolemy/Kepler one can simply send instead a handle D and then B,
  upon receiving D, understands and dereferenes it by calling the
  appropriate protocol (FTP/gridFTP, HTTP, SRB,...)
  
  Note that there are already explicit Kepler actors (SRBread/SRBwrite,
  gridFTP) for large data transfer. More elegant would it be to just
  send handles in the form, e.g., dereference(http://...ref-to-D..)
  Note that the special tag 'derefence' is needed since not every URL
  should be dereferenced (a URL can be perfectly valid data all by
  itself)
  
  It would be good if we could (a) define our extensions in line with
  web services extensions that deal with dereferencing message parts (if 
  such exists) and (b) can work on a joint
  Kepler/Ptolemy/Roadnet/SEEK/SDM etc approach (in fact, Kepler is such
  a joint forum for co-designing this together..)
  
  Bertram
  
  PS Tobin: I recently met Kent and heard good news about ORB access in
  Kepler 

Support for resource allocation in Ptolemy?

2004-06-08 Thread Steve Rowe




Hi, hackers.

We are using Ptolemy to do sytem-integration level simulation and testing
for "smart" vehicles. Our main areas of interest are monitoring bandwidth
of network connections and CPU utilization (although we are also modeling
a number of other things). 

Is there a built-in actor that checks for resource (over-) allocation? I
have thought about just using a summation of bandwidth, where the components
in the system output an amount of bandwidth required at a given time and
then a network simulation component sums these requirements and makes sure
that the sum doesn't exceed the available. Is there a better way?

Thanks for any advice you can give.

-Steve
-- 
 Steve Rowe
 Research Engineer
 Cybernet
 (734) 668-2567 x 132
  




Re: modal models

2004-06-07 Thread Edward A Lee
The refinement for states in a ModalModel is in the same XML
file as the ModalModel.  Currently, the only way to spread a model
across multiple XML files is using MoML class definitions or
the ModelReference actor.
Edward
At 04:46 PM 6/3/2004 -0500, Reilly, Timothy (MN17) wrote:
Dear Hackers,
I wanted to try a simple fsm model model.  After you put down your states
and you want to add a refinement where do you put the xml file for the
refinement so that it gets found ?  As an example in the example in quick
start fsm example there are two states clean and noisy that you can look
inside.  Were is noisy.xml ?  When I am trying to do my own state machine
where does the refinement graph go in terms of directory structure and
whatever else needs to be done so that I can look inside and run it.  I
tried putting it in the same directory where the modal file is written but
it does not get found.
Thanks,
Tim


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

Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Re: [Ptolemy] [Info] needed regarding execution under SDF model

2004-06-03 Thread Philippe.Dumont
 Stephen Andrew Neuendorffer wrote:
I'm a bit at a loss as to why it must execute N1 times?  In seems to me
like the N1 firings of HT1 and the N2 firings of HT2 could be hidden inside the
actor, but without more information about where the desired number of firings is coming
from, I couldn't hazard a guess as to the right way to represent it.
The N1 firings of HT1 and the N2 firings of HT2 could be hidden inside
I do agree with you, but I don't know how to proceed...
In fact in our model, there are two levels :
The first is the one I described in my last mail.
Each HT (Hierarchical Task), contains the second level :
When I take an input token, I cut it in N parts, I do a computation on
each part. At the end I take the N results of the computation
and I produce the result token.
So I use N firings to do the N computations. I don't have the choice
because I need to increment a counter in the  firing method of the director.
The director is an SDF director.
I try to use the iterate method but i don't know how to use it properly.
I can't use the  preinitialize or initialize method because all the 
methods preinitialize or initialize of all the HT must be executed 
before a fire.
I would like to call it between initialize and prefire. I think it's 
the best solution. But I do not know if it is possible ?

Philippe


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


Re: [Ptolemy] [Info] needed regarding execution under SDF model

2004-06-03 Thread Stephen Andrew Neuendorffer
At 05:53 AM 6/3/2004, Philippe.Dumont wrote:
 Stephen Andrew Neuendorffer wrote:
I'm a bit at a loss as to why it must execute N1 times?  In seems to me
like the N1 firings of HT1 and the N2 firings of HT2 could be hidden 
inside the
actor, but without more information about where the desired number of 
firings is coming
from, I couldn't hazard a guess as to the right way to represent it.
The N1 firings of HT1 and the N2 firings of HT2 could be hidden inside
I do agree with you, but I don't know how to proceed...
In fact in our model, there are two levels :
The first is the one I described in my last mail.
Each HT (Hierarchical Task), contains the second level :
When I take an input token, I cut it in N parts, I do a computation on
each part. At the end I take the N results of the computation
and I produce the result token. So I use N firings to do the N 
computations. I don't have the choice
because I need to increment a counter in the  firing method of the director.
OK, so I see two ways to approach this:
1) represent the extraction and composition of the N parts explicitly.
2) have it happen implicitly.
I'm not sure what you are interested in:
1) is pretty straightforward (use an ArrayToSequence to
extract the N tokens, send them through an actor, and then use a 
Downsampler to
discard all but the last output)

2) I could picture doing a couple of ways, depending on how you are 
representing the primitive operation
and what is important about it.  The Director.transferInputs and 
transferOutputs methods could be overridden
to do what you want to do.  The primary downside to this is that you end up 
with an extra layer of hieararchy.
The IterateOverArray actor (actor.lib.hoc) implements one way of hiding the 
extra hierarchy in the user interface.
It overrides the director to behave as a ArrayToSequence, followed by an 
actor, followed by SequenceToArray
It sounds like you want something similar, but with a DownSampler instead 
of a SequenceToArray.


The director is an SDF director.
I try to use the iterate method but i don't know how to use it properly.
I can't use the  preinitialize or initialize method because all the 
methods preinitialize or initialize of all the HT must be executed 
before a fire.
I would like to call it between initialize and prefire. I think it's 
the best solution. But I do not know if it is possible ?
I don't understand what you are trying to do here...
Steve


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


modal models

2004-06-03 Thread Reilly, Timothy (MN17)
Dear Hackers,

I wanted to try a simple fsm model model.  After you put down your states
and you want to add a refinement where do you put the xml file for the
refinement so that it gets found ?  As an example in the example in quick
start fsm example there are two states clean and noisy that you can look
inside.  Were is noisy.xml ?  When I am trying to do my own state machine
where does the refinement graph go in terms of directory structure and
whatever else needs to be done so that I can look inside and run it.  I
tried putting it in the same directory where the modal file is written but
it does not get found.

Thanks,

Tim




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


RE: [kepler-dev] question on typing processes and higher-order fu nctions a la map

2004-06-02 Thread Willink, Ed
Hi Edward

Edwasrd Willink wrote
Surely double -- double is just wrong. It uses the COSSAP
fudge to support Arrays in a non-Array tool via accidental sequences.
Any type system that requires exaplanatory text, (use N successive
samples) is not a type system.

Edward Lee wrote
 The only difference between:
 
 double -- double
 
 and
 
 A sequential array (distributed in time over sequential samples)
 with type T1[N] -- T2[N]
 
 is the N, which is what makes it a dependent type system...

I don't think we got to the bottom of this, getting side tracked into
axes of type lattices.

If double -- double is the signature of an FFT, what is the output?

Does the FFT fire after the first token to do an FFT1, then second to do
FFT2,
then 4 to do FFT4 etc, or after every 64 to do FFT64? Whichever; the output
can only really be a stream of double (complex surely) for FFT1.

I think there is a confusion between the computation firing signature

double[64] - double[64]

and the communication context which might indeed be

double -- double

The two are only compatible after a helpful type-inference system has
inserted the conversions

double -- double[64]
and
double[64] -- double

(The implementation option of address/space/time distribution of the
64 elements remains open.)

A helpful system may do this automatically, however a type-safe system
must require user intervention to avoid accidental and undiagnosed
interconnection of skewed frame boundaries. You agreed to my suggestion
a couple of yeasrs ago that the Prolemy type system should have
two modes: helpful/safe.

If Ptolemy is to approach a consistent specification of behaviour rather
than yet another set of intuitions, this conversion should not be automatic.

When seen as a conversion, it ceases to be part of the FFT, just another
part
of the type system.

It might even be that a smart code generator could exploit a stream
optimised FFT implementation to weave the conversions into the computation,
but that is a code generation/implementation issue that should only
appear on the mapping of a Ptolemy diagram to a target platform.

Regards

Ed Willink


E.D.Willink, Email: mailto:[EMAIL PROTECTED]
Thales Research and Technology (UK) Ltd, Tel:  +44 118 923 8278 (direct)
Worton Drive,or  +44 118 986 8601 (ext 8278)
Worton Grange Business Park, Fax:  +44 118 923 8399
Reading,   RG2 0SB
ENGLAND  http://www.computing.surrey.ac.uk/personal/pg/E.Willink



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


RE: [kepler-dev] question on typing processes and higher-order fu nctions a la map

2004-05-26 Thread Willink, Ed
Hi Edward, Bertram, Liying

 You have hit upon something that has bothered me for some time,
 and have expressed it better than I ever did...  There are several
 examples of this tension in the Ptolemy II library.  E.g., the
 FFT actor has type double -- double.  Why isn't it
 [double] -- [double]?  It could just as well be, and I don't
 know of any way to choose between these...

Surely double -- double is just wrong. It uses the COSSAP
fudge to support Arrays in a non-Array tool via accidental sequences.
Any type system that requires exaplanatory text, (use N successive
samples) is not a type system.

For the proposed WDL, Waveform Description Language,
(http://www.computing.surrey.ac.uk/personal/pg/E.Willink/wdl/wdl.html)
I identified three distinct forms of array.

A conventional array (distributed over adjacent memory addresses)
A spatial array (distributed in space over a multi-port/multiple ports)
A sequential array (distributed in time over sequential samples)

(There is no limitation to 1D, provided the rasterising policy is
well defined.)

An FFT specification therefore is always T1[N} -- T2[N].
Particular specialisations may choose different forms of array distribution.

Once these three forms are treated uniformly, it is also very easy
to do automated conversions between them. For instance in Caltrop,
each conversion would be just an 'assignment', with the distribution
being an externally inferable property. In Ptolemy the multi-axis
type lattice needed for fixed point must be extended with a further
axis for the array-form lattice.

Regards

Ed Willink


E.D.Willink, Email: mailto:[EMAIL PROTECTED]
Thales Research and Technology (UK) Ltd, Tel:  +44 118 923 8278 (direct)
Worton Drive,or  +44 118 986 8601 (ext 8278)
Worton Grange Business Park, Fax:  +44 118 923 8399
Reading,   RG2 0SB
ENGLAND  http://www.computing.surrey.ac.uk/personal/pg/E.Willink



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


RE: [kepler-dev] question on typing processes and higher-order fu nctions a la map

2004-05-26 Thread Willink, Ed
Hi Edward

Unfortunately, I'm not well-versed in 'dependent type system's
so I cannot comment on that.

I don't doubt that a set of contradictory type constriants can be
set up, but that's a detectable error, that can be made in a
simpler system too.

I see type inference as a multi-axis lattice problem, rather than
the single axis approach of Ptolemy. Typical axes are:

minimum value
maximum value
fixed-point epsilon
floating-point epsilon
overflow behaviour (a small enumeration)
rounding behaviour (a small enumeration)
overflow bit-truth (2-valued)
rounding bit-truth (2-valued)
is-complex
each array dimension
array form (a small enumeration)

Each axis is orthogonal and therefore amenable to independent lattice
or number line maximisation/minimisation as appropriate. Whereas in
a single axis system valid solutions satisfy e.g a GE operator
consistently, in a multi-axis system valid solutions must satisfy
a GE operator on all axes. Perhaps the GT case on one axis, LT on
another is what you mean by undecideable. With orthogonal axes
it's just insoluble.

I think that it may be the failure to move from single-axis in
Ptolemy that may be creating a variety of problems. It was certainly
the case that the Ptrolemy lattice had to double-up for Complex
variants of all scalar types.

My ptolemy.math.Quantization contribution makes some progress in this
direction and allowed for independent treatment of some of the above
axes. Ultimately the work stalled through lack of response to a number
of emails.

C++ (and I think Fortran) are examples of conventional
languages where array dimensions can participate in the type
checking. If this is not part of the type system then I'm
not sure what you mean.

Ultimately if 'dependent type system' does mean that
dimensioned arrays are difficult, it just means that
practical designs are difficult. We cannot run away
from it. FFT frame sizes must be type-checked.

Regards

Ed Willink

 This is a nice idea, but doesn't this give you a dependent
 type system?  This means type inference is undecidable in
 theory, and extremely complicated in practice...
 
 The only difference between:
 
 double -- double
 
 and
 
 A sequential array (distributed in time over sequential samples)
 with type T1[N] -- T2[N]
 
 is the N, which is what makes it a dependent type system...
 
 Lots of people have tried to put array sizes into type systems
 in conventional languages... It's no accident that none of them
 have it...
 
 Edward
 
 At 11:55 AM 5/26/2004 +0100, Willink, Ed wrote:
 Hi Edward, Bertram, Liying
 
   You have hit upon something that has bothered me for some time,
   and have expressed it better than I ever did...  There are several
   examples of this tension in the Ptolemy II library.  E.g., the
   FFT actor has type double -- double.  Why isn't it
   [double] -- [double]?  It could just as well be, and I don't
   know of any way to choose between these...
 
 Surely double -- double is just wrong. It uses the COSSAP
 fudge to support Arrays in a non-Array tool via accidental sequences.
 Any type system that requires exaplanatory text, (use N successive
 samples) is not a type system.
 
 For the proposed WDL, Waveform Description Language,
 (http://www.computing.surrey.ac.uk/personal/pg/E.Willink/wdl/
wdl.html)
I identified three distinct forms of array.

A conventional array (distributed over adjacent memory addresses)
A spatial array (distributed in space over a multi-port/multiple ports)
A sequential array (distributed in time over sequential samples)

(There is no limitation to 1D, provided the rasterising policy is
well defined.)

An FFT specification therefore is always T1[N} -- T2[N].
Particular specialisations may choose different forms of array
distribution.

Once these three forms are treated uniformly, it is also very easy
to do automated conversions between them. For instance in Caltrop,
each conversion would be just an 'assignment', with the distribution
being an externally inferable property. In Ptolemy the multi-axis
type lattice needed for fixed point must be extended with a further
axis for the array-form lattice.

 Regards

 Ed Willink


E.D.Willink, Email: mailto:[EMAIL PROTECTED]
Thales Research and Technology (UK) Ltd, Tel:  +44 118 923 8278 (direct)
Worton Drive,or  +44 118 986 8601 (ext 8278)
Worton Grange Business Park, Fax:  +44 118 923 8399
Reading,   RG2 0SB
ENGLAND  http://www.computing.surrey.ac.uk/personal/pg/E.Willink



Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], 

Constraints with assignment to parameters

2004-05-21 Thread Marija Surnaite
Hello,
we are three students from Aalborg University. We are using Ptolemy II 
for our study project. We encountered a few problems and would like to 
know if they are constraints of Ptolemy II or if we are just doing 
things in the wrong way.

1) In expression editor it is normal to assign a value to a variable. In 
 an Expression actor we tried to assign a value to a parameter and 
it throws a parsing error.
In FSM model, assigning to a parameter (set action) works correctly.

2) We decided to model a block of RAM as an array (FSM model). We put a 
parameter named RAM and assigned initial values as following:
([1:1:length]*0.0).toArray()
We encountered a problem while assigning a value to a element of this 
array (set action RAM[c]=value, where c is a parameter with integer 
value). The expression says that it requires INTEGER instead of c.

We would be really grateful if anyone could explain these problems
 Regards,
Marija

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


Re: Constraints with assignment to parameters

2004-05-21 Thread Edward A Lee
The expression language itself is not a programming language.
It does not have statements (sequencing of operations) nor
does not support assignments...  It supports just expressions.
The result of evaluating an expression is an immutable (unchangable)
token. If the result is an array, you cannot modify the elements
of the array.  You would have to create a new array.
FSM augments the expression language with assignments, but this
makes sense because FSM has sequencing in its semantics.
If what you really want is a scripting capability, I suggest
using the Python actor.  Then you have a full programming language
accessible rather than just an expression language.  You can
also use Matlab as a scripting language using the MatlabExpression
actor.
Edward
At 12:55 PM 5/21/2004 +0200, Marija Surnaite wrote:
Hello,
we are three students from Aalborg University. We are using Ptolemy II for 
our study project. We encountered a few problems and would like to know if 
they are constraints of Ptolemy II or if we are just doing things in the 
wrong way.

1) In expression editor it is normal to assign a value to a variable. 
In  an Expression actor we tried to assign a value to a parameter and 
it throws a parsing error.
In FSM model, assigning to a parameter (set action) works correctly.
2) We decided to model a block of RAM as an array (FSM model). We put a 
parameter named RAM and assigned initial values as following:
([1:1:length]*0.0).toArray()
We encountered a problem while assigning a value to a element of this 
array (set action RAM[c]=value, where c is a parameter with integer 
value). The expression says that it requires INTEGER instead of c.


Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Re: Ptolemy applets problems

2004-05-21 Thread Christopher Hylands Brooks
Efrat Jaeger [EMAIL PROTECTED] writes:
-
I created the following applet,
http://users.sdsc.edu/~efrat/workflows/queryPGAP.htm, very similar to
the demo applets. Apparently it loads on some computers but on others I
get a java.lang.NoClassDefFoundError: ptolemy/actor/gui/MoMLApplet
error. On the same computers the existing demo applets load perfectly. I
wasn't able to figure out what causes the exception. Does anyone have
any suggestions?
-

Applets are notoriously tricky to get right.
I looked over the source code and did not see anything obvious. 

There is some documentation at
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest/ptII/doc/coding/applets.htm

and there is a custom applet chapter in Volume 2 of the Ptolemy II
design doc:
http://ptolemy.eecs.berkeley.edu/papers/03/ptIIDesignSoftware

The applet code you are using is the complex applet code that
will work under Netscape 4.x.  If you do not require support
of Netscape 4.x, then you could use the much simpler 
applet
..
/applet
code.

In fact, for debugging, I would use the simple applet code so
that you are testing the same html code on the different platforms.

Another trick is to look at the website logs and see what files
are being downloaded.

With Java 1.4.2, I noticed that if a class was loaded from a jar
file, then it seemed like the applet class loader would not
find individual .class files on the file system.  The solution
was to make sure and have the archive= tag include jar
files that included all the .class files.  I'm not
sure about the details of this new behaviour, I poked
around on the Sun website but did not see anything.

When I tried to run your applet, I had to install Java 1.4.1_02,
the applet would not run with Java 1.5.0-beta under Mozilla.

Applets can have dynamic versioning or static versioning.

Dynamic versioning permits a JRE greater or equal to a a certain
version to be used.

Static versioning requires that a certain version of JRE 
be used.

The details are covered in:
  http://java.sun.com/products/plugin/versions.html

From the title tag, it looks like your applet is based on one of the
Ptolemy Eye applets.

It looks like your applet and the Ptolemy II 3.0 SDF Eye applet are
using dynamic versioning under IE, but static versioning under
Mozilla?  This would be a bug.

The IE section says:
   classid=clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
which
http://java.sun.com/products/plugin/versions.html
indicates is for dynamic versioning.

The Netscape section says:
   application/x-java-applet;jpi-version=1.4.1_02
http://java.sun.com/products/plugin/versions.html
indicates is for static versioning.

The applet code shipped in Ptolemy II 3.0 in theory uses static
version to restrict the version of the JVM can be used to 1.4.1_02.
This was done because of a bug in 1.4.1 and 1.4.1_01 that machines
that use a particular video chip set to hang.  Since Professor Lee and
I were affected by this bug, we restricted the JVM choice to 1.4.1_02.
I tried to make the applet use dynamic versioning for Netscape so
we would accept 1.4.1_02 or greater, but could not
get this to work, it appeared to be a problem with the patch level.

If possible, it is better to use dynamic versioning.
The Ptolemy II 4.0 applets use dynamic versioning correctly to
require Java 1.4.2 or later.  In principle, Java 1.5.0-beta
should work with these applets.

In general, applets have restrictions:

1) Don't use the readFile() expression function in a model that
is within an applet.  This is because of restrictions in the
applet class loader.

2) If possible, use the simple applet .../applet code
and avoid the really complex javascript code.  If you really
think you need to support Netscape 4.x, consider looking
at the web server logs for the number of Netscape 4.x users
and evaluate the cost of supporting applets for those
users.  Note that Ptolemy II 4.0 supports Netscape 4.x.
Perhaps the next release of Ptolemy II applets will not
support Netscape 4.x?

3) The MoMLViewerApplet class does not permit look inside.
It would be cool if we could use the Single Window interface created
by Thales within an applet.
To run the single window interface in Ptolemy II 4.0, do
   $PTII/bin/vergil -single
The idea would be to create an applet that would use this interface

4) The code generator will generate applets for a model. 
See $PTII/doc/codegen.htm for somewhat out of date documentation.
There will be a chapter in the design doc about how to use the
applet generator.

5) For vergil applets, it might be better to create Web Start
versions.  I noticed that the Java Event Listener Tutorial
is now using Web Start, see
http://java.sun.com/docs/books/tutorial/uiswing/events/example-1dot4/
I started hacking up the applet code generator to generate both
applets and Web Start configurations, but I never really finished
that work

BTW - If you use the controls parameter in your applet, then users
can run the applet.  
To do this, 

Ptolemy applets problems

2004-05-20 Thread Efrat Jaeger



Hi,

I created the following applet,  http://users.sdsc.edu/~efrat/workflows/queryPGAP.htm,verysimilar 
to the demo applets. Apparently it loads on some computers but on others I get a 
"java.lang.NoClassDefFoundError: ptolemy/actor/gui/MoMLApplet" error. On the 
same computers the existing demo applets load perfectly. I wasn't able to figure 
out what causes the exception. Does anyone have any suggestions?

Thanks,

Efrat


Ptolemy II 4.0-beta is available for download

2004-05-19 Thread Christopher Hylands Brooks
Ptolemy II 4.0-beta is available for download.

Changed between 4.0-alpha and 4.0-beta:

Feature enhancements

* IterateOverArray usability features: Look inside now skips a level
  to show the model that actually gets iterated rather than the
  intermediate level. Also, IterateComposite can be dropped on
  IterateOverArray, and changes to its ports either inside or outside
  will be reflected in the IterateOverArray actor.
* Gave a more reasonable title to window used to edit custom icons.

Bug Fixes

* Fixed bug that didn't allow changing the name of graphical
  attributes when there were subclasses.
* Fixed potential deadlock in simultaneous accesses to a
  CrossReferenceList.
* If change requests are queued in a top-level entity and then its
  container is set, the change requests were never executed. Now, they
  are transferred to the new container.
* If a change request is made during cloning of an object, then the
  change request was executed immediately even if
  deferChangeRequests(true) has been called on object being cloned. This
  is because during cloning, the cloned object has no container. Now,
  the clone() method of NamedObj ensures that every cloned object has
  deferChangeRequests(true) set before it starts to get populated with
  its contents. This means that callers to clone() need to set it back
  to false if this is what they want.
* Improved performance of models that animate execution by changing
  parameters of icons (removed spurious acquisition of write permission
  on the Workspace).
* StyleConfigurer was directly making kernel calls rather than issuing
  change requests to apply changes. This could result in exceptions if a
  style is changed while a model is running, and it also means that
  changes to a style are not propagated to subclasses and instances.
* Fixed bug where deleting class definitions and subclasses or
  instances would throw a spurious exception because it would try to
  delete the subclasses or instances twice.
* Fixed bug where editing the custom icon of a class definition did
  not propagate to instances and subclasses until the model was closed
  and reopened.
* Fixed bug where dropping an actor into a model, followed by undo
  left the icon in the model (but without any associated actor) until
  the model was closed and re-opened.
* Removed a leak in diva.graph.AbstractGraphController where figures
  that are no longer being used by the model were still stored in a
  private hash table.
* Fixed a bug with TerrainModel in the wireless domain where the
  geometry that was used for determining terrain obstacles didn't match
  the geometry displayed in the icon.
* StyleConfigurer was directly making kernel calls rather than issuing
  change requests to apply changes. This could result in exceptions if a
  style is changed while a model is running, and it also means that
  changes to a style are not propagated to subclasses and instances.
* Many uses of the _hideName attribute were Parameter or Attribute
  rather than SingletonAttribute. Changed to consistently be
  SingletonAttribute.
* Configure now handles causes where the Java Advanced Imaging (JAI)
  interface is in a location outside of the JRE
* Configure now sets up $PTII/.classpath properly for use by Eclipse
* Broken HTML links have been fixed. 




Below is an update of the announcement I sent out with Ptolemy II
4.0-alpha.

---start--
VisualSense-4.0-beta is also available as part of the download.

VisualSense is a visual editor and simulator for wireless sensor
network systems.

Modeling of wireless sensor networks requires sophisticated modeling
of communication channels, sensor channels, ad-hoc networking
protocols, localization strategies, media access control protocols,
energy consumption in sensor nodes, etc. VisualSense is designed to
support a component-based construction of such models. VisualSense is
intended to enable the research community to share models of disjoint
aspects of the sensor nets problem and to build models that include
sophisticated elements from several aspects.

The VisualSense documentation can be found at 
http://ptolemy.eecs.berkeley.edu/papers/04/VisualSenseERLMemo0408/VisualSenseERLMemo0408.pdf

Eventually, we will have a separate VisualSense only Windows
installer.

In this release, under Windows, to install VisualSense, install the
full version of Ptolemy II and select Vergil - VisualSense from the
Start menu.  

If you rebuild from source, then to start up VisualSense, run
   vergil -visualsense


New Features

  Major Features that are new in Ptolemy II 4.0

 * Modeling wireless sensor networks (VisualSense)
   The wireless domain extends the DE domain with wireless channel
   modeling and library of components and methodologies for modeling
   wireless systems. This domain is packaged in a Ptolemy II
   configuration called VisualSense, which includes an extensive
   suite of demos.
 * 

A customized ptolemy for bioinformatic

2004-05-13 Thread Franck Valentin
Hi all,


perhaps someone could give me some advice or remarks on the application
based on Ptolemy and Vergil I need to develop.

1 - This application will execute bioinformatics workflows designed from
a graphical interface (a customized vergil). For a main part the actors
are external applications a user can easily add to his workspace without
programming (I need to develop an actor which acts as a wrapper). 

2 - The workflow must be able to run these applications concurrently :
I think of using a customized PN director which executes the workflow
only one time.

3 - I need to be able to run several instances of one model. For example
after creating a model which analyze DNA sequences, I launch several
instances concurrently with different parameters and then compare the
results between the instances.

4 - As the external applications can be very long (several days), I
would like to be able to a design the workflow, launch ptolemy in
background (without graphical interface) and retrieve at any moment the
current state from a graphical interface used as a viewer.

I have already made a little prototype which launches external
applications and displays the state of each. I've tried with a PN
director to try the concurrent executions but it seems to do an infinite
loop (I'm currently reading the doc and I think my comprehension of
behaviours is not perfect yet !)
I think the point 4 is the most délicate but I'm rather confident as
ptolemy and vergil communicates using event messages. It seems I don't
need to break all the architecture !

Do you think my features are reasonable ? ;)
Sorry if some answers are in the doc, I'm currently reading it too !



Franck





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


NullPointerException in 4.0alpha initialize

2004-05-13 Thread Zimdars, Andrew
[I previously posted this to the newsgroup, but it didn't make it to the mailing list 
...]

I'm trying to initialize and run a Ptolemy model generated by XSLT
from an existing XML description of an experiment (not a MoML file). 
When I try to run the model, I get the error:

java.lang.NullPointerException
 at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:437)
 at ptolemy.domains.de.kernel.DEDirector.initialize(DEDirector.java:721)
 at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:464)
 at ptolemy.actor.Manager.initialize(Manager.java:420)
 at ptolemy.actor.Manager.execute(Manager.java:277)
 at ptolemy.actor.Manager.run(Manager.java:831)
 at ptolemy.actor.Manager$1.run(Manager.java:880)

I suspect the error lies in my generated XML code, and not in Ptolemy,
but I'm having trouble tracking it down.  (The generated code includes
several Ptolemy actors that execute okay outside of the model, so it's
most likely an integration bug.)  What sorts of errors in the MoML
file might cause this exception?

ALZ

-
Andrew Zimdars
Modeling, Simulation, and Information Sciences (Org. ABCS)
Advanced Technology Center, Lockheed Martin Space Systems Co.
Bldg. 153, Col. 2J4
 Lockheed Martin Way, Sunnyvale, CA  94089

w: 408.742.2111 m: 510.915.0662


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


Re: NullPointerException in 4.0alpha initialize

2004-05-13 Thread Stephen Andrew Neuendorffer
Looks like receivers are not getting created for one of the actors, which 
shouldn't happen.

It would be helpful to get the generated MoML file, along with any custom 
java actors you
are using...

Steve
At 11:23 AM 5/13/2004, Zimdars, Andrew wrote:
[I previously posted this to the newsgroup, but it didn't make it to the 
mailing list ...]

I'm trying to initialize and run a Ptolemy model generated by XSLT
from an existing XML description of an experiment (not a MoML file).
When I try to run the model, I get the error:
java.lang.NullPointerException
 at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:437)
 at ptolemy.domains.de.kernel.DEDirector.initialize(DEDirector.java:721)
 at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:464)
 at ptolemy.actor.Manager.initialize(Manager.java:420)
 at ptolemy.actor.Manager.execute(Manager.java:277)
 at ptolemy.actor.Manager.run(Manager.java:831)
 at ptolemy.actor.Manager$1.run(Manager.java:880)
I suspect the error lies in my generated XML code, and not in Ptolemy,
but I'm having trouble tracking it down.  (The generated code includes
several Ptolemy actors that execute okay outside of the model, so it's
most likely an integration bug.)  What sorts of errors in the MoML
file might cause this exception?
ALZ
-
Andrew Zimdars
Modeling, Simulation, and Information Sciences (Org. ABCS)
Advanced Technology Center, Lockheed Martin Space Systems Co.
Bldg. 153, Col. 2J4
 Lockheed Martin Way, Sunnyvale, CA  94089
w: 408.742.2111 m: 510.915.0662

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]


Re: I am using ptolemy II to develop an optical network simulator.

2004-05-12 Thread Christopher Hylands Brooks
In comp.soft-sys.ptolemy, [EMAIL PROTECTED] (Kaizen) writes:

 This is for an academic project so the complexity of the simulator
 will not reach that of something commercial like Optiwave or VPI.

VPI and Ptolemy Classic have a connection,
http://ptolemy.eecs.berkeley.edu/conferences/99/opticalsystems.pdf
Says
VPI products comprise:
 *Photonic Transmission Design Suite (PTDS) based on Ptolemy 0.7 . . . 

 The components that I am simulating include the transmitter, the fiber
 and the receiver.
 
 In the transmitter which I am working on now, there is a PRBS that
 goes thru a NRZ and that signal is modulated with that of a DFB laser.

I don't know much about optical systems, so the above are just
TLAs to me :-)

 What kind of domain should I be simulating this in,

Hard to say.  Usually network simulators use a timed domain, such as
DE.  However, it can be tricky to create large efficient DE models -
it is hard to get the level of abstraction right.

Someone else might have a suggestion

 I am currently
 doing it in SDF, but so far the entire simulation just slows down a
 lot when I leave it running for a while.

1. Make sure you are not using the Display actor, it eats up memory.
2. Try monitoring your memory usage.  Is the java process consuming
lots of memory?
3. There are some notes at $PTII/doc/coding/performance.htm, which
is at 
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII4.0/ptII4.0-beta/doc/coding/performance.htm
( I see that the file has a .html bug which I will fix shortly)
4. Using a commercial tool like JProbe can help.  They have a free trial.

-Christopher


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


possible application

2004-05-11 Thread Reilly, Timothy (MN17)
Dear Hackers,

I am new to Ptolemy.  I am intrigued by Ptolemy particularly because if is
freely available and I can use it both personally and at work.  I would like
to simulate a radar system with it.  I am having a little trouble deciding
which domain to use.   What I am would like to do is set up is some sort of
a system with a master clock that fires the transmitter, and delays to
simulate ground returns and system timings that will all be off of a master
clock.  There will be digital track loops who will all be synchronous with
this clock.  I there a good domain to accomplish this ?  I am having a
little trouble figuring out how to do to system timing.  I long for a way to
have stuff happen on clock edges as an event.

Also, I have access to matlab/simulink but I am a mathcad user, so I am kind
of the decision point as to what I should invest my time in learning.  I
also have access to vissim which came with my last Mathcad.   Will Ptolemy
be around for a while and be supported ?  Does it compare well with these
other tools ?  I know this is like asking a politician who I should vote for
but anyway...

Also I tried to get into the ftp site to look up the archives but didn't get
in.

I tried ftp://www.pub/ptolemy/mailing-lists/ptolemy-hackers.archive in my
browser but this didn't work.  Please forgive these questions, I know they
probably sound trivial to you all.

Regards,

Tim








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


Re: Compiling Ptolemy with Eclipse

2004-05-04 Thread Franck Valentin
Thanks for your help,  I also tried the method described but I can not
get the project compiled, here is what I tried :

tar xfz ptII3.0.2.src.tar.gz
mv ptII3.0.2 ptII

export PTII=/home/franck/bin/my_PTII/ptII
cd $PTII
./configure


cd ~/bin/my_PTII
eclipse

   File-New Project
   Project Name : ptII
   Directory: /home/franck/bin/my_PTII
   Finish

-- An error occured while creating the java project
 Reason  : invalid project description
 /home/franck/bin/my_PTII and /home/franck/bin/my_PTII/workspace overlap


If I change the directory with : /home/franck/bin/my_PTII/ptII

-- An error occurred while creating the java project
 See error log for more details.
 (java.lang.NullPointerException in the .log of Eclipse !)


I tried other thinks but I can only compile and run (make fast install)
without Eclipse !



Franck


On Mon, 2004-05-03 at 17:14, Christopher Hylands Brooks wrote:
 With Eclipse, usually it is necessary to run configure so that the
 .classpath file is properly set up.  An alternative is to set up the
 project class path by hand.  Locally, our Eclipse users run configure,
 so the by hand section of the doc could probably use some testing
 and updating.
 
 One issue is that Ptolemy II includes many packages that
 use other external packages that might not be present, so setting the
 classpath and excluding packages by hand can be time consuming.
 
 -Christopher
 
 
 
 
 
 Good morning,
 
 I'm a software designer in the Pasteur Institute (Paris) and I'm
 involved with a workflow definition and conception for sequence analysis
 (mainly). Ptolemy II seems to correspond to the core functionalities I
 need and seems to be easy to customize (thanks to have made docs and UML
 diagrams !)
 
 Unfortunatly I'm trying to make an eclipse project following the
 instructions described but without success.
 
 I'm now trying to install Ptolemy by hand following the chapter
 Setting up for Ptolemy II By Hand described in doc/coding/eclipse.htm
 and I have these errors :
 
 1 - The project was not built since its classpath is incomplete. Cannot
 find the class file for ptolemy.math.Complex. Fix the classpath then try
 rebuilding this project.
 
 2 - For the file /ptolemy/matlab/test/TestEngine.java : 
 This compilation unit indirectly references the missing type
 ptolemy.math.Complex (typically some required class file is referencing
 a type outside the classpath)
 
 (Weird because I can see ptolemy.math in Eclipse) 
 Can you say me if there is a mistake in the procedure described or I
 made something wrong.
 
 Thanks a lot !
 
 
 
 Regards
 
 Franck Valentin
 
 
 ---
-
 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]
 



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


Re: Compiling Ptolemy with Eclipse

2004-05-04 Thread Christopher Hylands Brooks
Hmm, this sounds like an Eclipse bug tickled by Ptolemy adjusting
setting up the ptII/.classpath file.

I've seen stack traces inside eclipse 2.1.2.  Rather than
reinstalling, what I usually what I ended up doing was removing my
eclipse/workspace directory and trying various things.

You could try removing ptII/.classpath and seeing if the setup
completes.  That worked for me.

I was able to build after hacking adding the following to .classpath.in:
   classpathentry excluding=cm/ kind=src path=ptolemy/copernicus/c/test/

and I had to add 
ptolemy/copernicus/c/test/cm/|
to the list of excluded files.

At one point, the Java build path window came up and I had
to remove jmf.jar and sound.jar

I later removed the jxta jar files because they had this
bogus ${PTII} inside of them.  I'll fix configure momentarily.
This bug occurred because our devel tree contains the jxta jar files,
but we don't ship these jar files.
To remove the jxta jar files, right click on the ptII project, select
Properties - Java Build Path - Libraries

You may later want to exclude ptolemy/moml/jxta from the build.

Below is a copy of the .classpath.in that worked for me: 
--start--
?xml version=1.0 encoding=UTF-8?
classpath
classpathentry excluding=cm/ kind=src path=ptolemy/copernicus/c/test/
classpathentry
 
excluding=**/CVS/|**/codeDoc/|config/|doc/coding/templates/|ptolemy/apps/agilent/|ptolemy/apps/anytimecontrol/|ptolemy/apps/charon/|ptolemy/apps/crazyboard/|ptolemy/apps/etherealSting/|ptolemy/apps/fullscreen/|ptolemy/apps/giotto/|ptolemy/apps/ia/|ptolemy/apps/kurt/|ptolemy/apps/jmf/|ptolemy/apps/kvm/|ptolemy/apps/lego/|ptolemy/apps/lejos/|ptolemy/apps/midp/|ptolemy/apps/mobileCoding/|ptolemy/apps/pendulum/|ptolemy/apps/rijndael/|ptolemy/apps/robot/|ptolemy/apps/security/|ptolemy/apps/sobel/|ptolemy/apps/softwalls/|ptolemy/apps/soot/|ptolemy/apps/throttle/|ptolemy/apps/tini/|ptolemy/apps/transmission/|ptolemy/apps/vergil/|ptolemy/apps/waba/|ptolemy/apps/webstart/|ptolemy/apps/xsl/|ptolemy/copernicus/c/test/|ptolemy/copernicus/c/test/cm/|ptolemy/domains/ct/demo/Saber/|ptolemy/domains/gr/lib/experimental/|ptolemy/domains/pdf/|ptolemy/plot/servlet/|vendors/@ECLIPSE_EXCLUDING_SRC@
 kind=src path=/
classpathentry kind=con path=org.eclipse.jdt.launching.JRE_CONTAINER/
@ECLIPSE_CLASSPATHENTRY_LIBS@
classpathentry kind=output path=/
/classpath
--end--

I'll add a note to the website about this

-Christopher 


Thanks for your help,  I also tried the method described but I can not
get the project compiled, here is what I tried :

tar xfz ptII3.0.2.src.tar.gz
mv ptII3.0.2 ptII

export PTII=/home/franck/bin/my_PTII/ptII
cd $PTII
./configure


cd ~/bin/my_PTII
eclipse

   File-New Project
   Project Name : ptII
   Directory: /home/franck/bin/my_PTII
   Finish

-- An error occured while creating the java project
 Reason  : invalid project description
 /home/franck/bin/my_PTII and /home/franck/bin/my_PTII/workspace overlap


If I change the directory with : /home/franck/bin/my_PTII/ptII

-- An error occurred while creating the java project
 See error log for more details.
 (java.lang.NullPointerException in the .log of Eclipse !)


I tried other thinks but I can only compile and run (make fast install)
without Eclipse !



Franck


On Mon, 2004-05-03 at 17:14, Christopher Hylands Brooks wrote:
 With Eclipse, usually it is necessary to run configure so that the
 .classpath file is properly set up.  An alternative is to set up the
 project class path by hand.  Locally, our Eclipse users run configure,
 so the by hand section of the doc could probably use some testing
 and updating.
 
 One issue is that Ptolemy II includes many packages that
 use other external packages that might not be present, so setting the
 classpath and excluding packages by hand can be time consuming.
 
 -Christopher
 
 
 
 
 
 Good morning,
 
 I'm a software designer in the Pasteur Institute (Paris) and I'm
 involved with a workflow definition and conception for sequence analy
   sis
 (mainly). Ptolemy II seems to correspond to the core functionalities 
   I
 need and seems to be easy to customize (thanks to have made docs and 
   UML
 diagrams !)
 
 Unfortunatly I'm trying to make an eclipse project following the
 instructions described but without success.
 
 I'm now trying to install Ptolemy by hand following the chapter
 Setting up for Ptolemy II By Hand described in doc/coding/eclipse.h
   tm
 and I have these errors :
 
 1 - The project was not built since its classpath is incomplete. Cann
   ot
 find the class file for ptolemy.math.Complex. 

Compiling Ptolemy with Eclipse

2004-05-03 Thread Franck Valentin
Good morning,

I'm a software designer in the Pasteur Institute (Paris) and I'm
involved with a workflow definition and conception for sequence analysis
(mainly). Ptolemy II seems to correspond to the core functionalities I
need and seems to be easy to customize (thanks to have made docs and UML
diagrams !)

Unfortunatly I'm trying to make an eclipse project following the
instructions described but without success.

I'm now trying to install Ptolemy by hand following the chapter
Setting up for Ptolemy II By Hand described in doc/coding/eclipse.htm
and I have these errors :

1 - The project was not built since its classpath is incomplete. Cannot
find the class file for ptolemy.math.Complex. Fix the classpath then try
rebuilding this project.

2 - For the file /ptolemy/matlab/test/TestEngine.java : 
This compilation unit indirectly references the missing type
ptolemy.math.Complex (typically some required class file is referencing
a type outside the classpath)

(Weird because I can see ptolemy.math in Eclipse) 
Can you say me if there is a mistake in the procedure described or I
made something wrong.

Thanks a lot !



Regards

Franck Valentin



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


Re: Compiling Ptolemy with Eclipse

2004-05-03 Thread Bertram Ludaescher

Hi Franck:

fyi: you may also be interested in the following Ptolemy II spin-off 
called Kepler that has been used for bioinformatics and other
scientific workflows: 
http://kepler.ecoinformatics.org

The first official Kepler release is planned for later this month, but
the code is available already (and earlier pre-releases).

There is also a page contributed by one of the Kepler folks to using
Eclipse:
http://kepler.ecoinformatics.org/eclipse.html

Bertram


 FV == Franck Valentin [EMAIL PROTECTED] writes:
FV 
FV Good morning,
FV I'm a software designer in the Pasteur Institute (Paris) and I'm
FV involved with a workflow definition and conception for sequence analysis
FV (mainly). Ptolemy II seems to correspond to the core functionalities I
FV need and seems to be easy to customize (thanks to have made docs and UML
FV diagrams !)
FV 
FV Unfortunatly I'm trying to make an eclipse project following the
FV instructions described but without success.
FV 
FV I'm now trying to install Ptolemy by hand following the chapter
FV Setting up for Ptolemy II By Hand described in doc/coding/eclipse.htm
FV and I have these errors :
FV 
FV 1 - The project was not built since its classpath is incomplete. Cannot
FV find the class file for ptolemy.math.Complex. Fix the classpath then try
FV rebuilding this project.
FV 
FV 2 - For the file /ptolemy/matlab/test/TestEngine.java : 
FV This compilation unit indirectly references the missing type
FV ptolemy.math.Complex (typically some required class file is referencing
FV a type outside the classpath)
FV 
FV (Weird because I can see ptolemy.math in Eclipse) 
FV Can you say me if there is a mistake in the procedure described or I
FV made something wrong.
FV 
FV Thanks a lot !
FV 
FV 
FV 
FV Regards
FV 
FV Franck Valentin
FV 
FV 
FV 
FV Posted to the ptolemy-hackers mailing list.  Please send administrative
FV mail for this list to: [EMAIL PROTECTED]


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


Re: Compiling Ptolemy with Eclipse

2004-05-03 Thread Christopher Hylands Brooks
With Eclipse, usually it is necessary to run configure so that the
.classpath file is properly set up.  An alternative is to set up the
project class path by hand.  Locally, our Eclipse users run configure,
so the by hand section of the doc could probably use some testing
and updating.

One issue is that Ptolemy II includes many packages that
use other external packages that might not be present, so setting the
classpath and excluding packages by hand can be time consuming.

-Christopher





Good morning,

I'm a software designer in the Pasteur Institute (Paris) and I'm
involved with a workflow definition and conception for sequence analysis
(mainly). Ptolemy II seems to correspond to the core functionalities I
need and seems to be easy to customize (thanks to have made docs and UML
diagrams !)

Unfortunatly I'm trying to make an eclipse project following the
instructions described but without success.

I'm now trying to install Ptolemy by hand following the chapter
Setting up for Ptolemy II By Hand described in doc/coding/eclipse.htm
and I have these errors :

1 - The project was not built since its classpath is incomplete. Cannot
find the class file for ptolemy.math.Complex. Fix the classpath then try
rebuilding this project.

2 - For the file /ptolemy/matlab/test/TestEngine.java : 
This compilation unit indirectly references the missing type
ptolemy.math.Complex (typically some required class file is referencing
a type outside the classpath)

(Weird because I can see ptolemy.math in Eclipse) 
Can you say me if there is a mistake in the procedure described or I
made something wrong.

Thanks a lot !



Regards

Franck Valentin


---
   -
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]


Re: ANNOUNCE: galsC 0.1.0 (alpha) release

2004-04-28 Thread Christopher Hylands Brooks
Elaine Cheong and Jie Liu announced availability of 
galsC 0.1.0 (alpha)

-Christopher


--- Forwarded Message
Subject: [Ptolemy] ANNOUNCE: galsC 0.1.0 (alpha) release
Date: Sun, 25 Apr 2004 16:18:30 -0700 (PDT)

We are announcing the alpha release of galsC, a language and compiler
for use with the TinyGALS programming model, which uses TinyOS as the
underlying component model.  galsC is compatible with TinyOS 1.x and
nesC 1.1.1.  You can use the galsC compiler to compile all your
existing TinyOS programs.

TinyGALS is a globally asynchronous, locally synchronous model for
programming event-driven embedded systems, especially sensor
networks.  At the local level, software components communicate with
each other synchronously via method calls.  Components are composed to
form actors.  At the global level, actors communicate with each other
asynchronously via message passing, which separates the flow of
control between actors.  A complementary model called TinyGUYS is a
guarded yet synchronous model designed to allow thread-safe sharing of
global state between actors without explicitly passing messages.  The
TinyGALS programming model is structured such that code for all
inter-actor communication, actor triggering mechanisms, and access to
guarded global variables can be automatically generated from a high
level specification.

By raising concurrency concerns above the level of TinyOS components,
the TinyGALS programming model allows programmers to focus on the main
tasks that the application must execute.  Programs developed using
this task-oriented model are thread safe and easy to debug.

For more information and download instructions, please see:
  http://galsc.sourceforge.net/

To receive future announcements about galsC, please sign up here:
  http://lists.sourceforge.net/lists/listinfo/galsc-announce

Please visit us at IPSN'04 (Berkeley, California, April 26-27, 2004):
  http://ipsn04.cs.uiuc.edu/
--- End of Forwarded Message



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


Re: Reading a file from Matlab

2004-04-27 Thread Christopher Hylands Brooks
In comp.soft-sys.ptolemy, [EMAIL PROTECTED] (Renooj Jacob) writes:

 I have a script file in matlab which solves a series of equations. I
 would like to access this matlab file from ptolemy and plot within
 ptolemy using the matlab expression. Is it possible? If not is there
 any other way.

I'm not sure what the format of the script file is.

You could read from the file using ExpressionReader, FileReader or
LineReader and then you could use the String actors to process the
data, though you might find it easier to create a custom actor to do
custom plotting.
You could then call the Matlab Expression actor to plot the data.


 Also i have a function file in matlab. i want to execute it from
 ptolemy. How to do that?

I don't know much about Matlab, but I did create a simple test 
that reads in a function from a .m file.

Is a function file a .m fle? 

Under Windows, running 
cd $PTII ptolemy/matlab/test
$PTII/bin/vergil mFileTest.xml
will bring up a model that reads mFileTest.m that defines a 
simple file.

The model annotation says:
  This test uses a function defined in
  an m-file called mFileTest.m.
  The packageDirectories parameter of the
  MatlabExpression actor is set to include
  $PTII/ptolemy/matlab/test in the directories
  that are searched by Matlab.
  The _debugging parameter is set to 2
  so that debugging output will appear
  on standard out.

I also created a simple wireless model that uses a .m file at
$PTII/ptolemy/domains/wireless/demo/MatlabWirelessSoundDetection/

Note that at this time you cannot use .m files with pure jar file
based installers like Web Start.  We could hack something up
that would get the .m file from a jar file and copy it to a directory
and add that directory to the packageDirectories parameter of the model.

Also, it appears that gcc-5.3 has problems running the Matlab
interface.  Use gcc-5.2 instead

 Regards
 Renooj

-Christopher


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


Re: FOR LOOP

2004-04-26 Thread Christopher Hylands Brooks
[EMAIL PROTECTED] (Renooj Jacob) writes:
 1) How does one implement FOR LOOP in Ptolemy.

There was a little bit of discussion about this in November.
Searching google with:
  switch group:comp.soft-sys.ptolemy

yields this post in comp.soft-sys.ptolemy

Professor Lee wrote:
 The Switch actor will do this in DE...
  
 It will also do this in PN, without a timing model...
 
 Edward
 
 At 12:44 PM 11/19/2003 -0800, Christopher Hylands Brooks wrote:
 In comp.soft-sys, [EMAIL PROTECTED] (Dave from Dublin)
 writes:
 
  I am quite new to Ptolemy and I am working a little in the DE domain.
  I cannot seem to find an actor that will perform the equivalent of an
  IF statement, i.e. an actor that reads from a single input channel and
  chooses which output port to write to, based on the value read (e.g.
  5 write to port1, else write to port2).  Is there an actor to do this
  or is there another way to implement this kind of functionality?
  Any help greatly appreciated,
 
 
 This sounds a bit like Dynamic Dataflow (DDF), which is not supported
 in Ptolemy II.  In SDF, having an actor that fires to a different port
 depending on its value makes it difficult to figure out the balance
 equations.
 
 You could try using a Comparator connected to a BooleanSelect or
 BooleanSwitch.  Comparator is found under actor library - logic
 BooleanSelect and  BooleanSwitch are found under actor library -
 boolean flow control - boolean flow control.
 
 Someone else might have a suggestion.
 
 -Christopher



[EMAIL PROTECTED] (Renooj Jacob) writes:
 2) I am trying to simulate Electromagnetic simulation using the Finite
 Difference time domain technique whose code is written in C language.
 I would like to do the same in Ptolemy. Is it possible? Which Director
 should i choose.

I'm not sure.
Take a look at th Continuous Time domain?

-Christopher


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


Speech processing

2004-04-14 Thread Do Trong Tu
Hello,

I am studying speech processing. 
How do I get all frames of a wave file, each frame is N=256 samples. (It 
is for short-time analysis)

Thank you for your help
 
Tu T. Do



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


XML fragments as StringTokens/XMLTokens

2004-04-14 Thread Zimdars, Andrew
I'm trying to construct a container that takes an XML fragment as a parameter value.  
I've tried two approaches to this, and both result in exceptions (possibly due to 
limitations in the Microstar XML parser, or laxity in my attempt to use XML).

If I use

public MyChannel extends WirelessChannel {

// ...
public Parameter pModifiers;
// ...

public MyContainer(CompositeEntity container, String name) 
throws IllegalActionException {
super(container, name);
// ...
pModifiers = new Parameter(this, modifiers);
pModifiers.setExpression(modifiers/);
pModifiers.setTypeEquals(BaseType.XMLTOKEN);
}

public void attributeChanged(Attribute attribute) 
throws IllegalActionException {
if (attribute == pModifiers);
Document doc;
try {
doc = ((XMLToken) pModifiers.getToken()).getDomTree();
}
catch (Exception e) {
// Results in exception here; 
// the parser gets confused when it hits the first 
}
}
} 

then an exception occurs while building the Vergil palette that contains my entity:  
the AElfred parser tries to interpret the value of the parameter with name modifiers 
and gets confused, because  isn't a valid token in an XML attribute.  (The same 
thing happens if I set the type of pModifiers to BaseType.STRING and attempt to parse 
it on my own.)  However, if I use

public MyChannel extends WirelessChannel {

// ...
public Parameter pModifiers;
// ...

public MyContainer(CompositeEntity container, String name) 
throws IllegalActionException {
super(container, name);
// ...
pModifiers = new Parameter(this, modifiers);
pModifiers.setToken(new XMLToken(modifiers/));
pModifiers.setTypeEquals(BaseType.XMLTOKEN);
}

public void attributeChanged(Attribute attribute) 
throws IllegalActionException {
if (attribute == pModifiers);
Document doc;
try {
doc = ((XMLToken) pModifiers.getToken()).getDomTree();
}
catch (Exception e) {
// Results in exception here; 
// the parser gets confused when it hits the first 
}
}
} 

then Vergil startup goes okay, but I get an XML parsing exception when I try to update 
the modifiers parameter (say, from modifiers/ to modifiers/modifiers, which 
should be semantically equivalent).

Is it possible to include an XML expression as a mutable part of an entity's 
configuration, just as string or record parameters are mutable?  (Keep in mind that 
the XML expression isn't MoML.)  I'd be happy to treat the expression as a plain 
string and do the parsing myself, but replacing all of the tag delimiters with escape 
sequences (e.g. lt; or gt;) would be inconvenient.  

Thanks,

Andy Z.

-
Andrew Zimdars
Modeling, Simulation, and Information Sciences (Org. ABCS)
Advanced Technology Center, Lockheed Martin Space Systems Co.
Bldg. 153, Col. 2J4
 Lockheed Martin Way, Sunnyvale, CA  94089

w: 408.742.2111 m: 510.915.0662


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


Re: XML fragments as StringTokens/XMLTokens

2004-04-14 Thread Stephen Andrew Neuendorffer
Andrew,

The expression language does not have any bindings for xml tokens, 
unfortunately  It probably should have at least a function that takes a 
StringToken and returns an XMLToken.

There are several possible immediate solutions:
1) In vergil, use the expression modifiers/ (with the double quotes) 
that will generate a StringToken.
In java code, this is equivalent to setExpression(\modifiers/\);

2) Change the Parameter to a StringParameter.  A String parameter has a 
different interpretation for expressions: from your point of view it makes 
the double quotes implicit.  A variable named v can be referred to as $v 
with explicit string concatenation.  In vergil, you would then use the 
expression modifier/ (with no double quotes) and in java code, you would 
say setExpression(modifier/);  The down side of this is if you have a 
string that contains a dollar sign, you have to escape the dollar sign.

3) Change the Parameter to a StringAttribute, which is an uninterpreted 
string...  This avoids the nastiness of explicit quotes and escaping dollar 
signs, but makes it impossible to refer to the value of other parameters 
symbolically.

Note that in each of these cases, when the expression is saved to XML, it 
must be be appropriately escaped (as you seem to be aware) using lt;... 
This is done automatically by the routines that save your model as an XML 
file and is transparent from the point of view of Java or the user interface.

Steve

At 01:40 PM 4/14/2004 -0700, Zimdars, Andrew wrote:
I'm trying to construct a container that takes an XML fragment as a 
parameter value.  I've tried two approaches to this, and both result in 
exceptions (possibly due to limitations in the Microstar XML parser, or 
laxity in my attempt to use XML).

If I use

public MyChannel extends WirelessChannel {

// ...
public Parameter pModifiers;
// ...
public MyContainer(CompositeEntity container, String name)
throws IllegalActionException {
super(container, name);
// ...
pModifiers = new Parameter(this, modifiers);
pModifiers.setExpression(modifiers/);
pModifiers.setTypeEquals(BaseType.XMLTOKEN);
}
public void attributeChanged(Attribute attribute)
throws IllegalActionException {
if (attribute == pModifiers);
Document doc;
try {
doc = ((XMLToken) 
pModifiers.getToken()).getDomTree();
}
catch (Exception e) {
// Results in exception here;
// the parser gets confused when it hits the 
first 
}
}
}

then an exception occurs while building the Vergil palette that contains 
my entity:  the AElfred parser tries to interpret the value of the 
parameter with name modifiers and gets confused, because  isn't a 
valid token in an XML attribute.  (The same thing happens if I set the 
type of pModifiers to BaseType.STRING and attempt to parse it on my 
own.)  However, if I use

public MyChannel extends WirelessChannel {

// ...
public Parameter pModifiers;
// ...
public MyContainer(CompositeEntity container, String name)
throws IllegalActionException {
super(container, name);
// ...
pModifiers = new Parameter(this, modifiers);
pModifiers.setToken(new XMLToken(modifiers/));
pModifiers.setTypeEquals(BaseType.XMLTOKEN);
}
public void attributeChanged(Attribute attribute)
throws IllegalActionException {
if (attribute == pModifiers);
Document doc;
try {
doc = ((XMLToken) 
pModifiers.getToken()).getDomTree();
}
catch (Exception e) {
// Results in exception here;
// the parser gets confused when it hits the 
first 
}
}
}

then Vergil startup goes okay, but I get an XML parsing exception when I 
try to update the modifiers parameter (say, from modifiers/ to 
modifiers/modifiers, which should be semantically equivalent).

Is it possible to include an XML expression as a mutable part of an 
entity's configuration, just as string or record parameters are 
mutable?  (Keep in mind that the XML expression isn't MoML.)  I'd be happy 
to treat the expression as a plain string and do the parsing myself, but 
replacing all of the tag delimiters with escape sequences (e.g. lt; or 
gt;) would be inconvenient.

Thanks,

Andy Z.

-
Andrew Zimdars
Modeling, Simulation, and Information Sciences (Org. ABCS)
Advanced Technology Center, Lockheed Martin Space Systems Co.
Bldg. 153, Col. 2J4
 Lockheed Martin Way, Sunnyvale, CA  94089
w: 408.742.2111 m: 510.915.0662


RE: Using Ptolemy II embedded in my product

2004-04-01 Thread Michael Doorley
Hi Christopher

How do I run the shallow code generator from the command line?

Michael

 
 
 The shallow code generator will read in certain models and generate
 java files.
 (See
 http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest/ptII/doc/codegen.htm
 )
 
 Below I ran the shallow code generator on
 ptII/ptolemy/domains/de/lib/test/auto/Queue.xml
 and added throws lines so that it would compile
 
 The file is in the ptolemy/copernicus/shallow/cg/Queue
 directory, so it is in the ptolemy.copernicus.shallow.cg.Queue package.
 
 [EMAIL PROTECTED] 66% pwd
 /vol/maury/maury2/cxh/ptII/ptolemy/copernicus/shallow/cg/Queue
 [EMAIL PROTECTED] 67% cat CGQueue.java
 /* CGQueue - Decompiled by JODE
  * Visit http://jode.sourceforge.net/
  */
 package ptolemy.copernicus.shallow.cg.Queue;





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


Re: memory problem

2004-03-31 Thread Christopher Hylands Brooks
This bounced because of configuration problem on the mail server,
so I'm resending it.

-Christopher
--- Forwarded Message


From: Stephen Andrew Neuendorffer [EMAIL PROTECTED]
To: Nilgun Fescioglu Unver [EMAIL PROTECTED],
[EMAIL PROTECTED],
[EMAIL PROTECTED]
Subject: [Ptolemy] Re: memory problem
Date: Wed, 31 Mar 2004 08:55:16 -0800


The culprit is apparently the Display actor, which internally uses
a JTextArea, which is a known memory hog:

A quick google search turns up:

 I can't believe this exists in Swing, but I've found
 that when I loaded a 2MB file into JTextArea it
 creates literally 394,000+ java.lang.ref.Finalizer
 objects that hang around event after the JTextArea is
 released. What's worse is my memory usage spikes to
 65MB! That's 30 times the size of the text string! I
 don't know what java.lang.ref.Finalizer object is, or
 why it gets created.

After 6000 iterations, that's roughly 1.3 MB of text

At 01:26 PM 3/30/2004 -0800, Nilgun Fescioglu Unver wrote:
Hi,

Sorry if you received this message for the second
time..

I have a java.lang.OutOfMemory error problem with my
model developed in Ptolemy II version 3.0.2.

I am working on a model which uses an ArrayToken (of
180 tokens) and my actors change the value of the
tokens in each iteration. As tokens are immutable I am
creating new tokens in each iteration. During the run
time after several iterations the system stops with an
error java.lang.OutOfMemory. I thought some problem
with garbage collection is creating the problem so I
tried calling System.gc at the end of fire() function
in my actors but there was no change in the number of
iterations before getting the error.

I tried to generate the same problem with the actors
of Ptolemy and created a simple model using the
ArrayExtract actor (the xml file is attached) and ran
into the same problem after several iterations (6143
iterations on a computer with 512MB Ram, Windows XP
operating system, java version 1.4.2 ).

Could you help me to find out the reason of this
problem? And how can I continue the simulation without
running out of memory?

Thanks,
Nilgun Fescioglu Unver

Attachment deleted


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


memory problem

2004-03-30 Thread Nilgun Fescioglu Unver
Hi,

Sorry if you received this message for the second
time..

I have a java.lang.OutOfMemory error problem with my
model developed in Ptolemy II version 3.0.2.

I am working on a model which uses an ArrayToken (of
180 tokens) and my actors change the value of the
tokens in each iteration. As tokens are immutable I am
creating new tokens in each iteration. During the run
time after several iterations the system stops with an
error java.lang.OutOfMemory. I thought some problem
with garbage collection is creating the problem so I
tried calling System.gc at the end of fire() function
in my actors but there was no change in the number of
iterations before getting the error.

I tried to generate the same problem with the actors
of Ptolemy and created a simple model using the
ArrayExtract actor (the xml file is attached) and ran
into the same problem after several iterations (6143
iterations on a computer with 512MB Ram, Windows XP
operating system, java version 1.4.2 ). 

Could you help me to find out the reason of this
problem? And how can I continue the simulation without
running out of memory?

Thanks,
Nilgun Fescioglu Unver



__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html?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=memoryTest2 class=ptolemy.actor.TypedCompositeActor
property name=_createdBy class=ptolemy.kernel.attributes.VersionAttribute value=3.0.2
/property
property name=DE Director class=ptolemy.domains.de.kernel.DEDirector
property name=startTime class=ptolemy.data.expr.Parameter value=0.0
/property
property name=stopTime class=ptolemy.data.expr.Parameter value=1.7976931348623E308
/property
property name=stopWhenQueueIsEmpty class=ptolemy.data.expr.Parameter value=true
/property
property name=synchronizeToRealTime class=ptolemy.data.expr.Parameter value=false
/property
property name=isCQAdaptive class=ptolemy.data.expr.Parameter value=true
/property
property name=minBinCount class=ptolemy.data.expr.Parameter value=2
/property
property name=binCountFactor class=ptolemy.data.expr.Parameter value=2
/property
property name=_location class=ptolemy.kernel.util.Location value=95.0, 35.0
/property
/property
property name=_windowProperties class=ptolemy.actor.gui.WindowPropertiesAttribute value={bounds={104, 174, 815, 518}}
/property
property name=_vergilSize class=ptolemy.actor.gui.SizeAttribute value=[600, 400]
/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
configuresvgtext x=20 y=20 style=font-size:14; font-family:SansSerif; fill:blueafter 6143 iterations java lang.OutOfMemory error

/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=70.0, 235.0
/property
/property
entity name=SingleEvent class=ptolemy.domains.de.lib.SingleEvent
property name=time class=ptolemy.data.expr.Parameter value=0.0
/property
property name=value class=ptolemy.data.expr.Parameter value={0.0944506216287, 0.0975191625284, 0.0944506216287, 0.0857999241191, 0.0730679504667, 0.0582762735578, 0.0434458637753, 0.0301629913445, 0.0193529221347, 0.0112813340563, 0.0084582314143, 0.0049053935788, 0.0027967090808, 0.0016312805584, 0.0010305804697, 7.414891291827E-4, 6.1146737601312E-4, 5.5677601186248E-4, 5.3524811455656E-4, 5.2731439069799E-4, 5.2457583224341E-4, 5.2369013529995E-4, 5.2342166719598E-4, 5.2334537982137E-4, 5.2332505352927E-4, 5.2331997439197E-4, 5.2331878392172E-4, 5.2331852216018E-4, 5.2331846815861E-4, 5.2331845770494E-4, 5.233184558059E-4, 5.2331845548212E-4, 5.2331845543031E-4, 5.2331845542253E-4, 5.2331845542143E-4, 5.2331845542128E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5!
 .2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 5.2331845542126E-4, 

Add an extra button to Ptolemy/Vergil

2004-03-29 Thread Martijn Bodewes


Hi,

The short question is: How do I add a button to the toolbar in Ptolemy.

I'm working on a add-on for ptolemy to do some specific actions. The goal  
is for users to click the to-be made button and then let the 
magic happen: validation of some values against a database. The huge 
amount of code dazzled me :) Where do I start with extending 
vergil/ptolemy to fit my needs?

Martijn Bodewes

-- 



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


Re: Add an extra button to Ptolemy/Vergil

2004-03-29 Thread Edward A Lee
At 10:48 AM 3/29/2004 +0200, Martijn Bodewes wrote:


Hi,

The short question is: How do I add a button to the toolbar in Ptolemy.

I'm working on a add-on for ptolemy to do some specific actions. The goal
is for users to click the to-be made button and then let the
magic happen: validation of some values against a database. The huge
amount of code dazzled me :) Where do I start with extending
vergil/ptolemy to fit my needs?
The simplest way to do this is to define an attribute that you
drop into your model where double clicking on your attribute invokes
your magic.  Below is an example of such an attribute that in this
case opens its own, custom UI for a verification tool called Chic.
You can also add buttons to the toolbar, but doing so is more involved.
You need to subclass the ActorGraphFrame to add to the toolbar,
and ActorGraphTableau, which creates the ActorGraphFrame
(both in $PTII/ptolemy/vergil/actor).  Then you need to create
a Configuration (like those in $PTII/ptolemy/configs) to create
this tableau rather than the default one.
This latter mechanism is intended for much more drastic changes
to the UI than just adding a button to the toolbar (you can create
a completely custom UI for a model this way).
Hope this helps...
Edward


---  the attribute that you drop in your model:

public class ChicInvoker extends Attribute {

/** Construct an attribute with the specified container and name.
 *  @param container The container.
 *  @param name The name of the attribute.
 *  @exception IllegalActionException If the factory is not of an
 *   acceptable attribute for the container.
 *  @exception NameDuplicationException If the name coincides with
 *   an attribute already in the container.
 */
public ChicInvoker(NamedObj container, String name)
throws IllegalActionException, NameDuplicationException {
super(container, name);
// Create a custom icon.
_attachText(_iconDescription, svg\n +
rect x=\-50\ y=\-25\ 
+ width=\100\ height=\50\ 
+ style=\fill:white\/\n
+ image x=\-50\ y=\-25\ width=\100\ height=\50\ 
+ xlink:href=\ptolemy/chic/chic.gif\/\n
+ /svg\n);
// Do not show the actor name.
new SingletonAttribute(this, _hideName);
// Create the attribute that overrides what you do when you
// double click.
new ChicControllerFactory(this, _controllerFactory);
 ...
}
-- The controller attribute:

/* An attribute that produces a custom node controller for ChicInvoker.

 Copyright (c) 1998-2003 The Regents of the University of California.
 All rights reserved.
 Permission is hereby granted, without written agreement and without
 license or royalty fees, to use, copy, modify, and distribute this
 software and its documentation for any purpose, provided that the above
 copyright notice and the following two paragraphs appear in all copies
 of this software.
 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
 PROVIDED HEREUNDER IS ON AN AS IS BASIS, AND THE UNIVERSITY OF
 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
 ENHANCEMENTS, OR MODIFICATIONS.
PT_COPYRIGHT_VERSION_2
COPYRIGHTENDKEY
@ProposedRating
@AcceptedRating
*/
package ptolemy.chic;

// Diva imports
import diva.graph.GraphController;
// Ptolemy imports
import ptolemy.kernel.util.*;
import ptolemy.vergil.basic.NamedObjController;
import ptolemy.vergil.basic.NodeControllerFactory;
// Java imports

//
 ChicControllerFactory
/**
This is an attribute that produces a custom node controller for
Chic visible attributes.  This class creates an instance of
ChicController, for controlling Chic visible attributes in a ptolemy
model.
@author Eleftherios Matsikoudis
@version $Id: ChicControllerFactory.java,v 1.2 2003/07/28 01:26:53 cxh Exp $
@since Ptolemy II 3.0
*/
public class ChicControllerFactory extends NodeControllerFactory {
/** Construct a new attribute with the given container and name.
 *  @param container The container.
 *  @param name The name.
 *  @exception IllegalActionException If the attribute cannot be contained
 *   by the proposed container.
 *  @exception NameDuplicationException If the container already has an
 *   attribute with this name.
 */
public 

Updating Actor in User Library

2004-03-25 Thread Keith Jacobs
I've saved a composite actor in my User Library and now I want to update it
with some changes. When I try saving over the existing actor using Graph,
Save in Library, I get the error message:

Save in Library failed: An object already exists in the user library with
name ...

Also, I've tried to find where the user library is stored on my computer and
delete the old version of the actor directly, but have not been able to
locate the directory
the User Library is stored in.

What's procedure to update actors in the User Library?

Thanks for your help!

- Keith Jacobs








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


Re: Random numbers

2004-03-19 Thread Christopher Hylands Brooks
Kostas Oikonomou [EMAIL PROTECTED] writes:

 I'm trying to see if I can use the DE domain of Ptolemy II to
 simulate a simple semi- Markov process.  The main obstacle I've run
 into is that I can't see any way of generating random numbers from
 distributions other than the exponential and normal.
 Is there some relatively easy way of doing this? (i.e. no Java code,
 because I don't know enough Java).  I remember from a while ago that
 Ptolemy Classic had such facilities.

I'm not sure.  I don't know that much about random numbers.

In Ptolemy II 3.0, there are the following actors that generate
random numbers under actor library-random 

Bernoulli - An actor that outputs a random sequence of booleans.
DiscreteRandomSource - An actor that produces tokens with a given
   probability mass function.
Gaussian - An actor that outputs a random sequence with a Gaussian
   distribution.
Rician - An actor that outputs a random sequence with a Rician distribution.
Uniform - An actor that outputs a random sequence with a uniform distribution.


Under actor library - sources - timed sources, there is
PoissonClock - A Poisson process clock source.

The expression language has random() and gaussian() functions:


 The functions random() and gaussian() shown in Table 5 on page
 96 return one or more random numbers. With the minimum number of
 arguments (zero or two, respectively), they return a single
 number. With one additional argument, they return an array of the
 specified length. With a second additional argument, they return a
 matrix with the specified number of rows and columns.

 There is a key subtlety when using these functions in Ptolemy II. In
 particular, they are evaluated only when the expression within which
 they appear is evaluated. The result of the expression may be used
 repeatedly without re-evaluating the expression. Thus, for example, if
 the ivalue/i parameter of the iConst/i actor is set to
 random()/font, then its output will be a random constant, i.e., it
 will not change on each firing. The output will change, however, on
 successive runs of the model. In contrast, if this is used in an
 Expression actor, then each firing triggers an evaluation of the
 expression, and consequently will result in a new random number.

random() and gaussian() are declared in
ptolemy/data/expr/UtilityFunctions.java.
You could add other functions to that file.

You could also use the interface to Matlab, see
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/ptII3.0.2/ptolemy/matlab/matlab.htm

Someone else on the list might have other suggestions.

-Christopher


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


Port Width for LinearStateSpace Input

2004-03-09 Thread Keith Jacobs
Title: Port Width for LinearStateSpace Input






I am building a simulation using a LinearStateSpace actor. I have configured this actor and used a Continuous Sinewave as a test input. When I run the simulation, I get the following Exception message:

The number of columns of the B matrix (1) should be equal to the width of the input port (0)

How do I set the input port width to the correct width?

Thanks!

Keith Jacobs







Re: Using Ptolemy II embedded in my product

2004-03-04 Thread Christopher Hylands Brooks
Michael Doorley writes:

 Hi Christopher
 
 Thanks for adding me to the list.
 
   1. Can I use Ptolemy II by calling methods in the API that would
   create a model, populate it, run a simulation and extract the results?
   As a bonus for the advanced user I would like to save the model as an
   XML file that could be opened in Ptolemy II GUI tools (e.g. Vergil),
   but that is not a priority.
  
  Yes.  See ptolemy/actor/gui/MoMLSimpleApplication.java and
  ptolemy/actor/gui/PtExecuteApplication.java, which both instantiate and
  run
  a model.
  
 
 I have looked at MoMLSimpleApplication.java and my problem with it is that
 it seems to require a file as input.  I am looking for a solution where I
 can create and populate model in memory directly from my program.  The
 closest thing I have found is the Dining Philosophers demo of the CSP
 domain, which does not seem to have a file dependency, unless I am missing
 it.
 
 I am currently trying build an equivalent of that program for DE.  Do you
 know if any similar sample already exists?
 
 Thanks for your help,
 Michael

Sorry, I thought you wanted to _read_ a MoML file.

You could do something similar to how the  
ptII/ptolemy/domains/ct/demo/Helicopter/Helicopter.java
works.

You could create a similar model with domain polymorphic or DE
actors and using the DE Director


Note that if you call
System.out.println(exportMoML());
from within a TypedCompositeActor, then you will get the MoML output.

See also:
ct/demo/Lorenz/Lorenz.java
ct/demo/SigmaDelta/SigmaDelta.java
ct/demo/SquareWave/SquareWave.java
ct/demo/StickyMasses/StickyMasses.java
ct/demo/Thermostat/Thermostat.java
sdf/demo/Butterfly/Butterfly.java

For example, to run the last demo, you would do 
java -classpath ptolemy.actor.gui.CompositeActorApplication -class 
ptolemy.domains.sdf.demo.Butterfly.Butterfly


The shallow code generator will read in certain models and generate 
java files.  
(See
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest/ptII/doc/codegen.htm)

Below I ran the shallow code generator on 
ptII/ptolemy/domains/de/lib/test/auto/Queue.xml
and added throws lines so that it would compile

The file is in the ptolemy/copernicus/shallow/cg/Queue
directory, so it is in the ptolemy.copernicus.shallow.cg.Queue package.

[EMAIL PROTECTED] 66% pwd
/vol/maury/maury2/cxh/ptII/ptolemy/copernicus/shallow/cg/Queue
[EMAIL PROTECTED] 67% cat CGQueue.java
/* CGQueue - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
package ptolemy.copernicus.shallow.cg.Queue;
import ptolemy.actor.IOPort;
import ptolemy.actor.TypedCompositeActor;
import ptolemy.actor.TypedIOPort;
import ptolemy.actor.TypedIORelation;
import ptolemy.actor.gui.LocationAttribute;
import ptolemy.actor.gui.SizeAttribute;
import ptolemy.actor.lib.Clock;
import ptolemy.actor.lib.Test;
import ptolemy.data.expr.Parameter;
import ptolemy.domains.de.kernel.DEDirector;
import ptolemy.domains.de.kernel.DEIOPort;
import ptolemy.domains.de.lib.Queue;
import ptolemy.kernel.ComponentPort;
import ptolemy.kernel.CompositeEntity;
import ptolemy.kernel.attributes.VersionAttribute;
import ptolemy.kernel.util.Settable;
import ptolemy.kernel.util.Workspace;
import ptolemy.kernel.util.IllegalActionException;
import ptolemy.kernel.util.NameDuplicationException;
import ptolemy.moml.Documentation;
import ptolemy.moml.Vertex;

public class CGQueue extends TypedCompositeActor
{
public VersionAttribute A_createdBy;
public SizeAttribute A_vergilSize;
public LocationAttribute A_vergilLocation;
public DEDirector ADE;
public Parameter ADE_startTime;
public Parameter ADE_stopTime;
public Parameter ADE_stopWhenQueueIsEmpty;
public Parameter ADE_synchronizeToRealTime;
public Parameter ADE_isCQAdaptive;
public Parameter ADE_minBinCount;
public Parameter ADE_binCountFactor;
public ComponentPort PQueue_input;
public ComponentPort PQueue_output;
public ComponentPort PQueue_trigger;
public ComponentPort PClock_output;
public ComponentPort PClock_trigger;
public Parameter AClock_stopTime;
public Parameter AClock_period;
public Parameter AClock_offsets;
public Parameter AClock_values;
public Parameter AClock_numberOfCycles;
public Documentation AClock__doc;
public ComponentPort PClock2_output;
public ComponentPort PClock2_trigger;
public Parameter AClock2_stopTime;
public Parameter AClock2_period;
public Parameter AClock2_offsets;
public Parameter AClock2_values;
public Parameter AClock2_numberOfCycles;
public Documentation AClock2__doc;
public ComponentPort PTest_input;
public ComponentPort PTest_output;
public Parameter ATest_correctValues;
public Parameter ATest_tolerance;
public Parameter ATest_trainingMode;
public Vertex Arelation5_vertex1;

public CGQueue(Workspace workspace) throws IllegalActionException, 
NameDuplicationException {
super(workspace);
__CGInit();
}

  

Re: Firing by events

2004-02-19 Thread Christopher Hylands Brooks
The single window tabbed interface by Jerome Blanc and Benoit Masson
of Thales might be useful here.
This interface is in the ptII developer tree in $PTII/thales.
The single window interface has not yet been publically released.
To start it up from, run vergil -single.

The ptII/thales/README says:
 For the single window mode, the principle is to catch the frames
 created on each Tableau and move its container into the main
 TabbedPane.

 In this mode, you can either create classic editors, or navigable
 graph editor where beside the actors library there is a browsable
 model tree (warning : this doesn't work with any state machine actor,
 because there is only a navigable ActorGraphFrame, and there should be
 other navigable Frame for modal models, FSM and interface automation
 actors. This could be solved by merging the NavigableActorGraphFrame
 features into the BasicGraph Frame, but as always we try to develop
 without modifying the original Ptolemy sources.)

 There is a specific effigy for navigable models (single window
 mode). To create this specific effigy, the MoML file should contain a
 property at the top level named _navigable (property
 name=3D_navigable /). It is created automatically for each new
 navigable graph editor (new menu), and could be added on existing
 models.

So, perhaps this code could be used as the basis of an applet that
would allow traversal of the model?

The other thing I was working on was extending the applet code
generator so that it would generate a Web Start setup that would 
consist of only the classes necessary to run the model. 
This work is still in progress.

-Christopher


Professor Lee wrote:

At 05:00 PM 2/18/2004 -0800, Efrat Jaeger wrote:
A different question is about applets. When I create an applet out of a 
model that contains a composite entity, is it possible to look inside the 
composite entity from within the applet? (for presenting and running the 
workflow on a web page).

This has been on the to do list for some time... But
it's not entirely clear what it should do...  replace the
current image in the web page?  Open a window?  Go to a new
page?  I'm inclined to think it should go to a new page,
so the back button takes you back...

Edward



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


Re: Firing by events

2004-02-18 Thread Edward A Lee
At 05:00 PM 2/18/2004 -0800, Efrat Jaeger wrote:
A different question is about applets. When I create an applet out of a 
model that contains a composite entity, is it possible to look inside the 
composite entity from within the applet? (for presenting and running the 
workflow on a web page).
This has been on the to do list for some time... But
it's not entirely clear what it should do...  replace the
current image in the web page?  Open a window?  Go to a new
page?  I'm inclined to think it should go to a new page,
so the back button takes you back...
Edward




Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


changing default 'configure' action

2004-02-17 Thread Chad Berkley
Hi,

I'm trying to change the default action for double clicking (or choosing 
'configure' from the right click menu) on an actor.  It appears that in 
the class ConfigureAction, EditParametersDialog is hard coded to be the 
default editor for configuration.  Is there anyway to circumvent this so 
I can replace EditParametersDialog?  I know I can change the editor for 
a specific actor, but I'd like to change the default for all of them and 
this seems like the place to do it.

thanks,
chad

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


Re: VersionAttribute equals false problem

2004-01-29 Thread Edward A Lee
Interesting... Your fix looks right to me...  And in fact this
is a serious memory leak, so the fix is much appreciated.
I believe that the reason _tupleList is null is that the instance
of VersionAttribute is added to the workspace before setContainer()
is called to set the container. Then when setContainer() is called,
the object should get removed from the workspace, since the workspace
only contains top-level objects. setContainer() is called in the constructor
of the base class, probably NamedObj, so the fields of the derived
class have not been constructed yet.
I've implemented your fix in our development tree...

Edward



At 11:15 AM 1/29/2004 +0100, Richard van der Laan wrote:
Hi there,

I discovered a problem related to the VersionAttribute class while
integrating the ptolemy kernel in one of our own applications. Our
application creates a default workspace that is reused over the life-cycle
of many executed models. Models are manually parsed from a MoML file and
added to the workspace as seperate composite entities. After the model has
been executed it is removed from the workspace. By printing a workspace
directory list after the remove operation I discovered that the
VersionAttribute that is contained by the model is not removed from the
workspace. I don't know if Vergil creates a single workspace that is
reused for every new model, but in our application this eventually leads
to a out of memory exception.
The workspace remove operation discards all contained named objects by
calling remove on the internal workspace directory list. However this
operation fails for a VersionAttribute object. By analysing the equals
method of this class I discovered that equals fails for a comparison
between two identical object references:
public boolean equals(Object obj) {
// If the _tupleList is null, then we are not fully constructed.
// I see no choice but to return false.
if (_tupleList == null) {
---return false;
}
if (obj instanceof VersionAttribute) {
return (compareTo(obj) == 0);
}
return false;
}
Somehow the tupleList attribute does not exist during this call. I should
mention that the VersionAttribute object was created by the MoMl parser
and setExpression was applied under normal conditions. Therefore I cannot
explain why tupleList is null. Maybe there is a clone method involved.
However if it is correct that the tupleList attribute can be null under
these conditions, the implemention of the equals method should be modified
by calling equals on it's parent:
public boolean equals(Object obj) {
if (_tupleList == null) {
--- return super.equals(obj);
}
if (obj instanceof VersionAttribute) {
return (compareTo(obj) == 0);
}
return false;
}
This provides a working solution to our problem. However the fact that
tupleList can be null when parsed from a MoML file doesn't make any sense
to me.
Kind regards,

Richard van der Laan / [L]uminis
Email : [EMAIL PROTECTED]
TheWeb: http://www.luminis.nl

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

Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Re: [Ptolemy] Re: how to set icon locations

2004-01-14 Thread Edward A Lee

From: [EMAIL PROTECTED] (Manish_Kushwaha)
Subject: how to set icon locations
Date: 14 Jan 2004 13:25:30 -0800
Hi there,

I am using ptolemy II for my application. I have a small question.

I want to place the entity icons at specified locations. I have a file
having a list of what icon will go where. Can someone tell me how do
we read those file entries and set _location property in the XML file.
Is this the correct way to set location or there is another approach.
Thank you,
Manish Kushwaha
The MoML representation of location is, by default:

property name=_location class=ptolemy.kernel.util.Location 
value=205.0, 155.0
/property

If you simply set the X and Y value as shown, this will work.
You could use an XSL script, for example.
You can also set the position of an icon within a Ptolemy model.
There is an example at:
  $PTII/ptolemy/actor/parameters/demo/Bouncer/

It uses a parameter of class

  ptolemy.actor.parameters.LocationParameter

whic can have a value that is an expression that depends on other
parameters in the model. In that example, the location is changed
dynamically.
Edward




Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Creating subfolders using one file

2003-12-19 Thread Ilkay Altintas

Hello,

I'm working on an application where I need to create a folder composed of
some number of actor subfolders. The subfolders are created dynamically, by
executing a specific actor. (The actor wraps external operations as Ptolemy
II actors and places them in folders in the hierarchy.)
Since the number of subfolders are not specified in advance and the number
of subfolder files can be very big, I don't want to create a file for each
folder and link them using the input source=... moml facility.

To solve this, I was wondering if there is a way to create subfolders
without having to give references to input sources. So instead of saying
input source=ptolemy/actor/lib/... under the entity, can I have other
entities defining subfolders (in just one file)?

Has anyone had this problem before? Or do you have any suggestions on how it
would be done if it is possible to do it? I appreciate your help.

Thanks,
Ilkay



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


Re: Need to delay execution by 1 clk...

2003-12-04 Thread Mohamed Salem
Hi Kiran and all,

If this actor is constructed as one atomic-actor that models the eight
stages of execution, I would suggest that you re-build it as a composite
actor from eight diffent atmoic-actors (your own models and/or from
library actors).Each atomic actor in this model would be corresponding
to one of the eight stages of execution.

Pipeline your actors; in other words output of (actor1/stage 1) is
connected to input of (actor2/stage2);meanwhile all eight are
synchronous;i.e connected to the same main clock.

The DE director reacts to each positive edge as an event. The
running(execution) of the overall composite actor is a sequene of events
corresponding to each positive edge of the clock.

In this criteria, Consider two consecutive actors (one delivering to
the next) in (execution graph) ; at the positive edge both of them are
Fired such that at this instance(event) T ; (actorX) delivers its output
at time (T-1)to (actorX+1) and it produces simultaneously an output that
to be delivered to (actorX+1)in the next firing event(next positive
edge)at time (T+1).In other words the output token of actorX is reserved
(not changing) in the gap between two consecutive events.

for example :
assume 
actorX output at T-1 = m 
actorX output at T   = n 

(ActorX reserves-stores(flipflop) a value =m for one clock cycle)

Then
 
actor X+1 processes an input = m at time T 
actor X+1 processes an input = n at time T+1 

Conclusion , if I understand your exact problem , this method could
do your job without a delay actor in between actorX and actor X+1. 
Otherwise, insertion of a Timedelay with delay parameter of 1 could
help.

I hope that this would be helpful ...
let me know about results.

THANKS for your time and interest

Best Regards,

Mohamed A.Salem



On Thu, 2003-11-27 at 13:06, Kiran SB wrote:
 Hi
 I am new to ptolemy (6 months).
 Currently I am using PTII 3.0.2 for building(simulating) custom actors in the
 DE domain, which are basically executional elements (of a reconfigurable 
 device).
 
 In one particular situation I have an actor with 8 stages of execution.
 During initialize I construct a Execution(Data) flow graph depending on the
 selector settings in the actor.
 I traverse through the graph and execute each stage in it during fire.
 Now at one stage I need to create a delay of 1 clock.
 The executional unit needs to sleep for a clock and proceed to the next stage.
 Basically I need to forward time by a clock.
 setCurrentTime (currentTime+1) might not be a good idea as it might cause
 problems to the token's timestamp.
 What is to be achieved is that the currentTime after this stage should be
 t+1(say we started at t).
 I don't know if I can use DEEventQueue in any way for this purpose.
 Maybe its a wrong or a repeat question!
 I have searched all group messages and couldn't find anybody with such a
 requirement.
 Can somebody help me out with this problem?
 
 - kiran



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


Re: Need to delay execution by 1 clk...

2003-12-03 Thread Kiran SB
Thanks for the response...

TimedDelay just sends out a token after a specified delay (send (token, delay)).
what I am looking at is to stop(delay) the execution by a clock and proceed.
I could have used TimedDelay if I had to delay in a particular simulation.
But I need to delay inside an actor and not while sending out the Token.
Just somehow hold the execution for one clock. Its a flipflop kind of a device
which needs to hold the data for 1 clock and then give it out to the next stage of
execution.

- kiran


- Original Message -
From: Edward A Lee [EMAIL PROTECTED]
Date: Tue, 02 Dec 2003 15:23:31 -0800
To: Kiran SB [EMAIL PROTECTED]
Subject: Re: Need to delay execution by 1 clk...

 
 Will the TimedDelay actor do what you need?
 
 Edward Lee
 
 At 04:06 PM 11/27/2003 +0500, Kiran SB wrote:
 Hi
 I am new to ptolemy (6 months).
 Currently I am using PTII 3.0.2 for building(simulating) custom actors in the
 DE domain, which are basically executional elements (of a reconfigurable
 device).
 
 In one particular situation I have an actor with 8 stages of execution.
 During initialize I construct a Execution(Data) flow graph depending on the
 selector settings in the actor.
 I traverse through the graph and execute each stage in it during fire.
 Now at one stage I need to create a delay of 1 clock.
 The executional unit needs to sleep for a clock and proceed to the next stage.
 Basically I need to forward time by a clock.
 setCurrentTime (currentTime+1) might not be a good idea as it might cause
 problems to the token's timestamp.
 What is to be achieved is that the currentTime after this stage should be
 t+1(say we started at t).
 I don't know if I can use DEEventQueue in any way for this purpose.
 Maybe its a wrong or a repeat question!
 I have searched all group messages and couldn't find anybody with such a
 requirement.
 Can somebody help me out with this problem?
 
 - kiran
 --
 __
 Check out the latest SMS services @ http://www.linuxmail.org
 This allows you to send and receive SMS through your mailbox.
 
 
 Powered by Outblaze
 
 
 Posted to the ptolemy-hackers mailing list.  Please send administrative
 mail for this list to: [EMAIL PROTECTED]
 
 
 Edward A. Lee, Professor
 518 Cory Hall, UC Berkeley, Berkeley, CA 94720
 phone: 510-642-0455, fax: 510-642-2739
 [EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal
 

-- 
__
Check out the latest SMS services @ http://www.linuxmail.org 
This allows you to send and receive SMS through your mailbox.


Powered by Outblaze


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


Re: Need to delay execution by 1 clk...

2003-12-03 Thread Edward A Lee
Hmm... Your problem statement is still ambiguous.

If you want the delay to be a real-time delay, then you can set
the synchronizeToRealTime parameter of the DEDirector.
If what you need is the effect of a latch, then you want
to combine the TimedDelay with the Previous actor (in the
domain-specific/DE library).
It's also possible that the actor you want is Sleep
(in the real-time library).
Edward

At 06:56 PM 12/3/2003 +0500, Kiran SB wrote:
Thanks for the response...

TimedDelay just sends out a token after a specified delay (send (token, 
delay)).
what I am looking at is to stop(delay) the execution by a clock and proceed.
I could have used TimedDelay if I had to delay in a particular simulation.
But I need to delay inside an actor and not while sending out the Token.
Just somehow hold the execution for one clock. Its a flipflop kind of a device
which needs to hold the data for 1 clock and then give it out to the next 
stage of
execution.

- kiran

- Original Message -
From: Edward A Lee [EMAIL PROTECTED]
Date: Tue, 02 Dec 2003 15:23:31 -0800
To: Kiran SB [EMAIL PROTECTED]
Subject: Re: Need to delay execution by 1 clk...

 Will the TimedDelay actor do what you need?

 Edward Lee

 At 04:06 PM 11/27/2003 +0500, Kiran SB wrote:
 Hi
 I am new to ptolemy (6 months).
 Currently I am using PTII 3.0.2 for building(simulating) custom actors 
in the
 DE domain, which are basically executional elements (of a reconfigurable
 device).
 
 In one particular situation I have an actor with 8 stages of execution.
 During initialize I construct a Execution(Data) flow graph depending 
on the
 selector settings in the actor.
 I traverse through the graph and execute each stage in it during fire.
 Now at one stage I need to create a delay of 1 clock.
 The executional unit needs to sleep for a clock and proceed to the 
next stage.
 Basically I need to forward time by a clock.
 setCurrentTime (currentTime+1) might not be a good idea as it might cause
 problems to the token's timestamp.
 What is to be achieved is that the currentTime after this stage should be
 t+1(say we started at t).
 I don't know if I can use DEEventQueue in any way for this purpose.
 Maybe its a wrong or a repeat question!
 I have searched all group messages and couldn't find anybody with such a
 requirement.
 Can somebody help me out with this problem?
 
 - kiran
 --
 __
 Check out the latest SMS services @ http://www.linuxmail.org
 This allows you to send and receive SMS through your mailbox.
 
 
 Powered by Outblaze
 
 --- 
-
 Posted to the ptolemy-hackers mailing list.  Please send administrative
 mail for this list to: [EMAIL PROTECTED]

 
 Edward A. Lee, Professor
 518 Cory Hall, UC Berkeley, Berkeley, CA 94720
 phone: 510-642-0455, fax: 510-642-2739
 [EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal


--
__
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.
Powered by Outblaze

Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Re: Need to delay execution by 1 clk...

2003-12-02 Thread Edward A Lee
Will the TimedDelay actor do what you need?

Edward Lee

At 04:06 PM 11/27/2003 +0500, Kiran SB wrote:
Hi
I am new to ptolemy (6 months).
Currently I am using PTII 3.0.2 for building(simulating) custom actors in the
DE domain, which are basically executional elements (of a reconfigurable
device).
In one particular situation I have an actor with 8 stages of execution.
During initialize I construct a Execution(Data) flow graph depending on the
selector settings in the actor.
I traverse through the graph and execute each stage in it during fire.
Now at one stage I need to create a delay of 1 clock.
The executional unit needs to sleep for a clock and proceed to the next stage.
Basically I need to forward time by a clock.
setCurrentTime (currentTime+1) might not be a good idea as it might cause
problems to the token's timestamp.
What is to be achieved is that the currentTime after this stage should be
t+1(say we started at t).
I don't know if I can use DEEventQueue in any way for this purpose.
Maybe its a wrong or a repeat question!
I have searched all group messages and couldn't find anybody with such a
requirement.
Can somebody help me out with this problem?
- kiran
--
__
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.
Powered by Outblaze


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

Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Need to delay execution by 1 clk...

2003-11-27 Thread Kiran SB
Hi
I am new to ptolemy (6 months).
Currently I am using PTII 3.0.2 for building(simulating) custom actors in the
DE domain, which are basically executional elements (of a reconfigurable 
device).

In one particular situation I have an actor with 8 stages of execution.
During initialize I construct a Execution(Data) flow graph depending on the
selector settings in the actor.
I traverse through the graph and execute each stage in it during fire.
Now at one stage I need to create a delay of 1 clock.
The executional unit needs to sleep for a clock and proceed to the next stage.
Basically I need to forward time by a clock.
setCurrentTime (currentTime+1) might not be a good idea as it might cause
problems to the token's timestamp.
What is to be achieved is that the currentTime after this stage should be
t+1(say we started at t).
I don't know if I can use DEEventQueue in any way for this purpose.
Maybe its a wrong or a repeat question!
I have searched all group messages and couldn't find anybody with such a
requirement.
Can somebody help me out with this problem?

- kiran
-- 
__
Check out the latest SMS services @ http://www.linuxmail.org 
This allows you to send and receive SMS through your mailbox.


Powered by Outblaze


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


Coupling HLA federate with Ptolemy II ?

2003-11-26 Thread BERGERO Didier
Hi,

  Which is the positioning of Ptolemy compared to HLA ?

  How coupling an HLA federate with Ptolemy II ?

Best regards,


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


Ptolemy II : reuse legacy application, distributed actors

2003-11-25 Thread BERGERO Didier
Hi,

I have 2 (newbie?) questions :

*   While waiting for e-ptolemy, with Ptolemy II and in the same
simulation, how to use local actors and remote (distributed) actors ? : use
of applets...
*   and how to reuse legacy application e.g. how to wrap C,FORTRAN,ADA!!
code to be an Ptolemy II actor ?
 

Best regards,



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


Re: Ptolemy II : reuse legacy application, distributed actors

2003-11-25 Thread Christopher Hylands Brooks
BERGERO Didier [EMAIL PROTECTED] writes:

 I have 2 (newbie?) questions :
 
 * While waiting for e-ptolemy, with Ptolemy II and in the same
 simulation, how to use local actors and remote (distributed) actors ? : use
 of applets...

I'm not sure what e-ptolemy is in this context.

There are some actors that use jxta in $PTII/ptolemy/actor/lib/jxta

We have some corba actors, though they have not been released.

We are starting to look at Grid computing, but we do not have any
results to report yet.

Use of applets is covered in
http://ptolemy.eecs.berkeley.edu/papers/03/ptIIDesignSoftware

 * and how to reuse legacy application e.g. how to wrap C,FORTRAN,ADA!!
 code to be an Ptolemy II actor ?

Ptolemy II 3.0.2 includes an interface that uses JNI, see
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/ptII3.0.2/jni/doc/JNIActorHelp.pdf

See also the matlab actor in $PTII/ptolemy/matlab

-Christopher


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


Re: removing and readding actors to a model

2003-11-24 Thread Edward A Lee
Ah, this sounds like an extremely useful capability...

Java has a hot-swap capability... This is used, for example,
by Eclipse when you modify and recompile a piece of code while
the debugger is running. So to some extent, you get this for
free if you use Eclipse as the development environment.
However, I suspect this hot-swap capability is tricky to use...
Sometimes Eclipse reports that a hot swap isn't
possible for some instances...  I'm not sure what the
criteria are for determining whether hot swap is possible.
Anybody out there know more about this?
BTW: The capabilities you are describing here would probably
be most useful if they were folded in to the main Ptolemy II tree...
However, keep in mind that we can't fold in GPL'd code, because
then the GPL terms spread to the entire system...
Edward



At 08:38 AM 11/24/2003 -0800, Chad Berkley wrote:
hi edward,

sorry, I should have told you what I was doing.  I've already written a 
utility to create actor code, compile it and then put it into the actor 
library.  Now, I'm trying to use the same GUI that I developed to open an 
existing actor, modify it, recompile it then update the relevant models 
(those being the actorLibrary and the model that the edit request came 
from).  Is there an easier way to get the models to update with the new 
actor information?

thanks,
chad
Edward A Lee wrote:
Shouldn't removing the actor also be done in a ChangeRequest?
This seems like a very puzzling thing to do... What are you trying
to accomplish?
Edward
At 10:34 AM 11/21/2003 -0800, Chad Berkley wrote:
hi,

I'm trying to remove and actor from the actorLibrary model, change it, 
then re-add it.  For some reason, when it re-adds, you don't see the 
changes that were made.

Here's the code that I'm using:

List l = actorLibrary.entityList();
for(int i=0; il.size(); i++)
{  //look for the actor in the container.if it's there, remove it
  ComponentEntity ce = (ComponentEntity)l.get(i);
  if(ce.getName().equals(actor.getName()))
  {
try
{
  ce.setContainer(null); //remove the found entity
  StringWriter buffer = new StringWriter();
  ce.exportMoML(buffer, 1);
  ChangeRequest request = new MoMLChangeRequest(ce, actorLibrary,
buffer.toString());
  actorLibrary.requestChange(request);
  break;
}
catch(Exception e)
{
  throw new RuntimeException(Error removing existing actor from  +
container:  + e.getMessage());
}
  }
}
actor.setContainer(actorLibrary);
StringWriter buffer = new StringWriter();
actor.exportMoML(buffer, 1);
ChangeRequest request = new MoMLChangeRequest(actor, actorLibrary,
  buffer.toString());
actorLibrary.requestChange(request);
When the ChangeRequest is made within the loop, it seems to *add* the 
actor to the library instead of remove it, even though I set the 
container to null.  Vergil gives me an error when it hits the 2nd 
ChangeRequest saying that there is already an Entity with the same name 
in the model.  If I remove the ChangeRequest within the loop, it appears 
to work (i.e. it does not give any error when it leaves the loop and 
resets the container) but it does not, in fact, update the model.

Any ideas?

thanks,
chad
--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---
 

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

Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal


--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---

Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Re: removing and readding actors to a model

2003-11-24 Thread Matt Jones
Chad,

I think that you need to consider the classloader issues in order to be 
able to do this.  The JVM loads a class using the default ClassLoader -- 
which I think caches the class so that it needn't load it again. 
So...even if you get it reinserted into the Ptolemy hierarchy, the JVM 
will still use the original class unless you override the ClassLoader. 
In the examples I have seem of dynamic recompilation, the application 
has had to replace the default ClassLoader with a custom one that knows 
to check for new compiled versions when the JVM asks for a class to be 
loaded.  I sent you a Java tutorial a few months ago about this when I 
was thinking about the design of the reloadable actors for Kepler.  I 
can drag this out again if you'd like if you don't have the original email.

Matt

Hope this helps,

Matt

Edward A Lee wrote:

Ah, this sounds like an extremely useful capability...

Java has a hot-swap capability... This is used, for example,
by Eclipse when you modify and recompile a piece of code while
the debugger is running. So to some extent, you get this for
free if you use Eclipse as the development environment.
However, I suspect this hot-swap capability is tricky to use...
Sometimes Eclipse reports that a hot swap isn't
possible for some instances...  I'm not sure what the
criteria are for determining whether hot swap is possible.
Anybody out there know more about this?
BTW: The capabilities you are describing here would probably
be most useful if they were folded in to the main Ptolemy II tree...
However, keep in mind that we can't fold in GPL'd code, because
then the GPL terms spread to the entire system...
Edward



At 08:38 AM 11/24/2003 -0800, Chad Berkley wrote:

hi edward,

sorry, I should have told you what I was doing.  I've already written 
a utility to create actor code, compile it and then put it into the 
actor library.  Now, I'm trying to use the same GUI that I developed 
to open an existing actor, modify it, recompile it then update the 
relevant models (those being the actorLibrary and the model that the 
edit request came from).  Is there an easier way to get the models to 
update with the new actor information?

thanks,
chad
Edward A Lee wrote:

Shouldn't removing the actor also be done in a ChangeRequest?
This seems like a very puzzling thing to do... What are you trying
to accomplish?
Edward
At 10:34 AM 11/21/2003 -0800, Chad Berkley wrote:
hi,

I'm trying to remove and actor from the actorLibrary model, change 
it, then re-add it.  For some reason, when it re-adds, you don't see 
the changes that were made.

Here's the code that I'm using:

List l = actorLibrary.entityList();
for(int i=0; il.size(); i++)
{  //look for the actor in the container.if it's there, remove it
  ComponentEntity ce = (ComponentEntity)l.get(i);
  if(ce.getName().equals(actor.getName()))
  {
try
{
  ce.setContainer(null); //remove the found entity
  StringWriter buffer = new StringWriter();
  ce.exportMoML(buffer, 1);
  ChangeRequest request = new MoMLChangeRequest(ce, actorLibrary,
buffer.toString());
  actorLibrary.requestChange(request);
  break;
}
catch(Exception e)
{
  throw new RuntimeException(Error removing existing actor from 
 +
container:  + e.getMessage());
}
  }
}

actor.setContainer(actorLibrary);
StringWriter buffer = new StringWriter();
actor.exportMoML(buffer, 1);
ChangeRequest request = new MoMLChangeRequest(actor, actorLibrary,
  buffer.toString());
actorLibrary.requestChange(request);
When the ChangeRequest is made within the loop, it seems to *add* 
the actor to the library instead of remove it, even though I set the 
container to null.  Vergil gives me an error when it hits the 2nd 
ChangeRequest saying that there is already an Entity with the same 
name in the model.  If I remove the ChangeRequest within the loop, 
it appears to work (i.e. it does not give any error when it leaves 
the loop and resets the container) but it does not, in fact, update 
the model.

Any ideas?

thanks,
chad
--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---
 

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



Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal


--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---



Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal
 

Posted 

Re: removing and readding actors to a model

2003-11-24 Thread Stephen Andrew Neuendorffer
I think it makes more sense to use Java's classloader to do this  (as Matt 
suggests) rather than hot-swap.
With hot-swap, the classes are expected to be consistent with one another 
(as with a debugger, for instance)
Since there is no way to ensure this, an exception will likely result.

We've talked several times about doing this, but it always seemed very 
tricky.  In particular, you'd have to reload the library,
and reload some/all of the loaded models with the new class loader.  There 
is a facility for this in the MoMLParser
(A constructor that takes a class loader).  However, only some changes can 
be made while keeping the classes consistent with the
model, so there seem to be some trickiness in representing this to the user 
in a consistent way.

FYI: The key to doing this in Java is that classes accessible to your class 
loader should not
be accessible to the standard class loader.  (i.e. they must be in a 
classpath that is not accessible from $PTII).
If you follow this constraint, then it is relatively easy to implement 
using the URLClassLoader class.

Steve

At 11:19 AM 11/24/2003 -0900, Matt Jones wrote:
Chad,

I think that you need to consider the classloader issues in order to be 
able to do this.  The JVM loads a class using the default ClassLoader -- 
which I think caches the class so that it needn't load it again. So...even 
if you get it reinserted into the Ptolemy hierarchy, the JVM will still 
use the original class unless you override the ClassLoader. In the 
examples I have seem of dynamic recompilation, the application has had to 
replace the default ClassLoader with a custom one that knows to check for 
new compiled versions when the JVM asks for a class to be loaded.  I sent 
you a Java tutorial a few months ago about this when I was thinking about 
the design of the reloadable actors for Kepler.  I can drag this out again 
if you'd like if you don't have the original email.

Matt

Hope this helps,

Matt

Edward A Lee wrote:

Ah, this sounds like an extremely useful capability...
Java has a hot-swap capability... This is used, for example,
by Eclipse when you modify and recompile a piece of code while
the debugger is running. So to some extent, you get this for
free if you use Eclipse as the development environment.
However, I suspect this hot-swap capability is tricky to use...
Sometimes Eclipse reports that a hot swap isn't
possible for some instances...  I'm not sure what the
criteria are for determining whether hot swap is possible.
Anybody out there know more about this?
BTW: The capabilities you are describing here would probably
be most useful if they were folded in to the main Ptolemy II tree...
However, keep in mind that we can't fold in GPL'd code, because
then the GPL terms spread to the entire system...
Edward
At 08:38 AM 11/24/2003 -0800, Chad Berkley wrote:

hi edward,

sorry, I should have told you what I was doing.  I've already written a 
utility to create actor code, compile it and then put it into the actor 
library.  Now, I'm trying to use the same GUI that I developed to open 
an existing actor, modify it, recompile it then update the relevant 
models (those being the actorLibrary and the model that the edit request 
came from).  Is there an easier way to get the models to update with the 
new actor information?

thanks,
chad
Edward A Lee wrote:

Shouldn't removing the actor also be done in a ChangeRequest?
This seems like a very puzzling thing to do... What are you trying
to accomplish?
Edward
At 10:34 AM 11/21/2003 -0800, Chad Berkley wrote:
hi,

I'm trying to remove and actor from the actorLibrary model, change it, 
then re-add it.  For some reason, when it re-adds, you don't see the 
changes that were made.

Here's the code that I'm using:

List l = actorLibrary.entityList();
for(int i=0; il.size(); i++)
{  //look for the actor in the container.if it's there, remove it
  ComponentEntity ce = (ComponentEntity)l.get(i);
  if(ce.getName().equals(actor.getName()))
  {
try
{
  ce.setContainer(null); //remove the found entity
  StringWriter buffer = new StringWriter();
  ce.exportMoML(buffer, 1);
  ChangeRequest request = new MoMLChangeRequest(ce, actorLibrary,
buffer.toString());
  actorLibrary.requestChange(request);
  break;
}
catch(Exception e)
{
  throw new RuntimeException(Error removing existing actor from  +
container:  + e.getMessage());
}
  }
}
actor.setContainer(actorLibrary);
StringWriter buffer = new StringWriter();
actor.exportMoML(buffer, 1);
ChangeRequest request = new MoMLChangeRequest(actor, actorLibrary,
  buffer.toString());
actorLibrary.requestChange(request);
When the ChangeRequest is made within the loop, it seems to *add* the 
actor to the library instead of remove it, even though I set the 
container to null.  Vergil gives me an error when it hits the 2nd 
ChangeRequest saying that there is already an Entity with the same 
name in the model.  If I remove the 

Re: [Ptolemy] Re: Implementing high level queues

2003-11-22 Thread Edward A Lee
At 11:33 AM 11/21/2003 -0800, [EMAIL PROTECTED] wrote:
I am currently looking for a way to implement a high level queue.  By
this I am looking to have a queue that exists in the top level model
but can be accessed in a lower level model, e.g. in submodel A, tokens
can enter a queue and in submodel B, tokens can enter the same queue,
e.g. for accessing a shared resource such as a LAN.  Is there a way to
reference a queue or some other way to implement this?
Are you saying you don't want the submodels to have
connections to the queue?
If actors communicate outside the structure of the model of
computation, then you are on your own.  You can implement this
in Java by, for example, having a common base class for the
actors with a static data structure representing instances
of the resource you want to share.
However, I would caution against this approach.  Since the
ordering of events will be outside the model of computation,
the computation will likely be nondeterministic, which means
your execution will not be repeatable, and also that you won't
be able to infer much from an execution (it happened to execute
this way this time...).
A better approach would probably be to have a mechanism for
actors to communicate without connections, but within the
model of computation.  We are currently developing a wireless
domain that is based on DE that does this.  The basic mechanism
is to subclass TypedIOPort to create a specialized WirelessPort
that has as a parameter the name of the channel through
which communication will occur.  You could do something similar,
creating a ResourceIOPort with a parameter that identifies
the shared resource (the queue).
I would be happy to help in developing this, but I don't
really have much time these days...

Another thing I will be looking to implement is adding extra
paramenters to each event.  For example at the moment my poisson event
creator emits a stream of doubles, could I implement it that it emits
an array instead and that the other actors, e.g. queues, comparators
can accept these tokens and maybe act on a particular element of the
array, e.g. array[0], without having to make changes to these actors,
and then write the modified value back to array[0]?  If this is not
possible could I emit a stream of incrementing doubles that I can use
as reference numbers to the events and have a list of parameters that
would be associated with each reference number that could then be
accessed and modified?
As I mentioned before I am looking to model a HTTP request and I need
to associate information such as the size of the page, the number of
images, etc. with each request, which will then be used to determine
what way the system responds.


Why not just make your event a record token?  Then you can
have named fields of arbitrary type and manipulate them
independently.
Edward


Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Re: removing and readding actors to a model

2003-11-22 Thread Edward A Lee
Shouldn't removing the actor also be done in a ChangeRequest?

This seems like a very puzzling thing to do... What are you trying
to accomplish?
Edward

At 10:34 AM 11/21/2003 -0800, Chad Berkley wrote:
hi,

I'm trying to remove and actor from the actorLibrary model, change it, 
then re-add it.  For some reason, when it re-adds, you don't see the 
changes that were made.

Here's the code that I'm using:

List l = actorLibrary.entityList();
for(int i=0; il.size(); i++)
{  //look for the actor in the container.if it's there, remove it
  ComponentEntity ce = (ComponentEntity)l.get(i);
  if(ce.getName().equals(actor.getName()))
  {
try
{
  ce.setContainer(null); //remove the found entity
  StringWriter buffer = new StringWriter();
  ce.exportMoML(buffer, 1);
  ChangeRequest request = new MoMLChangeRequest(ce, actorLibrary,
buffer.toString());
  actorLibrary.requestChange(request);
  break;
}
catch(Exception e)
{
  throw new RuntimeException(Error removing existing actor from  +
container:  + e.getMessage());
}
  }
}
actor.setContainer(actorLibrary);
StringWriter buffer = new StringWriter();
actor.exportMoML(buffer, 1);
ChangeRequest request = new MoMLChangeRequest(actor, actorLibrary,
  buffer.toString());
actorLibrary.requestChange(request);
When the ChangeRequest is made within the loop, it seems to *add* the 
actor to the library instead of remove it, even though I set the container 
to null.  Vergil gives me an error when it hits the 2nd ChangeRequest 
saying that there is already an Entity with the same name in the 
model.  If I remove the ChangeRequest within the loop, it appears to work 
(i.e. it does not give any error when it leaves the loop and resets the 
container) but it does not, in fact, update the model.

Any ideas?

thanks,
chad
--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---

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

Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Re: Ptolemy modeling of complex distributed software systems

2003-11-21 Thread Edward A Lee
Very interesting... Did you look at DEThreadActor?  It has
some of what you do, but not all... In particular, it doesn't
have the (nice) feature that the director waits for active
actors to allow time to pass.  This is similar to what we've
done in timed CSP and timed PN...
As for these specific questions:

At 06:12 PM 11/20/2003 -0600, Charles Liu wrote:

The work around I have requires the
insertion of a method call into the _dequeueEvents
method, which can't be overriden easily due to access
to private member variables in DEDirector.  Here lies
the question (or rather feature request):  How can
I request a change to the DEDirector for the next
release to support what I'm attempting to do?  For
now, I've just modified my local copy of DEDirector.
With the changes, my simulation seems to be running
correctly.
Please do request the change.  It sounds like
what you are doing is using the strategy pattern,
which is often a good idea.  I.e., have _dequeueEvents
call a protected method where a simple default implementation
is provided in the DEDirector, but your director subclasses
this...  If you send me your version of the DEDirector,
I'll take a look.
Note that any contributed code has to bear our copyright
or something equivalent (e.g., you can change the name of
the copyright holder if you contribute a new file). But
in particular, we can't include GPL'd code in the main
body of Ptolemy II, because then all of Ptolemy II will
become GPL'd (this is a sort of copyright virus).
Also, contributed code needs to follow our coding style
in order to be included in the main code base.  You can
find this at:
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest/ptII/doc/coding/style.htm


Another (easier) question:  I would like to identify
tag an IOPort for special processing while creating
it in the constructor of an Actor.  How can I do
this without adding a Parameter to it or subclassing
it?  All I need is something that lets me add a
property (perhaps Attribute?) to the IOPort.
You can simply add an attribute to a port.
To do this in vergil, right click on the port,
select Configure and then do add.  The
added property will be persistent.
The attribute can also be added by Java code.
The right way to do this is queue a change request,
so that the attribute is added at a time when
it is safe to do that.  See the SDF domain
director for an example... It adds attributes
to ports and actors for use with scheduling.
Note that in the latest release, the only way
to add a non-persistent attribute was to use
one of the Attribute subclasses that are not
persistent, such as TransientConfigurableAttribute.
In the latest version (on the CVS tree), any
attribute can be made non-persistent by calling
setPersistent(false).  This prevents the attribute
from cluttering the MoML file.
Edward


Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


removing and readding actors to a model

2003-11-21 Thread Chad Berkley
hi,

I'm trying to remove and actor from the actorLibrary model, change it, 
then re-add it.  For some reason, when it re-adds, you don't see the 
changes that were made.

Here's the code that I'm using:

List l = actorLibrary.entityList();
for(int i=0; il.size(); i++)
{  //look for the actor in the container.if it's there, remove it
  ComponentEntity ce = (ComponentEntity)l.get(i);
  if(ce.getName().equals(actor.getName()))
  {
try
{
  ce.setContainer(null); //remove the found entity
  StringWriter buffer = new StringWriter();
  ce.exportMoML(buffer, 1);
  ChangeRequest request = new MoMLChangeRequest(ce, actorLibrary,
buffer.toString());
  actorLibrary.requestChange(request);
  break;
}
catch(Exception e)
{
  throw new RuntimeException(Error removing existing actor from  +
container:  + e.getMessage());
}
  }
}
actor.setContainer(actorLibrary);
StringWriter buffer = new StringWriter();
actor.exportMoML(buffer, 1);
ChangeRequest request = new MoMLChangeRequest(actor, actorLibrary,
  buffer.toString());
actorLibrary.requestChange(request);
When the ChangeRequest is made within the loop, it seems to *add* the 
actor to the library instead of remove it, even though I set the 
container to null.  Vergil gives me an error when it hits the 2nd 
ChangeRequest saying that there is already an Entity with the same name 
in the model.  If I remove the ChangeRequest within the loop, it appears 
to work (i.e. it does not give any error when it leaves the loop and 
resets the container) but it does not, in fact, update the model.

Any ideas?

thanks,
chad
--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---

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


Re: Adding a new type to BaseType

2003-11-05 Thread Stephen Andrew Neuendorffer
To speed up type comparisons, the TypeLattice keeps a cache of comparison 
information in a 2D array.  The 2D array is preallocated in the TypeLattice 
class of size  Type.HASH_MAX.  You have to change that value when adding a 
new type.  (or simply implement the getTypeHash method to return 
HASH_INVALID  (as the documentation suggests).

Note, however that it is not necessary to add new types to the type 
lattice, as long as they are not comparable with existing types (other than 
UNKNOWN and GENERAL.  Simply having the type class is enough to get the 
type system to check types for you.  There is an example of how to do this 
in data/type/test/TestToken.java

Steve

At 06:49 PM 11/4/2003 -0800, Efrat Jaeger wrote:
Hi,

I'm adding a new type to BaseType.java; a database connection type which 
would be passed between actors in a workflow to keep the DB Connection 
variable.

I've changed the following files:
TypeLattice - added nodeweight and edges (to general and unknown).
Constants - added the new type to the hash table.
BaseType - added the type in a similar manner as the other types.
I also created a DBConToken class which contains all the methods as 
ObjectToken (changed for this purpose).

I get an exception: ArrayIndexOutOfBound in the compare method of 
TypeLattice (exception 14). I saw that this exception occurs for 
MatrixTokens (which isn't the case here). Please let me know if there is 
anything else I should change in order to prevent this exception (I assume 
that this type should be added in a similar way to ObjectType, since it's 
a private case of it). I tried to solve it by changing the 
ConversionsUtility file as well, but it wasn't very helpful.

Thank you,

Efrat





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


Adding a new type to BaseType

2003-11-04 Thread Efrat Jaeger



Hi,

I'm adding a new type to BaseType.java;a 
database connection type which would be passed between actors in a workflow to 
keep the DB Connection variable.

I've changed the following files: 
TypeLattice - added nodeweight and edges (to 
general and unknown).
Constants - added the new type to the hash 
table.
BaseType - added the type in a similar manner as 
the other types.

I also created a DBConToken class which contains 
all the methods as ObjectToken (changed for this purpose).

I get an exception: ArrayIndexOutOfBound in the 
compare method of TypeLattice (exception 14). I saw that this exception occurs 
for MatrixTokens (which isn't the case here). Please let me know if there is anything else I should change in order to 
prevent this exception (I assume that this type should be added in a similar way 
to ObjectType, since it's a private case of it). I tried to solve it by changing 
the ConversionsUtility file as well, but it wasn't very helpful.

Thank you,

Efrat




Re: extending the type system

2003-10-14 Thread Edward A Lee
Bertram:

Absence of a value (something that I think a null for a double
is intended to indicate) is a key property of a model of computation.
I'm not sure that representing it in a data type is a good approach.
In particular, a key property of process networks and dataflow is
that absence is not a well-defined concept.  This is a key way
in which they maintain determinacy.  This is why, when you call
hasToken() on a port in PN, the answer is always true.
I think there are potentially two better solutions:

1) Use a different MoC that has a concept of absence.
   E.g., DE or SR.
2) Create a new subclass of PN or SDF, where, for example,
   if I send through a port an instance of NullToken,
   then at the far end, hasToken() returns false.
Having hasToken() return false will make it much easier
to re-use existing actors at the receiving end.  You will
still need new actors to send the NullToken, however.
I would look at approach 1, and only after coming up
with a clear understanding of why it isn't the right
solution, pursue approach 2.
Implementing (2) won't be totally trivial, primarily
because of the way types are enforced at run time.
It will probably require some refactoring of the
pertinent code.  But I'm sure it could be done cleanly...
Edward

At 09:49 PM 10/13/2003 -0700, Bertram Ludaescher wrote:

Steve, Chad:

Here is a related question (I had discussed this earlier today with
Shawn) on how to do things properly in PTII:
The type extension mentioned by Chad, let's call it ndouble for
nullable double can (and probably should) be modeled as a
*supertype* to double since its instances are precisely double U
null (all double numbers plus null). The problem with this, however,
is that any code that works for double (say an actor computing the
running average of its stream of double values) now won't work for
ndouble since the latter is a supertype of the former.
If it were the other way round, i.e., ndouble being a subtype of
double, we could assume that all code still works for the subtype. Of
course this doesn't work as-is, since the double actors don't really
know what to do with a null value.
Bottom line (not surprising): for existing actors to work on a new
type such as ndouble, something needs to be changed to take into
account the new behavior (for nulls in this case). The question is how
to best engineer this in general, and in PTII in particular.
Any suggestions most welcome.

It also seems that the following article by Castagna is relevant to
this discussion:
Covariance And Contravariance:conflict Without A Cause (1994)
Giuseppe Castagna
http://citeseer.nj.nec.com/24009.html
Bertram

 SAN == Stephen Andrew Neuendorffer [EMAIL PROTECTED] 
writes:
SAN
SAN Modifying the type hierarchy in this way is difficult: We haven't yet
SAN implemented a good way to make it extensible in this way.
SAN Part of the problem is that the type lattice is somewhat hardcoded into
SAN operations on the token classes.  Modifying the type hierarchy in
SAN significant ways is not currently possible without modifying the 
existing
SAN token classes at the same time.  I have some ideas on improving the
SAN situation, but I haven't had time to implement them yet.
SAN
SAN The one way that the type hierarchy *can* be simply extended is that it
SAN allows the addition of new data types that are incomparable with
SAN the existing types (other than UNKNOWN and GENERAL, of course).  If you
SAN define a new Token class, and a corresponding type class, then this type
SAN will be correctly type checked.
SAN
SAN There are other ways to get the behavior you desire..  One is through an
SAN (unimplemented) structured type called Union which operates similar
SAN Unions in C...  This should be relatively easy to implement, we just
SAN haven't gotten around to it.  Your type is then Union(double, event) or
SAN something similar.
SAN Another way is to use side information (a boolean, for instance) to
SAN determin whether or not the double is valid.
SAN Another way is to use a less constrained Model of Computation (like 
SR or
SAN DE) which has a built-in notion of absent.
SAN Any one of these would probably be significantly simpler than 
modifying the
SAN existing double token
SAN
SAN Steve
SAN
SAN At 11:08 AM 10/13/2003 -0700, Chad Berkley wrote:
 Hello,

 We have a question about the extensibility of the Ptolemy II type system.
 In our project, we need to extend the type system by adding new
 data types and modifying the type hierarchy.  As an example, we need to
 incorporate a new double type (as a superclass of double) that accepts
 null, or missing, values.

 We would like to add new data types without altering the Ptolemy 
codebase.
 It seems the way to do this is by overriding the TypeLattice class (to 
add
 new edges for our new extended types).  We had the impression (e.g., as
 discussed in Chapter 12 of the manual) that this extensibility was
 possible.  However, it appears that the TypeLattice is 

Re: Is there a way to speed up the redraw?

2003-10-13 Thread Christopher Hylands Brooks
In comp.soft-sys.ptolemy, luedeke [EMAIL PROTECTED] writes:

 I have the feeling that the redraw of a ptolemy.plot.Plot object is a bit
 slow, because doubled buffering or something else is not used, so the plot
 has to be recalulated each time a redraw is needed. Is there a way to speed
 up the redraw?
 
 Alexander

Are you using the most recent version of Ptplot, Ptplot 5.3?
Ptplot 5.3 is the version that shipped with Ptolemy II 3.0

There were some changes made for double buffering betweent Ptplot 5.2
and 5.3.  Another change is that the lines are now drawn thicker.

-Christopher


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


extending the type system

2003-10-13 Thread Chad Berkley
Hello,

We have a question about the extensibility of the Ptolemy II type 
system. In our project, we need to extend the type system by adding new
data types and modifying the type hierarchy.  As an example, we need to
incorporate a new double type (as a superclass of double) that accepts
null, or missing, values.

We would like to add new data types without altering the Ptolemy 
codebase. It seems the way to do this is by overriding the TypeLattice 
class (to add new edges for our new extended types).  We had the 
impression (e.g., as discussed in Chapter 12 of the manual) that this 
extensibility was possible.  However, it appears that the TypeLattice is 
hard coded, e.g., it is not a parameter to the BaseType class, and 
instead, a default instance of TypeLattice is hard coded into BaseType.

So, the questions are:  Are our ideas using the Ptolemy type system code
in the way in which it was intended?  Are there other ways to extend 
types without altering the Ptolemy code?  Do you have any suggestions as 
to our approach?

thanks,
chad
--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---

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


Plotting SVGs

2003-09-30 Thread Efrat Jaeger



Hi all,

Is there a way to use PlotML files from 
withina Ptolemy model or perhaps it is possible to invoke PtPlot from the 
Vergil interface?

I would like to plot SVG files similar to the way 
icons are created (but with a plot frame).I was able to find the code 
where the icons are being configured,can you please refer me to 
thecode wherethe icons are actuallybeing "loaded" (dealing 
with the SVG code).

Thanks,

Efrat


Re: Cancelling an Event in the DE Domain

2003-09-28 Thread Edward A Lee
There are two ways to generate future events:

  - using a DEIOPort and its send(int, Token, double) method
to create an event in the future.  This event cannot be
cancelled.
  - using fireAt() to request a refiring at a future time
and then when that refiring occurs, sending the output
at the current time.  This can be easily cancelled.
Very few actors use the first method, but some of the delay
actors are among them.  I don't like the first method, and am
considering deprecating it.  The delay actors should be redone
to use the second method, and I think that having a cancel port
would be an excellent idea...  Perhaps you would like to take
a stab at making this change for VariableDelay?
Edward

At 01:29 PM 9/26/2003 -0400, [EMAIL PROTECTED] wrote:
Hi,

I'm interested in cancelling a particular discrete event that has already
been scheduled.  Can this be done?
An example: I'm modeling a car moving on a highway in discrete steps from
speed sign to speed sign.  The car moves at the posted speed of the
previous sign.  At each speed sign the time required to reach the next
sign is computed, and a delay equal to that time instantiated.  But what
if some asynchronous thing happens like the sudden appearance of a radar
trap between signs, prior to when I will read that location.  I will need
to slow down, so I have a new event at the speed lign location.  But, my
previously calculated time-to-travel to the next sign is no longer valid:
my speed has changed.  I can schedule a new delay, but how do I cancel the
already scheduled event?
I don't see any methods in the DEDirector to cancel a specific future
event, even if there was some way to precisely identify it.
From an actor point-of-view, it would be nice if the variableDelay actor
in the library had an additional input port labelled cancel which
cancelled the pending event.
Thanks!


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

Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Cancelling an Event in the DE Domain

2003-09-26 Thread clancaster
Hi,

I'm interested in cancelling a particular discrete event that has already
been scheduled.  Can this be done?

An example: I'm modeling a car moving on a highway in discrete steps from
speed sign to speed sign.  The car moves at the posted speed of the
previous sign.  At each speed sign the time required to reach the next
sign is computed, and a delay equal to that time instantiated.  But what
if some asynchronous thing happens like the sudden appearance of a radar
trap between signs, prior to when I will read that location.  I will need
to slow down, so I have a new event at the speed lign location.  But, my
previously calculated time-to-travel to the next sign is no longer valid:
my speed has changed.  I can schedule a new delay, but how do I cancel the
already scheduled event?

I don't see any methods in the DEDirector to cancel a specific future
event, even if there was some way to precisely identify it.

From an actor point-of-view, it would be nice if the variableDelay actor
in the library had an additional input port labelled cancel which
cancelled the pending event.

Thanks!


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


Re: Point width on XYPlotter

2003-09-25 Thread Christopher Hylands Brooks
In the XYPlotter, click on the plot format button
in the upper right (this is the second from the right button that has
two red impulse lines)
Then select
Marks: dots

Save your model

When you run it again, it will have a dot for the single point.

The way this works is that the MoML file gets some plotml inside
a configure element that sets the marks to dots

-Christopher

Christopher Hylands Brooks [EMAIL PROTECTED]  University of California
Programmer/Analyst Chess/Ptolemy/GSRC US Mail: 558 Cory Hall #1770
ph: 510.643.9841 fax:510.642.2739 Berkeley, CA 94720-1770
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480  (office: 400A Cory)




Hi,

I'm trying to plot a single point on XYPlotter. How can I control the width
of the point, so that I'll be able to view it?
It is also necessary for plotting a sequence of points, if the connected
variable is set to false.

Thanks,
Efrat


---
   -
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]


Re: icon editor

2003-09-24 Thread Edward A Lee
The icon editor is toast...

I've started working on a scheme that will allow for both editing
icons and decorating models with drawings, but I'm afraid that the
time I get to write software is so little that it may be months before
I finish this... :-(
Edward

At 01:37 PM 9/23/2003 -0700, Chad Berkley wrote:
Hi,

I read in the release notes of Ptolemy II 3.0.2 that the icon editor is 
not yet integrated, but I was was wondering if this also means that it 
does not work.  I've tried to run ptolemy.vergil.icon.IconEditor and it 
throws a NullPointerException around line 239 of IconEditor.  I followed 
up on the exception and it appears that there is a null PaintedList object 
being created around line 271 in IconEditorPane.java.  I can't figure out 
where this exception is coming from (I think it's an object in Diva) but I 
was wondering if this is a known problem or if I'm doing something 
wrong.  Should the iconEditor execute properly or is it a work-in-progress?

thanks,
chad
--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---

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

Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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


Re: diva source code of newest version

2003-09-23 Thread Christopher Hylands Brooks
Tristan Crecelius [EMAIL PROTECTED] writes:

 where can I find the newest source code of the diva lib.
 
 Last version used from Ptolemy is dated 21.04.2003 (diva.jar 1.035.788 
 Bytes)


I've created a snapshot of the Diva tree from April 22, 2003
and made it available on the Ptolemy II 3.0.2 source download page
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/index.htm

Both .tar.gz and zip files are available directly:
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/diva-22Apr03.tar.gz
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/diva-22Apr03.zip


It is not necessary to download the Diva source files to build
Ptolemy II, Ptolemy II includes diva.jar. Download the diva .tar.gz or
.zip if you are interested in extending the Ptolemy II GUI itself.

   1. Download either diva-22Apr03.tar.gz (1.8 Mb), or
  diva-22Apr03.zip (2.5Mb)
   2. Change to the Ptolemy II directory and uncompress them. For
  example:

  cd $PTII
  tar -zxf /tmp/diva-22Apr03.tar.gz

   3. Follow the instructions in $PTII/diva/README.txt 


Note that this diva snapshot will build a slightly smaller jar file
than what was shipped: 974201 bytes instead of 1035788 bytes.

One difference is that a few test directories are not included. 
There are minor differences in a few .class files as well.
I'm told that these primarily are caused by local variables being
renamed in the version of diva.jar that was shipped with Ptolemy II
3.0.2

Let me know if you have problems.

The diva home page is on
http://www.gigascale.org/diva
Note that the diva home page will move to
http://embedded.eecs.berkeley.edu/diva
at somepoint in the not to distant future. 

-Christopher

Christopher Hylands Brooks [EMAIL PROTECTED]  University of California
Programmer/Analyst Chess/Ptolemy/GSRC US Mail: 558 Cory Hall #1770
ph: 510.643.9841 fax:510.642.2739 Berkeley, CA 94720-1770
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480  (office: 400A Cory)



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


icon editor

2003-09-23 Thread Chad Berkley
Hi,

I read in the release notes of Ptolemy II 3.0.2 that the icon editor is 
not yet integrated, but I was was wondering if this also means that it 
does not work.  I've tried to run ptolemy.vergil.icon.IconEditor and it 
throws a NullPointerException around line 239 of IconEditor.  I followed 
up on the exception and it appears that there is a null PaintedList 
object being created around line 271 in IconEditorPane.java.  I can't 
figure out where this exception is coming from (I think it's an object 
in Diva) but I was wondering if this is a known problem or if I'm doing 
something wrong.  Should the iconEditor execute properly or is it a 
work-in-progress?

thanks,
chad
--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---

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


Re: icon editor

2003-09-23 Thread Stephen Andrew Neuendorffer
It sounds like you have a proof that it doesn't work! :)

In all seriousness, the Icon Editor was written quite a while ago and was 
never really useful enough to be used, even when it did run.

I think a better long term solution is to integrate one of the many 
SVG-creating graphics tools into Vergil and to use
an open source SVG library to paint the icons on the screen. Unfortunately,
this is probably going to be alot of work.  I have tried using XML-Batik 
for doing this, but it doesn't handle painting at arbitrary scaling 
terribly well: it is more oriented towards fixed-size image generation.

Currently you can rather easily replace the icon of an actor with a 
reference to a manually created gif image.
This is probably a much simpler approach at the moment.

Steve

At 01:37 PM 9/23/2003 -0700, Chad Berkley wrote:
Hi,

I read in the release notes of Ptolemy II 3.0.2 that the icon editor is 
not yet integrated, but I was was wondering if this also means that it 
does not work.  I've tried to run ptolemy.vergil.icon.IconEditor and it 
throws a NullPointerException around line 239 of IconEditor.  I followed 
up on the exception and it appears that there is a null PaintedList object 
being created around line 271 in IconEditorPane.java.  I can't figure out 
where this exception is coming from (I think it's an object in Diva) but I 
was wondering if this is a known problem or if I'm doing something 
wrong.  Should the iconEditor execute properly or is it a work-in-progress?

thanks,
chad
--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---

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]


Re: icon editor

2003-09-23 Thread Bertram Ludaescher


Another alternative that I've seen (thanks Efrat!) was a little bit of 
SVG embedded right in the Java code. So one can at least create the
SVG externally, then put it in somehow.

Don't know if that helps. If it does, Efrat could send the code snippet.

Bertram

 SAN == Stephen Andrew Neuendorffer [EMAIL PROTECTED] writes:
SAN 
SAN It sounds like you have a proof that it doesn't work! :)
SAN In all seriousness, the Icon Editor was written quite a while ago and was 
SAN never really useful enough to be used, even when it did run.
SAN 
SAN I think a better long term solution is to integrate one of the many 
SAN SVG-creating graphics tools into Vergil and to use
SAN an open source SVG library to paint the icons on the screen. Unfortunately,
SAN this is probably going to be alot of work.  I have tried using XML-Batik 
SAN for doing this, but it doesn't handle painting at arbitrary scaling 
SAN terribly well: it is more oriented towards fixed-size image generation.
SAN 
SAN Currently you can rather easily replace the icon of an actor with a 
SAN reference to a manually created gif image.
SAN This is probably a much simpler approach at the moment.
SAN 
SAN Steve
SAN 
SAN At 01:37 PM 9/23/2003 -0700, Chad Berkley wrote:
 Hi,
 
 I read in the release notes of Ptolemy II 3.0.2 that the icon editor is 
 not yet integrated, but I was was wondering if this also means that it 
 does not work.  I've tried to run ptolemy.vergil.icon.IconEditor and it 
 throws a NullPointerException around line 239 of IconEditor.  I followed 
 up on the exception and it appears that there is a null PaintedList object 
 being created around line 271 in IconEditorPane.java.  I can't figure out 
 where this exception is coming from (I think it's an object in Diva) but I 
 was wondering if this is a known problem or if I'm doing something 
 wrong.  Should the iconEditor execute properly or is it a work-in-progress?
 
 thanks,
 chad
 
 --
 ---
 Chad Berkley
 National Center for
 Ecological Analysis
 and Synthesis (NCEAS)
 [EMAIL PROTECTED]
 ---
 
 
 
 Posted to the ptolemy-hackers mailing list.  Please send administrative
 mail for this list to: [EMAIL PROTECTED]
SAN 
SAN 
SAN 
SAN 
SAN Posted to the ptolemy-hackers mailing list.  Please send administrative
SAN mail for this list to: [EMAIL PROTECTED]


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


Real life applications of Synchronous Data flow with cycles

2003-09-18 Thread Hiren

Hello, 

I am currently trying to understand the implementation of the SDF
domain. 

I am wondering if someone can provide me with a list of real-life SDF
examples that have cycles other than a simple source-sink cyclic
relationship. It is not difficult to see applications where
feedback-systems can be implemented in SDF, however what applications
are available that can have cycles other than simple feedback loops.
What applications exist that can use such a domain with that constraint?
I am aware that the user is to inject a token into the SDF actor to
inititate the director.

Your help is appreciated.

Thanks,

Hiren




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


problems rebuilding Ptolemy classic from scratch

2003-09-12 Thread rpintor

Hi again. Thanks all for your answers to my last question. i'm trying ti rebuild
from scratch Ptolemy classic 0.7.1. I am with linux debian 3.0 (woody).I use
bash, not cshell.

I got the sources to 0.7.1,, the tar-gz archives with the global src and
others. Then I untar the archives, in $PTOLEMY, and foollow the instructions
in the web page of Ptolemy project, doing make and make install. Then an error
happened, something related with Tycho. Perhaps I hasn't got Tcl/tk or something
about that.

Then, I do:

make everything

Now, I got an error related with xv. I suppose that I didn't finish my
installation or something doesn't work right, because when I try to start pigi
from $PTOLEMY/bin/pigi, it says that pigi.Rpc doesn't exists or is not prepared
to be executable.

I think I'm doing something wrong. Perphaps it would be easier if I get some
.deb files from ptolemy, but I don't know how to got them.

Can I receive some help? Thanks again and regards.


-
This mail sent through IMP: http://horde.org/imp/


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


Re: problems rebuilding Ptolemy classic from scratch

2003-09-12 Thread Christopher Hylands Brooks
I have some notes for compiling Ptolemy II 0.7.2 devel under Linux
at
http://ptolemy.eecs.berkeley.edu/ptolemyclassic/pt0.7.2/linux.htm

I'll see about adding a more prominent link to that page from 
the 0.7.1 page.

xv not compiling is fairly common, you can run without it.
xv is also available elsewhere.

If pigiRpc is not present, then you probably have a compilation
problem.
Try
cd $PTOLEMY
make  make.out

and then look in make.out for lines that contain three ***

-Christopher




Hi again. Thanks all for your answers to my last question. i'm trying ti re
   build
from scratch Ptolemy classic 0.7.1. I am with linux debian 3.0 (woody).I us
   e
bash, not cshell.

I got the sources to 0.7.1,, the tar-gz archives with the global src and
others. Then I untar the archives, in $PTOLEMY, and foollow the instructi
   ons
in the web page of Ptolemy project, doing make and make install. Then an er
   ror
happened, something related with Tycho. Perhaps I hasn't got Tcl/tk or some
   thing
about that.

Then, I do:

make everything

Now, I got an error related with xv. I suppose that I didn't finish my
installation or something doesn't work right, because when I try to start p
   igi
from $PTOLEMY/bin/pigi, it says that pigi.Rpc doesn't exists or is not prep
   ared
to be executable.

I think I'm doing something wrong. Perphaps it would be easier if I get som
   e
.deb files from ptolemy, but I don't know how to got them.

Can I receive some help? Thanks again and regards.


-
This mail sent through IMP: http://horde.org/imp/

---
   -
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]


Ptolemy II under debian woody

2003-09-10 Thread Raúl Pintor
Hi, I'm a student from Extremadura, Spain. I have tried to recompile 
everything to run Ptolemy II 3.0.2 in linux debian 3.0. I also got JDK 
1.4.1, but I think I'm not well configured in the Java enviroment. I use 
linux since 3 months. Then, my question is:

I would like to know what version of Ptolemy II is more stable or proved to 
start with it, or if the Ptolemy classic version is better for a new user 
like me.

I know is a very simple question but I also think that you (hackers) are 
the best people to answer me, I'm a little bit lost from the moment.

Thank you and sorry for my bad english. 


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


[no subject]

2003-09-05 Thread Darine Abdelahad

Hi,

I have a question:
I want the user to be able to click on a point on the graph in order to 
obtain more information about it. To do so, I need the mouse click to return 
the coordinates of the point.
So I tried to add to the Plot object an instance of a class that 
implements the MouseListener interface. And then in the mouseClicked function, 
the getX()and getY() methods of the MouseEvent are supposed to return the 
coordinates of the point where the user clicked. 
But these coordinates are given with respect to the window where the 
plot is found, whereas I need the coordinates with respect to the Xaxis and 
Yaxis of the plot (that is the coordinates assigned to the point by my 
application).
So I was wondering how I can obtain these coordinates upon a mouse click.

Can anyone help me with that?

Thanx







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


Re:

2003-09-05 Thread Christopher Hylands Brooks
Hmm, I thought I sent a reply to this earlier this week, see
below

 From: Christopher Hylands Brooks [EMAIL PROTECTED]
 To: Darine Abdelahad [EMAIL PROTECTED]
 Subject: Re: Ptplot mouse code
 Cc: [EMAIL PROTECTED]
 Date: Wed, 03 Sep 2003 09:04:41 -0700
 
 Take a look at the zoom code in PlotBox.java
 It converts from window coordinates to plot coordinates.
 
 See also
 
 http://ptolemy.eecs.berkeley.edu/java/ptplot5.2/ptolemy/plot/doc/ptplotfaq.htm#ptplot
  potential features
 
-Christopher





Hi,

I have a question:
I want the user to be able to click on a point on the graph in order to 
obtain more information about it. To do so, I need the mouse click to retur
   n 
the coordinates of the point.
So I tried to add to the Plot object an instance of a class that 
implements the MouseListener interface. And then in the mouseClicked functi
   on, 
the getX()and getY() methods of the MouseEvent are supposed to return the 
coordinates of the point where the user clicked. 
But these coordinates are given with respect to the window where the 
plot is found, whereas I need the coordinates with respect to the Xaxis and

Yaxis of the plot (that is the coordinates assigned to the point by my 
application).
So I was wondering how I can obtain these coordinates upon a mouse click.

Can anyone help me with that?

Thanx



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


Re: first day with ptolemyII

2003-09-03 Thread Christopher Hylands Brooks
In comp.soft-sys.ptolemy, cfk [EMAIL PROTECTED] writes:

 Well, let me answer my own question and pose the next one.
 
 It appears the webstart is an interactive demo only.

The Web Start version if fully functional with the exception
of the Jython actor, which uses some strange caching mechanism.
See below for details.

  So, I downloaded the java run-time environment and installed it. I now
 have in /usr/bin executables such as java, jar, javadoc and other
 somewhat familiar things (although its been a few years since I
 installed java). I also have a /usr/src/ptII3.0.2 directory and
 was able to './configure', 'make' and 'make install'. The first
 two completed with no errors, but 'make install' has troubles at
 the end with '/usr/bin/jar: invalid option -- i' and no rule to
 make target 'coding/condingConfig.jar' needed by 'docConfig.jar'.

I've seen this problem with Windows Cygwin jar before, where it is not
entirely compatible with the Sun jar.

Try putting the JDK bin in your path before /usr/bin.
I'll see about making a test for this in configure.

If you really want to use /usr/bin/jar, try editing 
$PTII/mk/ptcommon.mk and change
(cd $(PTJAR_TMPDIR); $(JAR) -cvf tmp.jar .; $(JAR) -i tmp.jar)
to
(cd $(PTJAR_TMPDIR); $(JAR) -cvf tmp.jar .)

in three places.

The -i option is used to generate an index for the jar file which
make applications and applets start faster.


 I added /usr/src/ptII3.0.2/bin to my path in .bashrc. I also added
 an export of PTII=/usr/src/ptII3.0.2. At this point, if I invoke
 vergil, I can see the error couldnt find 'java/lang/Object'. I
 have been here before and I think it is the lack of a setting for
 JAVAHOME and CLASSPATH. Unfortunately, I dont know where
 java/lang/Object is, so setting the CLASSPATH and JAVAHOME are
 mysterious right now.

Seems like your Java installation is broken and not finding
any the runtime jar file that contains java.lang.Object.

I don't have a good solution for this, I don't have a Linux machine in
front of me.

Under Solaris, Object.class can be found in: 

[EMAIL PROTECTED] 9% jar -tvf /opt/local/j2sdk1.4.1_02/jre/lib/rt.jar | grep 
java/lang/Object.class
  1428 Thu Feb 20 14:58:48 PST 2003 java/lang/Object.class
[EMAIL PROTECTED] 10% 

However, adding rt.jar to the classpath should not be necessary.

The way that I would proceed is to poke around on the
Sun tutorial and make sure that your JVM works

http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.htmld

Also, you should be able to start vergil by hand by including
lib/diva.jar 

Something like the following should work:

java -classpath ${PTII}:${PTII}/lib/diva.jar ptolemy.vergil.VergilApplication

 I am hoping that someone who uses java a bit more then I have over
 the last couple of years would consider helping me navigate this
 minefield a bit.

Yep, the classpath can be a bear.
 Charles
 
 At this point, I can navigate to /usr/src/ptII3.0.2/bin
 cfk [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Gentlemen:
   I downloaded the webstart and installed the ptolemyII 3.0.2
 application ion a RedHat8 system and am currently enjoying
 reading through the examples.  But, I am puzzled by a *real*
 newbie question. How do I get back to running the application
 when I exit it. At this point, I can see that it
 is running from a new .javaws directory and I can see http and
 lastAccessed in that directory. But what do I invoke to startup
 ptolemy when I exit and reboot the comptuer.

The Java Web Start Application Manager is a standalone application
that lists the Web Start applications that are available.

http://java.sun.com/j2se/1.4.2/docs/guide/jws/Readme.html#install

Under Windows, there is a standalone Java Web Start Application under
Start - All Programs - Java Web Start

Under Solaris (for me_, there is standalone Java Web Start Application zip
file installer at
/opt/local/j2sdk1.4.1_02/jre/javaws-1_2_0_02-solaris-sparc-i.zip

  For now, I'll leave it on for a few days until I figure it out.
 
  Guess everyone has to be a newbie at something on a regular
 basis in order to get anywhere.


-Christopher

Christopher Hylands Brooks [EMAIL PROTECTED]  University of California
Programmer/Analyst Chess/Ptolemy/GSRC US Mail: 558 Cory Hall #1770
ph: 510.643.9841 fax:510.642.2739 Berkeley, CA 94720-1770
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480  (office: 400A Cory)



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


setActions in FSM models

2003-08-28 Thread Michail Chavkin (sgraja)

Hi,

While in the setActions field of a transition in FSM models one can
use ahierarchical destination (like state.parameter or even
state.actor.parameter) it is impossible to use a hierarchical source.
Sometimes it just causes an
inconvinience of having a doubling parameter in the top model (i.e. it
is impossible to write state.parameter=state.parameter + 1, one ought to

have  Parameter in the top model, e.g. TopPar, first increment it,
TopPar=TopPar+1, and when set, state.parameter=TopPar).

But there are more serious drawbacks, because of this.
As an output of my SDF refinement all I needed was the final result of
the simultaion. I wanted to use a Recorder actor in that refinement to
be
able to access the final result in the top model by setting the source
in the
setActions field to be something like: state.Recorder.getLatest(0).
This does not work, the message I got was that state ID is not known.

Therefore I have two questions.

First, whether the possibility to use a
hierarchical source is going to be implemented. This was one of the
issues of a message sent to the list two years ago. You can find it here

http://groups.yahoo.com/group/ptolemy-hackers/message/1722

Second, maybe, somebody could
advice another way to get only the last result of a refinement (with an
SDF director in it with vectorization factor set not to 1)

Thanks,

Michail Chavkin







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


Re: Thank you!

2003-08-20 Thread cxh
--  Virus Warning Message (on relay2)

Found virus WORM_SOBIG.F in file document_9446.pif
The uncleanable file document_9446.pif is moved to /etc/iscan/virus/virLCBFcba1J.

-
See the attached file for details
--  Virus Warning Message (on relay2)

document_9446.pif is removed from here because it contains a virus.

-

Re: help me on image filtering

2003-08-18 Thread Christopher Hylands Brooks
On 7/23, in comp.soft-sys.ptolemy, Paul.Shumacher wrote: 

Hi,

I am new to Ptolemy so please forgive me if this question has been
raised already.
I am interested in doing various operations on 2-D images/frames.  For
example, using a
1-D FIR filter to smooth or find edges.  I have tried the ImageSequence
actor followed
by MatrixToSequence or ImagePartition, but I get the following error:

Conversion is not supported from ptolemy.data.IntToken '3' to the type
[int].

I am using Ptolemy II 3.0.  Any suggestions?


Well, you could use the new JAIEdgeDetection actor to do this, 
there is a test at

http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/ptII3.0-beta/ptolemy/actor/lib/jai/demo/test/JAIEdgeDetection.xml

If you install Ptolemy II 3.0 under Windows with the built in
JRE, the Java Advanced Imaging API will be included in the JRE.
If you are building from source, you would need to install
the Java Advanced Imaging API and rerun configure
cd $PTII
rm config.*; ./configure
cd ptolemy/actor/lib/jai
make

If you start up Ptolemy II 3.0 and do File - Open URL
and cut and paste the above URL in, the model will open for you.
You will need to change the JAIImageReader fileOrURL path
to an image on your local disk.

When you run the image, edge detection will occur.


The actors you refer to are part of the Vector Quantization
actors in sdf/lib/vq.  These actors are somewhat special purpose, see
the sdf/demo/HTVQ/HTVQ.xml demo for an example use.

You should be able to create a model that has

ImageSequence  -  ImagePartition  -  ImageDisplay 

1. ImageSequence reads in a series of images and outputs 
IntMatrices.

If you use it, you may need to change the imageURLTemplate
from
/ptolemy/domains/sdf/lib/vq/data/seq/missa/missa***.qcf
to
ptolemy/domains/sdf/lib/vq/data/seq/missa/missa***.qcf
(I fixed this in the release and development trees)

2. ImagePartition reads in IntegerMatrices, not integers, so this could
be part of the problem in your example

Change the partitionColumns to 88 and
the partitionRows to 72 

3.  Add a SDFDirector and set the iterations to 100

When you run it, the ImageDisplay should pop up.
You may need to mouse on the ImageDisplay actor to get it to display
each frame.


I think the problem you were having with
ImageSequence - MatrixToSequence - ImagePartition
is that ImagePartition expects an IntMatrix, not a sequence of
Integers.

You could do
ImageSequence - 
 MatrixToSequence - Quantizer - Round
   -SequenceToMatrix - ImageDisplay

1. ImageSequence needs the imageURLTemplate adjusted as per above.
2. In MatrixToSequence and SequenceToMatrix, set the rows to 144
and the columns to 176
4. Change the Quantizer to {-1.0, 40.0} to Quantize the values

-Christopher

Christopher Hylands Brooks [EMAIL PROTECTED]  University of California
Programmer/Analyst Chess/Ptolemy/GSRC US Mail: 558 Cory Hall #1770
ph: 510.643.9841 fax:510.642.2739 Berkeley, CA 94720-1770
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480  (office: 400A Cory)




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


Re: [Ptolemy] Re: The ID PI is undefined. in Ptolemy II 3.0-beta ...

2003-08-18 Thread Stephen Andrew Neuendorffer
Yes, this is a bug in the code generator that shipped with the beta.
It is likely that the final release will include a fix that allows 
constants (like PI) to be dealt with
correctly.

Note that for other reasons, the Butterfly demo will not generate usable 
code.  (Because the
plotter uses parts of Ptolemy II that are not initialized or understood by 
the code generator).
This is also something I'm working on, but it is unlikely that a fix will 
be included in the release.

Steve

At 04:04 PM 8/18/2003 -0700, Christopher Hylands Brooks wrote:
Sorry for the delay in getting back to you on this, I was
away on vacation
On 8/02, in comp.soft-sys.ptolemy, [EMAIL PROTECTED] (Long-Bao) wrote:

Hi, everyone:

I've encounterd the following exception
when I used code generator (for Java)
with the Demo Butterfly (or something else)
in SDF Domain:

Soot started on Sat Aug 02 21:58:46 CST 2003
WatchDogTimer.internalTransform(wjtp.watchDog, {time=60,
cancel=false})
ModelTransformer.internalTransform(wjtp.mt,
{targetPackage=ptolemy.copernicus.java.cg.Butterfly})
ModelTransformer: Creating actor class
ptolemy.copernicus.java.cg.Butterfly.CGRamp
for actor .Butterfly.Ramp
based on ptolemy.actor.lib.Ramp
ptolemy.kernel.util.IllegalActionException: The ID PI is undefined.
at 
ptolemy.copernicus.java.DataUtilities$ActorCodeGenerationScope.getType(DataUtilities.java:366)
at 
ptolemy.data.expr.ParseTreeTypeInference._getTypeForName(ParseTreeTypeInference.java:495)
at 
ptolemy.data.expr.ParseTreeTypeInference.visitLeafNode(ParseTreeTypeInference.java:303)
at ptolemy.data.expr.ASTPtLeafNode.visit(ASTPtLeafNode.java:115)
at 
ptolemy.data.expr.ParseTreeTypeInference._inferChild(ParseTreeTypeInference.java:536)
at 
ptolemy.data.expr.ParseTreeTypeInference._inferAllChildren(ParseTreeTypeInference.java:519)
at 
ptolemy.data.expr.ParseTreeTypeInference.visitProductNode(ParseTreeTypeInference.java:400)
at 
ptolemy.data.expr.ASTPtProductNode.visit(ASTPtProductNode.java:124)
at 
ptolemy.data.expr.ParseTreeTypeInference.inferTypes(ParseTreeTypeInference.java:78)
at 
ptolemy.copernicus.java.ParseTreeCodeGenerator.generateCode(ParseTreeCodeGenerator.java:74)
at 
ptolemy.copernicus.java.DataUtilities.generateExpressionCodeBefore(DataUtilities.java:184)
at 
ptolemy.copernicus.java.ModelTransformer.computeAttributesBefore(ModelTransformer.java:185)
at 
ptolemy.copernicus.java.GenericAtomicActorCreator.createAtomicActor(GenericAtomicActorCreator.java:196)
at 
ptolemy.copernicus.java.ModelTransformer._createActorsIn(ModelTransformer.java:1462)
at 
ptolemy.copernicus.java.ModelTransformer._createCompositeActor(ModelTransformer.java:1493)
at 
ptolemy.copernicus.java.ModelTransformer.internalTransform(ModelTransformer.java:914)
at soot.SceneTransformer.transform(SceneTransformer.java:46)
at soot.Pack.apply(Pack.java:79)
at soot.Main.run(Main.java:1649)
at 
ptolemy.copernicus.kernel.KernelMain.generateCode(KernelMain.java:17
   5)
at ptolemy.copernicus.java.Main.main(Main.java:450)
Code generation of 
'jar:file:/C:/Ptolemy/Ptolemy_II_3.0-beta/ptolemy/domain
   s/sdf/demo/demo.jar!/ptolemy/domains/sdf/demo/Butterfly/Butterfly.xml'
failed:
java.lang.RuntimeException:
ptolemy.kernel.util.IllegalActionException: The ID PI is undefined.
at 
ptolemy.copernicus.java.DataUtilities.generateExpressionCodeBefore(DataUtilities.java:188)
at 
ptolemy.copernicus.java.ModelTransformer.computeAttributesBefore(ModelTransformer.java:185)
at 
ptolemy.copernicus.java.GenericAtomicActorCreator.createAtomicActor(GenericAtomicActorCreator.java:196)
at 
ptolemy.copernicus.java.ModelTransformer._createActorsIn(ModelTransformer.java:1462)
at 
ptolemy.copernicus.java.ModelTransformer._createCompositeActor(ModelTransformer.java:1493)
at 
ptolemy.copernicus.java.ModelTransformer.internalTransform(ModelTransformer.java:914)
at soot.SceneTransformer.transform(SceneTransformer.java:46)
at soot.Pack.apply(Pack.java:79)
at soot.Main.run(Main.java:1649)
at 
ptolemy.copernicus.kernel.KernelMain.generateCode(KernelMain.java:175)
at ptolemy.copernicus.java.Main.main(Main.java:450)
WARNING: Default charset MS950 not supported, using ISO-8859-1 instead
All Done.


Have anyone met the same problem as me ??
Or I've done something wrong??
I'm using Ptolemy II Windows executable file that includes JVM
on Windows XP Professional SP1 and Compaq Presario 1500.
How to overcome it???

Thans a lot!!!

Long-Bao

I see the same problem in Ptolemy 3.0-beta in the Windows prebuilt
executable and in a 3.0-beta binary built from scratch.
I think the problem is the Expression actor.  Generating code for

Re: dynamically reloading the treeview in vergil

2003-08-14 Thread Chad Berkley
Hi Edward,

Ok, so I understand in general what you are saying but I'm not 
understanding the implementation details.  I have created a new Tableau 
NewActorWizardTableau that extends Tableau.  Whithin the construtor, I 
am able to call topEffigy() from the NewActorWizardTableau's container 
(which is passed in via the constructor).  I have the effigy of the top 
level object, but I can't find any way to actually add a new actor to 
it.  Here's the code of my constructor:

public NewActorWizardTableau(PtolemyEffigy container, String name)
throws IllegalActionException, NameDuplicationException
  {
super(container, name);
Effigy e = container.topEffigy();
Container parent = e.showTableaux().getFrame();
NewActorFrame NAFrame = new NewActorFrame(parent);
NAFrame.setBackground(BACKGROUND_COLOR);
setFrame(NAFrame);
  }
So, my question is: now that I have the top level effigy (Effigy e), how 
do I add my new actor to the model?  I'm still a little foggy on the 
concepts of the Effigys and Tableaus so please forgive any details that 
I'm overlooking.

thanks,
chad
Edward A Lee wrote:
Are you referring to the actor library when you say tree view?
The actor library is a Ptolemy model like any other (see the
ptolemy.actor.gui package ... An instance Configuration, which
is a CompositeEntity, contains the library).  If you add the actors
to the model (as opposed to just adding them to the XML file),
then they will appear in the tree view.
Edward Lee

At 10:09 AM 8/7/2003 -0700, Chad Berkley wrote:

Hello,

I'm working on a project in which I am writing out and compiling actors
dynamically at runtime.  I would like these actors to then show up in
the treeview on the left side of Vergil but it seems that it only reads
the MoML file once.  Does anyone know a way to force the tree to reread
the MoML file or is there a better way to do this?  I am basically
adding an entity line to a MoML file for each actor that I dynamically
generate.  If I restart Vergil, the new actors show up but I would
rather them be added at runtime.
Any help would be appreciated.  I searched the archive for matters such
as this and didn't find much.  If this has already been discussed
before, please just point me in the direction of the thread.
Thanks,
Chad Berkley
--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---




-
This mail sent through IMP: http://horde.org/imp/
 

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



Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal
 

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


--
---
Chad Berkley
National Center for
Ecological Analysis
and Synthesis (NCEAS)
[EMAIL PROTECTED]
---

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


  1   2   3   4   5   6   >