Individuals migrate to exploit heterogeneities between spatially separated environments to modulate growth, survival, or reproduction. We devised a bioenergetics model to investigate the evolution of migration distance and its dependence on individual states. Atlantic cod Gadus morhua ranges from sedentary populations to stocks that migrate several thousand kilometers annually. We focused on the Northeast Arctic cod stock, which migrates south to spawn. A linear relationship between migration distance and the expected survival of offspring was assumed, here understood as the prospects for future survival and development that a fertilized egg faces at a particular spawning location. Reasons for why it may increase southward include warmer water that increases development rates, and thereby survival, along the pelagic drift trajectory. In the model, ingested energy can either be allocated to growth or stored for migration and reproduction. When migrating, individuals forgo foraging opportunities and expend energy. Optimal energy allocation and migration strategies were found using state-dependent optimization, with body length, age, condition, and current food availability as individual states. For both a historical and contemporary fishing regime we modeled two behaviors: (1) homing cod returning to the same spawning site each year and (2) roaming cod with no such constraints. The model predicted distinct regions of locally high spawning stock biomass. Large individuals in good condition migrated farthest, and these also tended to mature later in life. The roaming cod spread farther south as they grew larger and older. Homing cod did not have this freedom, and spawning was generally concentrated along a narrower stretch of the coastline. Under contemporary fishing, individuals matured earlier at a smaller size, had shorter migrations, spawned over a contracted geographical range, and tended to be in poorer condition. The effects were most pronounced for the homing behavior.