Jit Core function#

This section contains the core engine of the simulator.

smart_cruise.jit.compute(start, timings, speed_array, cruise_matrix, up_matrix, down_matrix, height_gain, weight_cost, backoff, pareto_max)[source]#

Core computation of optimal trajectories.

Parameters:
  • start (list) – Initial (weight, time) budgets.

  • timings (ndarray) – Time cost per speed level.

  • speed_array (ndarray) – Speed cost adjustments.

  • cruise_matrix (ndarray) – Base energy cost matrix (track point x height).

  • up_matrix (ndarray) – Energy cost for moving upward by one height level.

  • down_matrix (ndarray) – Energy gain for moving downward by one height level.

  • height_gain (float)

  • weight_cost (float)

  • backoff (int)

  • pareto_max (int)

smart_cruise.jit.insert_state(states, h, s, b, w, t, p)[source]#

Defaultdict-like state insertion.

Parameters:
  • states (Dict) – A Numba typed dict (h, s, b) -> [(w, t, p)].

  • h (int) – Height index.

  • s (int) – Speed index.

  • b (int) – Backoff.

  • w (float) – Weight.

  • t (float) – Time.

  • p (int) – Index of origin state.

Return type:

None

smart_cruise.jit.new_state_dict()[source]#

Creates empty state dict

Returns:

A Numba typed dict (h, s, b) -> [(w, t, p)].

Return type:

Dict

smart_cruise.jit.pareto_collapse(states, pareto_max)[source]#
Parameters:
  • states (Dict) – A Numba typed dict (h, s, b) -> [(w, t, p)].

  • pareto_max (int) – Maximum number of pareto points.

Return type:

None