fn iterate_n_times(&mut self, n: u32) {
            let dt = self.thermal_policy.config.policy_params.controller_params.sample_interval;

            for _ in 0..n {
                self.time += dt;
                self.executor.set_fake_time(fasync::Time::from_nanos(self.time.into_nanos()));
                self.sim.borrow_mut().step(dt);
                // In the future below, the compiler would see `self.thermal_policy` as triggering
                // an immutable borrow of `self.executor`, which cannot occur within
                // `self.executor.run_until_stalled`. Pulling out the reference here avoids that
                // problem.
                let thermal_policy = &mut self.thermal_policy;
                assert!(self
                    .executor
                    .run_until_stalled(&mut Box::pin(async {
                        thermal_policy.iterate_thermal_control().await.unwrap();
                    }))
                    .is_ready());
            }
        }
/// Iterates the policy n times.
Iterates the policy n times.
Iterates the policy n times .
fn iterate_n_times(&mut self, n: u32) {
            let dt = self.thermal_policy.config.policy_params.controller_params.sample_interval;
            for _ in 0..n {
                self.time += dt;
                self.executor.set_fake_time(fasync::Time::from_nanos(self.time.into_nanos()));
                self.sim.borrow_mut().step(dt);
                // In the future below, the compiler would see `self.thermal_policy` as triggering
                // an immutable borrow of `self.executor`, which cannot occur within
                // `self.executor.run_until_stalled`. Pulling out the reference here avoids that
                // problem.
                let thermal_policy = &mut self.thermal_policy;
                assert!(self
                    .executor
                    .run_until_stalled(&mut Box::pin(async {
                        thermal_policy.iterate_thermal_control().await.unwrap();
                    }))
                    .is_ready());
            }
        }
fn iterate_n_times ( & mut self , n : u32 ) { let dt = self . thermal_policy . config . policy_params . controller_params . sample_interval ; for _ in 0 .. n { self . time += dt ; self . executor . set_fake_time ( fasync :: Time :: from_nanos ( self . time . into_nanos ( ) ) ) ; self . sim . borrow_mut ( ) . step ( dt ) ; // In the future below, the compiler would see `self.thermal_policy` as triggering // an immutable borrow of `self.executor`, which cannot occur within // `self.executor.run_until_stalled`. Pulling out the reference here avoids that // problem. let thermal_policy = & mut self . thermal_policy ; assert ! ( self executor run_until_stalled ( mut Box pin ( async { thermal_policy iterate_thermal_control ( ) await unwrap ( ) } ) ) is_ready ( ) ) ; } }
Iterates the policy n times.
Iterates the policy n times .
&mut self
n
u32