I have kind of a general question, and please forgive
me if it is inappropriate.  I use BASIC extensively
for simulation of ecological systems, mainly because I
learned it when I was 10 and never bothered to switch.

Recently I was exposed to OOP and its possible uses in
simulating population ecology, and now want to
"upgrade" my programming abilities by learning a new
language.  I have, however, relatively little time to
try out many languages (my day job interferes), and so
thought I might save time by describing to the
"experts" exactly what I want to do, and whether they
think Ruby is going to accomplish what I want.

Basically, I simulate the population ecology of
wildlife disease.  Whether an animal gets a disease or
not, and then the progression of the disease once
infected, is a function of a number of attributes of
that individual.  OOP seems perfect for this task, as
each individual would be an object, with "attributes"
(sex, age, immune status, presence or absence of
disease etc.) and "behaviours" (give birth, die,
become infected, migrate etc.).  From my preliminary
reading of Ruby this would seem pretty straight
forward.

The problem I forsee is that the objects would have to
be stored in a "vector" or "array" (I think the C++
terminology would be containers?).  Each time step
(e.g., one year), I would iterate through the vector
"killing" some animals (thus the vector or array of
objects would contract), and then have the survivors
"give birth" (thus the vector would expand). 
Therefore, the framework that I store the objects
would have to shrink and expand dynamically as the
population changes.  An alternative would be to have a
really long vector or array that never has any chance
of filling up, but this seems to me to be a waste of
memory.

I'm not looking for a "how-to-do-this" in any specific
way type of answer, but rather if this dynamic array
or vector is possible in Ruby.  I have a friend who
programs in C and is learning C++ and he is having a
heck of a time figuring this out.

Any advice would be greatly appreciated,

Damien

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/