Namespace jalansim::batch

Namespace List > jalansim > batch

Public Functions

Type Name
void collided (const Sim * sims, bool * hits, std::size_t N)
Check collision status for multiple simulations (CPU version).
void destroy (Sim * sims, std::size_t N)
Destroy multiple simulation instances in batch.
void get_range (Sim * sims, T * out, int num_beams, T fov, T max_range, std::size_t N)
Compute range measurements for multiple simulations (CPU version).
void get_state (const Sim * sims, T * out, std::size_t N)
Extract state vectors from multiple simulations (CPU version).
void init (Sim * sims, typename Sim::DynamicsModel dyn, typename Sim::Collision col, std::size_t N)
Initialize multiple simulation instances in batch.
void reset (Sim * sims, std::size_t N, const bool * mask=nullptr)
Reset multiple simulations to initial state.
void sample_map (Sim * sims, jalansim::map::MapCollection< T > * map_collection, std::size_t N, unsigned int base_rng_seed=0, const bool * mask=nullptr)
Sample maps from a map collection and assign to simulations.
void set_map (Sim * sims, jalansim::map::Map< T > * map, std::size_t N)
Set the same map for multiple simulation instances.
void set_state (Sim * sims, const T * states, std::size_t N, const bool * mask=nullptr)
Set state vectors for multiple simulation instances.
void step (Sim * sims, const T * u, T dt, std::size_t N)
Advance multiple simulations by one time step.

Public Functions Documentation

function collided

Check collision status for multiple simulations (CPU version).

template<typename Sim>
inline void jalansim::batch::collided (
    const Sim * sims,
    bool * hits,
    std::size_t N
) 

Template parameters:

  • Sim Simulation type

Parameters:

  • sims Array of simulation instances
  • hits Output array of collision results
  • N Number of simulations

function destroy

Destroy multiple simulation instances in batch.

template<typename Sim>
inline void jalansim::batch::destroy (
    Sim * sims,
    std::size_t N
) 

Template parameters:

  • Sim Simulation type

Parameters:

  • sims Array of simulation instances to destroy
  • N Number of simulations

function get_range

Compute range measurements for multiple simulations (CPU version).

template<typename T, typename Sim>
inline void jalansim::batch::get_range (
    Sim * sims,
    T * out,
    int num_beams,
    T fov,
    T max_range,
    std::size_t N
) 

Template parameters:

  • T Numeric type (float, double)
  • Sim Simulation type

Parameters:

  • sims Array of simulation instances
  • out Output array for range measurements
  • num_beams Number of range sensing beams
  • fov Field of view in radians
  • max_range Maximum sensing range
  • N Number of simulations

function get_state

Extract state vectors from multiple simulations (CPU version).

template<typename T, typename Sim>
inline void jalansim::batch::get_state (
    const Sim * sims,
    T * out,
    std::size_t N
) 

Template parameters:

  • T Numeric type (float, double)
  • Sim Simulation type

Parameters:

  • sims Array of simulation instances
  • out Output array for state vectors (size N * STATE_DIM)
  • N Number of simulations

function init

Initialize multiple simulation instances in batch.

template<typename Sim>
inline void jalansim::batch::init (
    Sim * sims,
    typename Sim::DynamicsModel dyn,
    typename Sim::Collision col,
    std::size_t N
) 

Template parameters:

  • Sim Simulation type

Parameters:

  • sims Array of simulation instances to initialize
  • dyn Dynamics model to use for initialization
  • col Collision model to use for initialization
  • N Number of simulations

function reset

Reset multiple simulations to initial state.

template<typename T, class Sim>
inline void jalansim::batch::reset (
    Sim * sims,
    std::size_t N,
    const bool * mask=nullptr
) 

Template parameters:

  • T Numeric type (float, double)
  • Sim Simulation type

Parameters:

  • sims Array of simulation instances
  • N Number of simulations
  • mask Optional mask array (if provided, only reset where mask[i] is true)

function sample_map

Sample maps from a map collection and assign to simulations.

template<typename T, class Sim>
inline void jalansim::batch::sample_map (
    Sim * sims,
    jalansim::map::MapCollection < T > * map_collection,
    std::size_t N,
    unsigned int base_rng_seed=0,
    const bool * mask=nullptr
) 

Template parameters:

  • T Numeric type (float, double)
  • Sim Simulation type

Parameters:

  • sims Array of simulation instances
  • map_collection Collection of maps to sample from
  • N Number of simulations
  • base_rng_seed Base seed for random number generation (0 for time-based)
  • mask Optional mask array (if provided, only sample where mask[i] is true)

function set_map

Set the same map for multiple simulation instances.

template<typename T, class Sim>
inline void jalansim::batch::set_map (
    Sim * sims,
    jalansim::map::Map < T > * map,
    std::size_t N
) 

Template parameters:

  • T Numeric type (float, double)
  • Sim Simulation type

Parameters:

  • sims Array of simulation instances
  • map Map to assign to all simulations
  • N Number of simulations

function set_state

Set state vectors for multiple simulation instances.

template<typename T, typename Sim>
inline void jalansim::batch::set_state (
    Sim * sims,
    const T * states,
    std::size_t N,
    const bool * mask=nullptr
) 

Template parameters:

  • T Numeric type (float, double)
  • Sim Simulation type

Parameters:

  • sims Array of simulation instances
  • states Array of state vectors to assign (size N * STATE_DIM)
  • N Number of simulations
  • mask Optional mask array (if provided, only set where mask[i] is true)

function step

Advance multiple simulations by one time step.

template<typename T, typename Sim>
inline void jalansim::batch::step (
    Sim * sims,
    const T * u,
    T dt,
    std::size_t N
) 

Template parameters:

  • T Numeric type (float, double)
  • Sim Simulation type

Parameters:

  • sims Array of simulation instances
  • u Array of control inputs for all simulations (size N * INPUT_DIM)
  • dt Time step size
  • N Number of simulations


The documentation for this class was generated from the following file include/jalansim/batch/collided.hpp