[kepler-dev] creating new data type

turuncu@be.itu.edu.tr turuncu at be.itu.edu.tr
Tue Nov 6 11:10:52 PST 2007


Hi,

I try to create a group of actors that could handle earth system science
related process (such as, data conversions, reading and writing specific
file formats, interpolations between different grids).

Sorry but i don't have any UML diagrams but i could give information about
the requirements and my design. First of all, i am reading a structured
binary file that contains data and metadata.

--- data class ---
public class MM5v3Data extends MM5v3Metadata {
    public float[][][] var;
    int im, jm, km, lm;

    public MM5v3Data(int[] dims) {
           super(dims);

           // allocate variable
           jm = dims[0];
           im = dims[1];
           km = dims[2];
           lm = dims[3];
           var = new float[im][jm][km];
    }
    ...
    ...
    ...

--- metadata class ---
public class MM5v3Data extends MM5v3Metadata {
    public float[][][] var;
    int im, jm, km, lm;

    public MM5v3Data(int[] dims) {
           super(dims);

           // allocate variable
           jm = dims[0];
           im = dims[1];
           km = dims[2];
           lm = dims[3];
           var = new float[im][jm][km];
    }
    ...
    ...
    ...

I have just put the main part of the classes and they are also have some
methods (data read, set and get methods etc.). I don't know how can i
apply the ptolemy/kepler type lattice into my design. Is it necessary to
use kepler types incase of int, float or String type?

Thanks for your help,

--ufuk
--http://kullanici.be.itu.edu.tr/~turuncu/



> Hi Ufuk,
>
> As a short term solution, you should be able to pass any data structure
> using the type 'object'.  The passing and receiving actors have to
> 'know' that they will be able to process the right object ... in
> particular, the receiver will have to cast the Java Object that it
> receives to a class of the right type that it expects.
>
> The longer term solution is indeed to add a new data type, which
> requires creating the proper token and type subclasses and extending the
> Lattice class to show the allowable conversions.
>
> Your idea of passing metadata along with a data object is one that we
> are pursuing as well.  We would like to extend the EMLDataSource actor
> and other data source actors to pass along metadata with their data
> tokens, probably as a reference to another data structure (i.e., not
> stored directly within the Token).  We're hoping this will be something
> we can generalize across all of the tokens that are passed in the
> system.  It would be useful to know how you are architecting your
> solution.  Do you have a UML diagram or other design specs you could
> share with us?  Thanks.
>
> Matt
>
> [BE] Ufuk Utku Turuncoglu wrote:
>> Hi,
>>
>> I try to create some actor that will pass and get custom data type along
>> it's ports. The data type contains data and it's metadata. For example,
>> metadata could be include name, description, number of dimensions,
>> coordinate variables (latitude, longitude etc.) and other informations
>> that is related with data.
>>
>> I create two level data type class, the first level holds metadata and
>> second one holds data. So, data extents the metadata and now, i could
>> create a variable which holds it's metadata. In this case, ithink, i
>> have to define this type in pyolemy/kepler as a known data type. When
>> using created data type in port definition section (setTypeEquals), it
>> gives me error messages.
>>
>> Is it possible to use custom user defined data type in actors and it's
>> ports? What is the problem in my case? I you want to get detailed
>> information, please let me know.
>>
>> Best wishes,
>>
>> --ufuk
>> _______________________________________________
>> Kepler-dev mailing list
>> Kepler-dev at ecoinformatics.org
>> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Matthew B. Jones
> Director of Informatics Research and Development
> National Center for Ecological Analysis and Synthesis (NCEAS)
> UC Santa Barbara
> jones at nceas.ucsb.edu                       Ph: 1-907-523-1960
> http://www.nceas.ucsb.edu/ecoinfo
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>




More information about the Kepler-dev mailing list