[kepler-dev] Map / Dictionary Actor
Dan Higgins
higgins at nceas.ucsb.edu
Fri Mar 7 11:55:17 PST 2008
Hi Ian,
I do not know of an actor that does exactly what you describe.
However, it struck me that the Ptolemy 'record' data type is basically
just a HashMap/Dictionary. And the RecordUpdater actor does let you
build/extend a record (i.e. a Dictionary). Note also that there is a
'get' method in the RecordToken object that allows one to search a
record by key. So, in any case, you might want to consider using a
'record' in building a Dictionary actor.
Dan Higgins
----
ian.brown at hsbcib.com wrote:
>
> I'm looking for something like a HashMap or Dictionary Actor and,
> before implementing one myself, wanted to check that one does not
> already exist that I have simply overlooked.
> The issue is as follows - from a file or a database, I need to read a
> list of Instrument, Pair sizes. For example, if I want to buy 50 Euros
> and 20 pounds, I may get the following as input:
>
> EUR, 50
> GBP, 20
>
> Once I have read this data, I want to be able to request what the size
> of EUR should be (in this case 50). This is very similar to the Lookup
> Actor except that we're looking up based on a key rather than on an
> index. It's a typical HashMap.
>
> I would envisage an actor with 3 input ports and 2 output ports as
> follows:
>
> inputs:
>
> -> set_key_in
> -> set_val_in
> -> query_key_in
>
> output:
>
> <- key_out
> <- val_out
>
> set_key_in, set_val_in are used to populate the HashMap with key,
> value pairs.
>
> a token on query_key_in will look up an entry in the HashMap and
> output the result to the output ports. An additional output port could
> give a boolean signal if there was no such entry.
>
> Another boolean input could be used to flush all of the contained
> entries to the output as a sequence of tokens (SequenceToArray could
> then package these into an array or a RecordAssembler could package
> them into records).
>
> Does such an actor already exist? If not, does the above sound like a
> sensible implementation?
>
> Ian
>
> ************************************************************
> HSBC Bank plc may be solicited in the course of its placement efforts
> for a new issue, by investment clients of the firm for whom the Bank
> as a firm already provides other services. It may equally decide to
> allocate to its own proprietary book or with an associate of HSBC
> Group. This represents a potential conflict of interest. HSBC Bank plc
> has internal arrangements designed to ensure that the firm would give
> unbiased and full advice to the corporate finance client about the
> valuation and pricing of the offering as well as internal systems,
> controls and procedures to identify and manage conflicts of interest.
>
> HSBC Bank plc
> Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
> Registered in England - Number 14259
> Authorised and regulated by the Financial Services Authority.
> ************************************************************
> ------------------------------------------------------------------------
>
> *SAVE PAPER - THINK BEFORE YOU PRINT! This transmission has been
> issued by a member of the HSBC Group "HSBC" for the information of the
> addressee only and should not be reproduced and/or distributed to any
> other person. Each page attached hereto must be read in conjunction
> with any disclaimer which forms part of it. Unless otherwise stated,
> this transmission is neither an offer nor the solicitation of an offer
> to sell or purchase any investment. Its contents are based on
> information obtained from sources believed to be reliable but HSBC
> makes no representation and accepts no responsibility or liability as
> to its completeness or accuracy. *
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at ecoinformatics.org
> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>
More information about the Kepler-dev
mailing list