docs: def _copy_plans(self, branch_from, turn_from, tick_from):
          """Collect all plans that are active at the given time and copy them to the current branch"""
          plan_ticks = self._plan_ticks
          plan_ticks_uncommitted = self._plan_ticks_uncommitted
          time_plan = self._time_plan
          plans = self._plans
          branch = self.branch
          where_cached = self._where_cached
          last_plan = self._last_plan
          turn_end_plan = self._turn_end_plan
          for plan_id in self._branches_plans[branch_from]:
              _, start_turn, start_tick = plans[plan_id]
              if start_turn > turn_from or (start_turn == turn_from and start_tick > tick_from):
                  continue
              incremented = False
              for turn, ticks in list(plan_ticks[plan_id].items()):
                  if turn < turn_from:
                      continue
                  for tick in ticks:
                      if turn == turn_from and tick < tick_from:
                          continue
                      if not incremented:
                          self._last_plan = last_plan = last_plan + 1
                          incremented = True
                          plans[last_plan] = branch, turn, tick
                      for cache in where_cached[branch_from, turn, tick]:
                          data = cache.settings[branch_from][turn][tick]
                          value = data[-1]
                          key = data[:-1]
                          args = key + (branch, turn, tick, value)
                          if hasattr(cache, 'setdb'):
                              cache.setdb(*args)
                          cache.store(*args, planning=True)
                          plan_ticks[last_plan][turn].append(tick)
                          plan_ticks_uncommitted.append((last_plan, turn, tick))
                          time_plan[branch, turn, tick] = last_plan
                          turn_end_plan[branch, turn] = tick