void HIVSimpleDiagnostic::Update( float dt ) { bool cascade_state_ok = UpdateCascade(); if( !cascade_state_ok ) { // the cascadeState must be an abort state return ; } if( firstUpdate ) { result_of_positive_test = positiveTestResult() ; } else { // ------------------------------------------------------------------------------ // --- Count down the time until a positive test result comes back // --- Update() is called the same day as Distribute() so we don't want // --- to decrement the counter until the next day. // ------------------------------------------------------------------------------ days_to_diagnosis -= dt; } ActOnResultsIfTime(); firstUpdate = false; }
void HIVSimpleDiagnostic::Update( float dt ) { if( !UpdateIndividualsInterventionStatus() ) return; // Why is this different from base class behaviour? In which Distribute can call postiiveTestResult. if( firstUpdate ) { result_of_positive_test = positiveTestResult() ; } // ------------------------------------------------------------------------------ // --- Count down the time until a positive test result comes back // --- Update() is called the same day as Distribute() so we don't want // --- to decrement the counter until the next day. // Update: NOTE TRUE ANYMORE. CountdownTimer doesn't call callback same day as going <= 0 // ------------------------------------------------------------------------------ days_to_diagnosis.Decrement( dt ); firstUpdate = false; }