colinsheppard/insalmo — Issue #80: Let new spawners pick bad cells if they have to.
Author: SFRailsback
Created: 2011-12-13 23:40:05+00:00
State: open

In TroutModelSwarm - moveSpawnersToLiveFish is this code:

// if([fishCell getPolyCellDepth] <= 0.0)
if([fishCell getPolyCellDepth] <= ([aSpawner getFishLength] / 2)){
fishCell = (FishCell *) nil;
continue;
}

It causes an endless loop if no cell meets the depth criterion. Add some logic to stop after 100 tries or so and take any cell with depth > zero. (There is an example when initial fish are created in the trout model.)