Advances the simulation by one frame. Args: time_elapsed: Time elapsed since the last time this method was called. paused: A boolean flag telling if the simulation is paused. Returns: A boolean flag to determine if the episode has finished.
(self, time_elapsed, paused)
| 126 | self.on_physics_changed = util.QuietSet() |
| 127 | |
| 128 | def tick(self, time_elapsed, paused): |
| 129 | """Advances the simulation by one frame. |
| 130 | |
| 131 | Args: |
| 132 | time_elapsed: Time elapsed since the last time this method was called. |
| 133 | paused: A boolean flag telling if the simulation is paused. |
| 134 | Returns: |
| 135 | A boolean flag to determine if the episode has finished. |
| 136 | """ |
| 137 | with self._simulation_timer.measure_time(): |
| 138 | if self._state == State.RESTARTING: |
| 139 | self._state = State.START |
| 140 | if self._state == State.START: |
| 141 | if self._start(): |
| 142 | self._broadcast_episode_start() |
| 143 | self._tracked_simulation_time = self.get_time() |
| 144 | self._state = State.RUNNING |
| 145 | else: |
| 146 | self._state = State.STOPPED |
| 147 | if self._state == State.RUNNING: |
| 148 | finished = self._step_simulation(time_elapsed, paused) |
| 149 | if finished: |
| 150 | self._state = State.STOP |
| 151 | if self._state == State.STOP: |
| 152 | self._state = State.STOPPED |
| 153 | |
| 154 | def _step_simulation(self, time_elapsed, paused): |
| 155 | """Simulate a simulation step.""" |
nothing calls this directly
no test coverage detected