We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e294d30 commit c73492aCopy full SHA for c73492a
tinyphysics.py
@@ -122,9 +122,9 @@ def get_data(self, data_path: str) -> pd.DataFrame:
122
123
def sim_step(self, step_idx: int) -> None:
124
pred = self.sim_model.get_current_lataccel(
125
- sim_states=self.state_history[max(0, step_idx - CONTEXT_LENGTH):step_idx],
126
- actions=self.action_history[max(0, step_idx - CONTEXT_LENGTH):step_idx],
127
- past_preds=self.current_lataccel_history[max(0, step_idx - CONTEXT_LENGTH):step_idx]
+ sim_states=self.state_history[-CONTEXT_LENGTH:],
+ actions=self.action_history[-CONTEXT_LENGTH:],
+ past_preds=self.current_lataccel_history[-CONTEXT_LENGTH:]
128
)
129
pred = np.clip(pred, self.current_lataccel - MAX_ACC_DELTA, self.current_lataccel + MAX_ACC_DELTA)
130
if step_idx >= CONTROL_START_IDX:
0 commit comments