Re: What tool should I use ? More info

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




> In summary, I'd prefer to use classes in place of UDT's, and a
> doubley linked list in place of a collection. Sorting would be achieved
> by maintaining the list in sorted order at all times, using a smart
> re-placement routine when sorted values change.


Many thanks for your advices Larry, I will concentrate on that.

Regards

Jacquelin H.

________________________________________________________________________

Larry Serflaten a écrit :
"Jacquelin Hardy" <jachardy@xxxxxxxxxxxx> wrote

the informations that are get thru AIS (info transmitted thru VHF and
then transformed to 6bit encapsulated data are stored in my software in
UDTs like so:

<... snipped for breivity >

I still would look first at a collection of classes. Any values that are
calculated can be coded within the class as (read only?) properties,
thereby delaying those calculations until they are actually needed
using data that is current at that moment.

Moving UDT's around in an array will force the entire set of data to
be moved while moving references in and out of a collection touches
less data. If you're familiar with a doubley-linked list, that would
offer sorting improvement over trying to sort a collection. Indirect
indexing could eliminate moving the entire UDT about in an array,
at the cost of more complexity.

In any case, you very possibly want the list sorted at all times, so
how about doing a little work on an as-needed basis rather than
a complete sort of an entire structure.

If for example, every time you recieve data from a ship, and that
data changes a value you are using in your sorts, you could remove
that specific ship from the list and place it back in its properly sorted
order. If you sort them by their range to target, then no ship
(in a large group) is likey to change position in the list by more than a
few positions, and you could use that knowlege to focus the new
position sort to an area surrounding the position it was at originally.
Sort of a smart sort algorithm. You might also use that opportunity
update a display for that specific ship, rather than try to run a periodic
routine to display them all. Again, code in the class could be put to use
there to make that a bit easier to work with....

In summary, I'd prefer to use classes in place of UDT's, and a
doubley linked list in place of a collection. Sorting would be achieved
by maintaining the list in sorted order at all times, using a smart
re-placement routine when sorted values change.


LFS


.



Relevant Pages

  • Re: What tool should I use ? More info
    ... Every time I receive info from a specific ship, her info or some of her ... Some of the fields in the UDT are ... best sorting tool for multiple sorting ... offer sorting improvement over trying to sort a collection. ...
    (microsoft.public.vb.general.discussion)
  • Re: A Fast sorting algorithm for almost sorted data
    ... far my compressor has potential but is nowhere near ready. ... It does however make heavy use of sorting. ... which I am currently calling Run sort. ... entire selected run can be added to the sorted output array. ...
    (comp.compression)
  • Re: Solution for sorting an array alpha-numerically
    ... strings up into groups and sorting the groups seperately, ... > so that numeric and alphabetic data sort as seperate groups. ... To the same project as the web page, add the class AlphaNumCompare() ...
    (microsoft.public.dotnet.general)
  • Re: how fast can I sort on mainframe (using DFSORT)?
    ... Since I joined the team as the performance lead a couple years ago, ... Frank now defers these types of questions to me. ... I have been out of the sorting business for a while, ... Writing to sort work files should not be the problem, ...
    (bit.listserv.ibm-main)
  • Re: When random isnt random
    ... >> (and, if there is not one already, a Sorting Unit). ... TList has a Sort method. ... Try it with a TList and in the compare function ... There seems to be, sometimes, a requirement for a Shuffle that leaves ...
    (borland.public.delphi.language.objectpascal)