Re: What tool should I use ? More info
- From: Jacquelin Hardy <jachardy@xxxxxxxxxxxx>
- Date: Fri, 08 Aug 2008 20:08:21 -0400
> 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
- References:
- What tool should I use ?
- From: epilot10
- Re: What tool should I use ?
- From: Larry Serflaten
- Re: What tool should I use ? More info
- From: Jacquelin Hardy
- Re: What tool should I use ? More info
- From: Larry Serflaten
- What tool should I use ?
- Prev by Date: Re: Inno Next Step
- Next by Date: Re: Inno Next Step
- Previous by thread: Re: What tool should I use ? More info
- Next by thread: Concurrent Versions System (CVS)
- Index(es):
Relevant Pages
|