Examples of the possible end results of the individual-based simulations of evolution of the specialization coefficient a, the genetic habitat preference g and the learning ability l. The darkness of the squares indicates the number of individuals with different values of a, g and l at a particular time (a white square means that no individuals of that type are present). (a) Evolution to specialists preferring habitat A (kc=10, σ2=0.20, c=0.04); (b) evolution to generalists without habitat preference (kc=10, σ2=0.25, c=0.08); (c) speciation through a genetic habitat preference (kc=5, σ2=0.18, c=0.05); (d) speciation through a learned habitat preference (kc=10, σ2=0.18, c=0); (e) speciation through a combination of genetic and learned habitat preference (kc=10, σ2=0.21, c=0.04); (f) polymorphism in a and g (kc=10, σ2=0.21, c=0.07). Other parameters: K=400, E=10, ϕ=1, ka=16, kg=16, kl=16. The linkage scheme used in these examples was ‘predetermined linkage’ (explanation in model description).