Print

Print


Hi Sean,
okay, I converted now one of my simulations to run with ParallelSequence
and basically I can say:

It runs, but the single threaded version is twice as fast as the version
with four threads ! :-(
Maybe that's because I have many removals and insertions of agents. I
don't now.
I used setUsesSets(true), which makes things faster, but not as fast as
the single threaded version.

While doing this I also discovered a bug in loadStepsSet() of Sequence.
At the end of the method the line
steps = (Steppable[]) (stepsHash.toArray(steps));
has to be changed to something like
steps = (Steppable[]) (stepsHash.toArray(Arrays.copyOfRange(steps, 0, 1)));
because we must make sure that the size of the passed Steppable[] is
smaller than the number of elements in stepsHash, otherwise the length
of the new steps is wrong. What a mad behaviour of toArray()  !!

Anyway, I think for the future I will stick to single threaded
simulations :-)

axel