colinsheppard / instream-sd

InSTREAM SD
0 stars 2 forks source link

verify timeTillDaytimeStarts is correct #1

Closed colinsheppard closed 11 years ago

colinsheppard commented 11 years ago

in UTMTroutModelSwarm.m I had to rework the following code to make it draw on SolarManager instead of the original. Make sure we're ending up with the same values.

timeTillDaytimeStarts = modelTime - [timeManager getTimeTWithDate: [timeManager getDateWithTimeT: modelTime] withHour: (int) [SolarManager getSunriseHour] withMinute: (int) [SolarManager getSunriseHour]*60 withSecond: 0];

colinsheppard commented 11 years ago

Same for UTMHabitataSpace.m :: shouldFishMoveAt: I changed the following:

if( (daytimeStartTime <= theCurrentTime) && (daytimeEndTime > theCurrentTime)) ... if(daytimeEndTime <= theCurrentTime)

To the following:

      if(   ([solarManager getDawnHour] <= [timeManager getHourWithTimeT: theCurrentTime]) 
         && ([solarManager getDuskHour] > [timeManager getHourWithTimeT: theCurrentTime]))

... if([solarManager getDuskHour] <= [timeManager getHourWithTimeT: theCurrentTime])

colinsheppard commented 11 years ago

Steve, the new code will probably flip things from day to night at the begging of the dawn hour, not necessarily at the moment dawn occurs. Is this ok? Otherwise I might have to added a method to SolarManager to give us the actual time_t instead of the hour.