[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
List transfer between objects
From: |
Konrad Richter |
Subject: |
List transfer between objects |
Date: |
Wed, 01 Mar 2000 19:36:26 +0100 |
Hi, all!
As an exercise I am trying to program the travelling salesman problem
in Swarm. To this end, I create a chromosomeList in modelSwarm, where the
entries in the list -the Chromosomes- are endowed with an ID and aGenelist
that represents the order in which the salesmans path connects the cities.
In modelSwarm I have a routine that sorts out the
ten best Chromosomes of the chromosomeList with respect to minimization
of the path length. Then I delete the rest of the list and add mutations
of these best Chromosomes at the end of the list. When I print the
geneLists of these Chromosomes at the very moment where they are added
to the end of chromosomeList, they are all different. However - and here
comes my problem - when I look at the chromosomeList after
I have added all the mutated chromosomes, all the chromosomes have exactly
the same geneList.
Now, here comes my question: Is there something that I ought to know
about how to pass lists between objects? Is there some difficulty with
lists of objects that themselfes contain lists? It seems to me that I have
some "local" geneList inside modelSwarm and that the geneList is not part
of the object "Chromosome". Do I have to work with pointers in order to
pass these lists correctly?
I hope that you have mercy on someone who has been stepping on the same
place for the last week or so and hope that you can help me with this.
Many thanks in advance,
Konrad
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to
with "help" in the body of the message.
- List transfer between objects,
Konrad Richter <=