Skip to content

Commit

Permalink
Only do value iteration when mulling send
Browse files Browse the repository at this point in the history
  • Loading branch information
keithw committed Dec 5, 2011
1 parent fe2dd0a commit fcf7361
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion isender.cpp
Expand Up @@ -82,6 +82,7 @@ void ISender<ChannelType>::wakeup( void )
value_experiment();

if ( current_time == next_send_time ) {
vi.value_iterate();
if ( vi.should_i_send( prior ) ) {
sendout( Packet( 12000, id, 0, current_time ) );
}
Expand Down Expand Up @@ -161,6 +162,5 @@ void ISender<ChannelType>::value_experiment( void )
}
vi.add_state( prior.get_channel( i ).channel );
vi.rationalize();
vi.value_iterate();
}
}
2 changes: 1 addition & 1 deletion value_iterator.cpp
Expand Up @@ -198,7 +198,7 @@ bool ValueIterator<ChannelType>::should_i_send( const EnsembleContainer<ChannelT
nosend_value += ensemble.get_channel( i ).probability * state_values[ chanqm ].nosend_value;
}

printf( "SEND value = %f, NOSEND value = %f\n", send_value, nosend_value );
// printf( "SEND value = %f, NOSEND value = %f\n", send_value, nosend_value );

return send_value > nosend_value;
}

0 comments on commit fcf7361

Please sign in to comment.