Technical description of Altruist program
Instructions
You don't have to understand the technical details in order to use the program. Just start the program and use the help facilities. See download instructions.
Output options
The program has several options for graphic representations of what happens during a simulation, as well as options for output to data files.
Options for multiple simulations
The program has several options for doing series of simulations when you want to sweep one or more parameters through a range of values. The program can do simple statistical calculations on such parameter sweeps. It is possible to set an unlimited number of simulation jobs in queue so that the computer is kept busy for a long time without needing human attention.
Program structure
The Altruist program contains three main parts
- main program
- model codes in dynamic link libraries (DLL)
- function library
The main program contains the user interface, run control, statistics, etc. Each model DLL contains executable code defining the algorithm for a specific simulation model. There is one model DLL for each simulation model, and you can make your own simulation models by compiling new model DLLs. The main program is designed so flexible that it doesn't have to be recompiled to make it accept a new model. The function library, containing random number generators and other functions, is called by the model DLLs using static linking.
Uniform and non-uniform random number generators
The Altruist program uses a combined random number generator of very high quality. See my page on random number generators. All random events are simulated on the basis of this generator.
A library of non-uniform random number generators makes it possible to simulate events with many different probability distributions. This static link library is used by the model DLLs. This library includes various distributions such as normal, binomial, poisson, hypergeometric, etc.
Optimization techniques
Complicated simulations may be very time consuming. Therefore, I have used various approaches to speed up the calculations:
- Calculations are done at the deme level. The program doesn't keep track of the fate of individuals, but only the number of each gene in each deme, and in some models the number of each genotype. Mutation, drift, migration, selection, growth, etc. are simulated based on the non-uniform random number generator library.
- Each model is compiled into executable code in a separate DLL for the sake of speed and flexibility. The price you have to pay for this is that you need a compiler to make new models.
- Library functions coded in assembly language. The random generator functions and other particularly time-consuming functions are coded in assembly language, using the most advanced optimization techniques (See my page on optimization). Several functions are coded in different versions, each optimized for a particular microprocessor. The program automatically selects the appropriate version (It has been verified that the different versions give the same result).
Compiler support
The model DLL's are written in C++ language. The model code and function library has support for almost all common compilers for 32-bit Windows. The main program can only be compiled with the Borland compiler.
Altruist version history
version number | date | operating system | technical changes | model changes |
unpublished | 1990-1993 | DOS 3 | Limited by system constraints | Island, endogamy, conformity, and a now obsolete model where four alleles at altruism locus have different mutation rates. |
1.00 | 1995 | Windows 3.1 | Improved user interface. Models in separate DLL's | Epistasis model with 2 and 3 loci. |
2.00 | 1997 | Windows 95 | Improved 32-bit code. Improved random number generator. | |
2.01 | 1999-12-19 | Windows 95 |
Source code published. Various errors fixed. |
Haystack model. Group territoriality model. |
2.02 | 2000-02-19 | Windows 95 | Minor improvements in main program. Terri model optimized for speed. Better handling of enclaves in terri model. | Formula in terri model changed. |
2.03 | 2000-04-17 | Windows 95 | Minor improvements in main. | More options and minor change in island model. |
2.04 | 2001-01-06 | Windows 95 | Minor bug fix. |
A new version is planned, but it will take some time before it is finished.
Speed history
microprocessor | clock frequency, MHz | program version | relative speed |
8088 | 8 | 0.00 | 1 |
8088+8087 | 8 | 0.00 | 16 |
80286+80287 | 10 | 0.00 | 25 |
80386SX+80387SX | 16 | 1.00 | 65 |
80386DX+80387DX | 25 | 1.00 | 100 |
80486DX | 33 | 1.00 | 380 |
80486DX4 | 100 | 1.00 | 1000 |
Pentium | 100 | 2.01 | 1800 |
Pentium MMX | 200 | 2.01 | 4300 |
Pentium II | 400 | 2.01 | 9000 |
Pentium III | 550 | 2.02 | 13000 |
As the table shows, the speed of calculation is very sensitive to the type of microprocessor, since the calculations are very processor-intensive. All versions use microprocessor-specific methods for optimizing speed.