This also involved, as a test driver, the first time I've run a Java programQuote:> I just got my StarLogo-language permutation generator,
> originally ported by me from Fortran 66 code, ported
> to Java. Whee! Since I _still_ cannot figure out
> how the algorithm works (though I'm getting closer
> with each port), this acts as proof of concept that all
> computer languages are essentially interchangable.
all of whose code was written by me. I still couldn't put an applet together to
run in a browser window, but I'm getting closer.
The permutor I ported is data dependent, it will permute _exactly_ the integers
from 1 to N, and return all N! permutations, one per call (can you guess how
much easier this is in Java, where objects can have state, than it was in the
original Fortran 66 version), but will not, for example, permute an array
containing the integers 0 to N-1 correctly, so I permute the former, then
reduce each entry by one to use the latter as indirect indices into the data I
_really_ want to permute, an arbitrary set of indices of cities in a Traveling
Salesman problem genome representing some subset of all the cities, that I want
to permute in all possible orders.
That data dependence is, sooner or later, going to force me to figure out how
the algorithm works (the breakage in shifting origins is obvious, it does some
modulus 2 arithmetic with the data values), so that I can make it work faster.
This goal, in turn, is subordinate to that of adding heuristics to Scott Robert
Ladd's Traveller applet. Permutation heuristics are interesting because they
can be arbitrarily "powerful" in a sense I haven't yet defined precisely,
depending on how many cities, or sublists of cities, join in the permutation,
and help genetic algorithms break log-jam points where to get from *here* to
*there* involves a lot of changes at once, with no obvious fitness-increasing
path that takes those changes one by one.
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG