43 #ifndef ILQGAMES_DYNAMICS_CONCATENATED_FLAT_SYSTEM_H 44 #define ILQGAMES_DYNAMICS_CONCATENATED_FLAT_SYSTEM_H 46 #include <ilqgames/dynamics/multi_player_flat_system.h> 47 #include <ilqgames/dynamics/single_player_flat_system.h> 48 #include <ilqgames/utils/linear_dynamics_approximation.h> 49 #include <ilqgames/utils/types.h> 53 using FlatSubsystemList =
54 std::vector<std::shared_ptr<SinglePlayerFlatSystem>>;
62 VectorXf Evaluate(
const VectorXf& x,
const std::vector<VectorXf>& us)
const;
65 void ComputeLinearizedSystem()
const;
68 MatrixXf InverseDecouplingMatrix(
const VectorXf& x)
const;
69 VectorXf AffineTerm(
const VectorXf& x)
const;
70 VectorXf LinearizingControl(
const VectorXf& x,
const VectorXf& v,
71 PlayerIndex player)
const;
72 std::vector<VectorXf> LinearizingControls(
73 const VectorXf& x,
const std::vector<VectorXf>& vs)
const;
74 VectorXf ToLinearSystemState(
const VectorXf& x)
const;
75 VectorXf ToLinearSystemState(
const VectorXf& x,
76 PlayerIndex subsystem_idx)
const;
77 VectorXf FromLinearSystemState(
const VectorXf& xi)
const;
78 VectorXf FromLinearSystemState(
const VectorXf& xi,
79 PlayerIndex subsystem_idx)
const;
80 bool IsLinearSystemStateSingular(
const VectorXf& xi)
const;
83 VectorXf SubsystemStates(
const VectorXf& x, PlayerIndex subsystem_idx)
const;
86 void ChangeCostCoordinates(
const VectorXf& xi,
87 std::vector<QuadraticCostApproximation>* q)
const;
88 void ChangeControlCostCoordinates(
89 const VectorXf& xi, std::vector<QuadraticCostApproximation>* q)
const;
92 float DistanceBetween(
const VectorXf& x0,
const VectorXf& x1)
const;
95 const FlatSubsystemList& Subsystems()
const {
return subsystems_; }
96 PlayerIndex NumPlayers()
const {
return subsystems_.size(); }
97 Dimension SubsystemXDim(PlayerIndex player_idx)
const {
98 return subsystems_[player_idx]->XDim();
100 Dimension SubsystemStartDim(PlayerIndex player_idx)
const {
101 return subsystem_start_dims_[player_idx];
103 Dimension UDim(PlayerIndex player_idx)
const {
104 return subsystems_[player_idx]->UDim();
106 std::vector<Dimension> PositionDimensions()
const;
110 const FlatSubsystemList subsystems_;
113 std::vector<Dimension> subsystem_start_dims_;