43 #ifndef ILQGAMES_DYNAMICS_CONCATENATED_DYNAMICAL_SYSTEM_H 44 #define ILQGAMES_DYNAMICS_CONCATENATED_DYNAMICAL_SYSTEM_H 46 #include <ilqgames/dynamics/multi_player_dynamical_system.h> 47 #include <ilqgames/dynamics/single_player_dynamical_system.h> 48 #include <ilqgames/utils/linear_dynamics_approximation.h> 49 #include <ilqgames/utils/types.h> 55 using SubsystemList = std::vector<std::shared_ptr<SinglePlayerDynamicalSystem>>;
63 VectorXf Evaluate(Time t,
const VectorXf& x,
64 const std::vector<VectorXf>& us)
const;
68 const std::vector<VectorXf>& us)
const;
71 float DistanceBetween(
const VectorXf& x0,
const VectorXf& x1)
const;
75 VectorXf Stitch(
const VectorXf& x_ego,
const VectorXf& x_others)
const {
76 VectorXf x(x_ego.size());
78 const Dimension ego_state_dim = subsystems_[0]->XDim();
79 x.head(ego_state_dim) = x_ego.head(ego_state_dim);
80 x.tail(x_others.size() - ego_state_dim) =
81 x_others.tail(x_others.size() - ego_state_dim);
87 const SubsystemList& Subsystems()
const {
return subsystems_; }
88 PlayerIndex NumPlayers()
const {
return subsystems_.size(); }
89 Dimension SubsystemStartDim(PlayerIndex player_idx)
const {
90 return subsystem_start_dims_[player_idx];
92 Dimension SubsystemXDim(PlayerIndex player_idx)
const {
93 return subsystems_[player_idx]->XDim();
95 Dimension UDim(PlayerIndex player_idx)
const {
96 return subsystems_[player_idx]->UDim();
98 std::vector<Dimension> PositionDimensions()
const;
102 const SubsystemList subsystems_;
105 std::vector<Dimension> subsystem_start_dims_;