sorting failed error

monarch_dodra monarchdodra at gmail.com
Mon Jul 30 13:29:56 PDT 2012


On Monday, 30 July 2012 at 20:01:59 UTC, maarten van damme wrote:
> Great, with that workaround everything works correctly now.
>
> I can finally start playing around with my salesman's dna :p
>
> There is one little problem left, the comparing problem. I can't
> really define an opcmp because a city isn't smaller or bigger 
> than
> another city, it's simply another city. I tried defining 
> opEquals but
> it still refuses to work (could be a problem on my end though).

Why do you want to sort the cities?

you need to define an opCmp to do that (not opEquals).

While you *can* deterministically sort the cities using an 
arbitrary norm (eg Manhattan distance), the end result will be 
mostly an artificial ordering.
http://en.wikipedia.org/wiki/Manhattan_distance


More information about the Digitalmars-d-learn mailing list