File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -137,9 +137,6 @@ namespace cadmium {
137137 return oss.str ();
138138 };
139139
140- // cleanning the inbox and outbox for collecting new messages
141- _inbox = in_bags_type{};
142- _outbox = out_bags_type{};
143140 // collecting if necessary
144141 if (_next < t) {
145142 throw std::domain_error (" Trying to obtain output when not internal event is scheduled" );
@@ -166,6 +163,9 @@ namespace cadmium {
166163 * @param t is the time the transition is expected to be run.
167164 */
168165 void advance_simulation (const TIME &t) {
166+ // clean outbox because messages are routed before calling this funtion at a higher level
167+ _outbox = out_bags_type{};
168+
169169 auto log_info_advance = [](const TIME& from, const TIME& to) -> std::string {
170170 std::ostringstream oss;
171171 oss << " Coordinator for model " ;
Original file line number Diff line number Diff line change @@ -161,6 +161,9 @@ namespace cadmium {
161161 * @param t is the time the transition is expected to be run.
162162 */
163163 void advance_simulation (TIME t) {
164+ // clean outbox because messages are routed before calling this funtion at a higher level
165+ _outbox = out_bags_type{};
166+
164167 auto log_info_advance = [](const TIME& from, const TIME& to) -> std::string {
165168 std::ostringstream oss;
166169 oss << " Simulator for model " ;
Original file line number Diff line number Diff line change @@ -201,7 +201,6 @@ BOOST_AUTO_TEST_CASE( simple_outbox_cleanup_bug_test){
201201 std::string accum_states = " State for model cadmium::basic_models::accumulator" ;
202202 cadmium::engine::runner<float , DTOP, log_time_and_state> r{0.0 };
203203 r.runUntil (5.0 );
204- std::cout << oss.str ();
205204 int count_initial_states = count_matches (expected_initial_state, oss.str ());
206205 int count_expected_accumulation = count_matches (expected_accumulation_of_one, oss.str ());
207206 int count_accum_states = count_matches (accum_states, oss.str ());
You can’t perform that action at this time.
0 commit comments